X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=perl%2Flib%2FSys%2FGuestfs%2FLib.pm;h=e17728d5ab55e19e8a50d155550f28c3555dc088;hp=c9a3237cf672970cbe6548f60325dd0d4486ae56;hb=c03b7e4d756597f30415260a84a3caee3d9d6bde;hpb=33b4b759afe58c959bdc8b904d618aa1d699a240 diff --git a/perl/lib/Sys/Guestfs/Lib.pm b/perl/lib/Sys/Guestfs/Lib.pm index c9a3237..e17728d 100644 --- a/perl/lib/Sys/Guestfs/Lib.pm +++ b/perl/lib/Sys/Guestfs/Lib.pm @@ -117,6 +117,10 @@ disk image, then C<$conn> and C<$dom> will be C. If the C module is not available, then libvirt is bypassed, and this function can only open disk images. +The optional C parameter can be used to open devices with +C. See +L for more details. + =cut sub open_guest @@ -127,6 +131,7 @@ sub open_guest my $rw = $params{rw}; my $address = $params{address}; + my $interface = $params{interface}; my @images = (); if (ref ($first) eq "ARRAY") { @@ -203,9 +208,17 @@ sub open_guest my $g = Sys::Guestfs->new (); foreach (@images) { if ($rw) { - $g->add_drive ($_); + if ($interface) { + $g->add_drive_with_if ($_, $interface); + } else { + $g->add_drive ($_); + } } else { - $g->add_drive_ro ($_); + if ($interface) { + $g->add_drive_ro_with_if ($_, $interface); + } else { + $g->add_drive_ro ($_); + } } }