summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
33b4b75)
This allows you to override the default QEMU block device emulation.
If the C<Sys::Virt> module is not available, then libvirt is bypassed,
and this function can only open disk images.
If the C<Sys::Virt> module is not available, then libvirt is bypassed,
and this function can only open disk images.
+The optional C<interface> parameter can be used to open devices with
+C<add_drive{,_ro}_with_if>. See
+L<Sys::Guestfs/guestfs_add_drive_with_if> for more details.
+
my $rw = $params{rw};
my $address = $params{address};
my $rw = $params{rw};
my $address = $params{address};
+ my $interface = $params{interface};
my @images = ();
if (ref ($first) eq "ARRAY") {
my @images = ();
if (ref ($first) eq "ARRAY") {
my $g = Sys::Guestfs->new ();
foreach (@images) {
if ($rw) {
my $g = Sys::Guestfs->new ();
foreach (@images) {
if ($rw) {
+ if ($interface) {
+ $g->add_drive_with_if ($_, $interface);
+ } else {
+ $g->add_drive ($_);
+ }
+ if ($interface) {
+ $g->add_drive_ro_with_if ($_, $interface);
+ } else {
+ $g->add_drive_ro ($_);
+ }