libguestfs uses aug_get to get /files/etc/fstab/X/opt instead /files/etc/fstab/X/opt[Y]
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| libguestfs (Ubuntu) |
Medium
|
Unassigned |
Bug Description
When running virt-sysprep on a VM file containing an fstab, with entries with multiple options, it will fail with "guestfsd: error: aug_get: /files/
Augeas' aug_get only returns the value for a single node, and will fail with an error if there are multiple matches for the string. In this case, the nodes "/files/
It appears that libguestfs does "aug_match /files/
Ubuntu version: Ubuntu 16.04 LTS
libguestfs0 version: 1:1.32.2-4ubuntu2
libguestfs-tools version: 1:1.32.2-4ubuntu2
Additional information:
The image file in question is a qcow2 image file, with Ubuntu 16.04 "xenial" installed.
The partitions present on the qcow2 image are a FAT32 EFI System Partition, and a btrfs root filesystem with two subvolumes: @ (for /), and @home (for /home).
The fstab present on the installation of Ubuntu contains multiple fstab entries with multiple options, e.g. "relatime,subvol=@" for /
Zhongfu Li (zhongfu) wrote : | #1 |
Zhongfu Li (zhongfu) wrote : | #2 |
Richard Jones (rjones-redhat) wrote : | #3 |
Reproducer for this is:
$ virt-builder fedora-24
$ rm fedora-24-copy
$ truncate -s20G fedora-24-copy
$ virt-resize fedora-24.img fedora-24-copy
$ guestfish -a fedora-24-copy -i
><fs> list-filesystems
/dev/sda1: ext4
/dev/sda2: swap
/dev/sda3: xfs
/dev/sda4: unknown
><fs> mkfs btrfs /dev/sda4
><fs> list-filesystems
/dev/sda1: ext4
/dev/sda2: swap
/dev/sda3: xfs
/dev/sda4: btrfs
><fs> emacs /etc/fstab
... Add an extra fstab entry at the end of the file:
/dev/sda4 /home btrfs rw,user 0 0
... It doesn't matter what the options field says as long as there are
at least 2 options.
><fs> exit
$ virt-inspector fedora-24-copy
libguestfs: error: aug_get: aug_get: /files/
Richard Jones (rjones-redhat) wrote : | #4 |
Richard Jones (rjones-redhat) wrote : | #5 |
Fixed upstream in
https:/
which will appear in libguestfs >= 1.35.2 and >= 1.34.1.
Launchpad Janitor (janitor) wrote : | #6 |
Status changed to 'Confirmed' because the bug affects multiple users.
Changed in libguestfs (Ubuntu): | |
status: | New → Confirmed |
Changed in libguestfs (Ubuntu): | |
importance: | Undecided → Medium |
Landon Gilbert-Bland (landogbland) wrote : | #7 |
Any idea if the patched version will make it 16.04?
Thomas Dreibholz (dreibh) wrote : | #8 |
The bug still exists in Ubuntu 16.04., more than one year after a fix has been released. Is there any backport available?
Richard Jones (rjones-redhat) wrote : | #9 |
Someone's going to need to step up and become a maintainer, because there is currently no libguestfs maintainer for Ubuntu.
Arnab Banerjee (arnabcse28) wrote : | #10 |
Looks like there's no fix available for Ubuntu 16.04 yet for this issue...
Bug still exists as of commit c711b517094375d 4c321af4800e747 b955643133 (https:/ /github. com/libguestfs/ libguestfs/ commit/ c711b517094375d 4c321af4800e747 b955643133)