Bug 957380

Summary: libguestfs: error: btrfsvol:/dev/sda2/root: root device not found: only call this function with a root device previously returned by guestfs_inspect_os
Product: [Community] Virtualization Tools Reporter: Richard W.M. Jones <rjones>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED UPSTREAM QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: dyasny, mbooth, pioto
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-04-29 19:24:00 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
log from failing tests/mountable/test-mountable-inspect.sh, with LIBGUESTFS_TRACE=1 none

Description Richard W.M. Jones 2013-04-27 20:42:47 UTC
Description of problem:

(Reported by Mike Kelly on IRC)

make[2]: Entering directory `/home/pioto/git/libguestfs/tests/mountable'
25 seconds: ./test-internal-parse-mountable
PASS: test-internal-parse-mountable
/home/pioto/git/libguestfs/run --test ./test-mountable-inspect.sh
Formatting 'test.qcow2', fmt=qcow2 size=1073741824 backing_file='../guests/fedora-btrfs.img' backing_fmt='raw' encryption=off c
luster_size=65536 
libguestfs: error: mount: mount: /home: No such file or directory
lt-guestfish: some filesystems could not be mounted (ignored)
*stdin*:1: libguestfs: error: btrfsvol:/dev/sda2/root: root device not found: only call this function with a root device previo
usly returned by guestfs_inspect_os
/home/pioto/git/libguestfs/tests/mountable/test-mountable-inspect.sh: error #1: unexpected output from inspect-get-mountpoints
/home/pioto/git/libguestfs/run: command failed with exit code 1
FAIL: test-mountable-inspect.sh
===================
1 of 2 tests failed
===================

Version-Release number of selected component (if applicable):

libguestfs 1.21.3x (from git)

Additional info:

Using Ubuntu 12.04, so qemu without virtio-scsi.

Comment 1 Mike Kelly 2013-04-29 17:26:26 UTC
Created attachment 741577 [details]
log from failing tests/mountable/test-mountable-inspect.sh, with LIBGUESTFS_TRACE=1

Comment 2 Richard W.M. Jones 2013-04-29 18:26:15 UTC
I see.  This is actually a bug in the test.

The test does:

guestfish -a test.qcow2 -i <<'EOF' # ...
  inspect-get-mountpoints btrfsvol:/dev/sda2/root
EOF

but this is wrong because the way the inspect-os API is
defined, you *have* to pass the precise string returned by
inspect-os back to inspect-get-mountpoints.  The test assumes
that the string is "btrfsvol:/dev/sda2/root", which it is
not in this case (it is in fact "btrfsvol:/dev/vda2/root").

The test does this in two places.

The following patch should fix it:

https://github.com/libguestfs/libguestfs/commit/93e64b4448c7afccf4c4751ff5deba3e321e7851

Comment 3 Mike Kelly 2013-04-29 19:22:21 UTC
I think this can now be resolved:

100 seconds: ./test-mountable-inspect.sh
PASS: test-mountable-inspect.sh

Thanks for the quick patch.

Comment 4 Richard W.M. Jones 2013-04-29 19:24:00 UTC
Thanks for the quick response.  Closing as "UPSTREAM".
Fix will be in 1.21.35.