#884110 libguestfs-perl: libguestfs perl bindings fails to report virtualdisk after upgrade from 1.34 to 1.36

Package:
libguestfs-perl
Source:
libguestfs
Description:
guest disk image management system - Perl bindings
Submitter:
Emmanuel Kasper
Date:
2017-12-13 16:21:06 UTC
Severity:
normal
#884110#5
Date:
2017-12-11 14:18:45 UTC
From:
To:
Dear Package maintainer

After upgrading libguestfs0 to 1.36, the sub routine disk_virtual_size fails with a qemu-img error.

Here is a small perl script which reproduces the issue:

#!/usr/bin/perl
use warnings;
use strict;

use Sys::Guestfs;

system("qemu-img create -f vmdk test1.vmdk 1M");
my @disks = ("test1.vmdk");

my $g = Sys::Guestfs->new();

# turning readonly to 1, allow $g->disk_virtual_size to report properly
$g->add_drive_opts($_ , readonly => 0) foreach @disks;
$g->launch();

eval {
    print $_ . ": " . $g->disk_virtual_size($_) . "\n" foreach @disks;
    $g->close ();
};

unlink $_ foreach @disks;

die $@ if $@;


I attached to this bug report the output generated by setting export LIBGUESTFS_DEBUG=1.

#884110#10
Date:
2017-12-11 14:37:57 UTC
From:
To:
* Emmanuel Kasper:

I assume that you mean the error below, am I correct?

,----
| qemu-img: Could not open '/dev/fd/3': Failed to get shared "write" lock
| Is another process using the image?
| qemu-img info: test1.vmdk: qemu-img info exited with error status 1, see debug messages above at bug.pl line 19.
`----

Is the .vmdk file writable by the user running the script?

Cheers,
-Hilko

#884110#15
Date:
2017-12-11 14:48:34 UTC
From:
To:
Yes.

Yes. Using the reproducer in the bug report, the vmdk is created as the
same user trying to read the virtual disk size.

#884110#20
Date:
2017-12-12 09:49:09 UTC
From:
To:
I am also on the libguestfs mailing list, should I mention the issue
there, or do you prefer to report this upstream yourself ?

#884110#25
Date:
2017-12-12 10:20:42 UTC
From:
To:
* Emmanuel Kasper:

Please do mention it there, too.

Cheers,
-Hilko

#884110#30
Date:
2017-12-13 16:19:25 UTC
From:
To: