Commit 250b8982 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Helper method to set the disk image for a node.

parent b3411d01
......@@ -700,6 +700,30 @@ sub GetDiskImage($)
return $result;
}
sub SetDiskImage($$)
{
my ($node, $urn) = @_;
my $diskref = undef;
if (IsVersion0($node)) {
$diskref = FindFirst("n:disk_image", $node);
if (!defined($diskref)) {
$diskref = AddElement("disk_image", $node);
}
}
else {
my $type = FindFirst("n:sliver_type", $node);
if (! defined($type)) {
$type = AddElement("sliver_type", $node);
}
$diskref = FindFirst("n:disk_image", $type);
if (!defined($diskref)) {
$diskref = AddElement("disk_image", $type);
}
}
GeniXML::SetText("name", $diskref, $urn);
return $diskref;
}
sub GetExclusive($)
{
my ($node) = @_;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment