Bug 1529035

Summary: guestmount --ro fails on a disk image in use by running virtual machine
Product: [Fedora] Fedora Reporter: Tom Horsley <horsley1953>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 27CC: mgoldman, rjones
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-26 10:12:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
output with debug flags turned on none

Description Tom Horsley 2017-12-26 05:16:14 UTC
Created attachment 1372339 [details]
output with debug flags turned on

Description of problem:

guestmount -d centinil -i --ro mnt

worked in fedora 26 to mount a read only snapshot of the centinil disk image on "mnt". On fedora 27 it fails and tells me to re-run the command with a lot of debug flags. (I'll attach the output from doing that).

I see one of the debug output errors is:

qemu-img: /tmp/libguestfssn6HDK/overlay1.qcow2: Failed to get shared "write" lock
Is another process using the image?

And the answer is, "yes" which is why I used --ro (which the man page says should work even on running VMs).

Version-Release number of selected component (if applicable):
libguestfs-tools-c-1.37.35-1.fc27.x86_64

How reproducible:
100%

Steps to Reproduce:
1.see above
2.
3.

Actual results:
Error from guestmount

Expected results:
Mounted read only snapshot

Additional info:
guestmount works fine if I shutdown the VM before trying the mount.

P.S. What the heck does "Erlang bindings for libguestfs" mean as a description for the libguestfs component. Isn't that a bit self-referential?

Comment 1 Richard W.M. Jones 2017-12-26 10:12:38 UTC
This is caused by a bug in libvirt, therefore I'm making this a
duplicate of the other bug.

You can work around this (temporarily, hopefully) using the
direct backend:

  export LIBGUESTFS_BACKEND=direct

Note that accessing a qcow2 image, even read only, isn't
guaranteed to give sensible results.  Your application needs
to deal with failures.

> P.S. What the heck does "Erlang bindings for libguestfs" mean as a
> description for the libguestfs component. Isn't that a bit self-
> referential?

It seems to describe the purpose of the erlang-libguestfs package.
What's the problem?

*** This bug has been marked as a duplicate of bug 1513447 ***

Comment 2 Richard W.M. Jones 2017-12-26 10:14:18 UTC
... accessing a *live* qcow2 image ...

Comment 3 Tom Horsley 2017-12-26 12:47:44 UTC
(In reply to Richard W.M. Jones from comment #1)

> > P.S. What the heck does "Erlang bindings for libguestfs" mean as a
> > description for the libguestfs component. Isn't that a bit self-
> > referential?
> 
> It seems to describe the purpose of the erlang-libguestfs package.
> What's the problem?

It is the description I get for the package "libguestfs" when I was adding this bugzilla (not the "erlang-libguestfs" package).

Comment 4 Tom Horsley 2017-12-26 12:51:44 UTC
I do have the libvirt-3.7.0-3.fc27 mentioned in the other bug. If there is something else needed to get the --ro mount to work, it ought to be mentioned in the guestmount man page.

Comment 5 Richard W.M. Jones 2017-12-26 18:08:15 UTC
(In reply to Tom Horsley from comment #3)
> (In reply to Richard W.M. Jones from comment #1)
> 
> > > P.S. What the heck does "Erlang bindings for libguestfs" mean as a
> > > description for the libguestfs component. Isn't that a bit self-
> > > referential?
> > 
> > It seems to describe the purpose of the erlang-libguestfs package.
> > What's the problem?
> 
> It is the description I get for the package "libguestfs" when I was adding
> this bugzilla (not the "erlang-libguestfs" package).

Hmm, you're not wrong about that.  I've filed a bug:

https://bugzilla.redhat.com/show_bug.cgi?id=1529142

(In reply to Tom Horsley from comment #4)
> I do have the libvirt-3.7.0-3.fc27 mentioned in the other bug. If there is
> something else needed to get the --ro mount to work, it ought to be
> mentioned in the guestmount man page.

Maybe I didn't get the right duplicate, but this is still a bug in
libvirt.  It's not a bug in libguestfs so it doesn't require changes
to this package so far.  Please follow up on the other bug.