Bug 1588451
Summary: | Don't use relative socket paths for NBD | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Peter Krempa <pkrempa> |
Component: | libguestfs | Assignee: | Richard W.M. Jones <rjones> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 7.5 | CC: | libvirt-maint, pkrempa, ptoscano, rjones, yoguo |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | libguestfs-1.38.2-5.el7 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | 1588447 | Environment: | |
Last Closed: | 2018-10-30 07:45:35 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: | |||
Bug Depends On: | 1588447 | ||
Bug Blocks: |
Description
Peter Krempa
2018-06-07 11:35:33 UTC
Yes we'll have to "absolutize" (is that a word?) these paths before adding them to the XML, easy fix. I don't have a very good reproducer because it only happens sometimes on some architectures. We could only reproduce it under Koji, on i686, with the very latest libvirt. This _may_ reproduce the problem: rm -f test.sock nbdkit -U test.sock example1 guestfish --format=raw -a 'nbd://?socket=test.sock' run killall nbdkit Note the error message when the bug has been reproduced is: Failed to connect socket test.sock: No such file or directory If you see other errors (eg. Permission denied) then you are not reproducing the error. Permission denied can happen because of SELinux. In fact to get guestfish to connect you'll probably need to set SELinux to Permissive. You can also try the full path which should NOT reproduce the problem, eg: guestfish --format=raw -a 'nbd://?socket=/var/tmp/test.sock' run The change we are going to make to libguestfs is to turn relative paths (test.sock) into absolute paths (/var/tmp/test.sock). v2 of patch which fixes the tests: https://www.redhat.com/archives/libguestfs/2018-June/msg00067.html Reproduced with the following packages: libvirt-4.4.0-1.fc29.i686 libguestfs-1.38.2-1.fc28.i686 nbdkit-1.2.2-1.fc28.i686 Steps: 1. Update libvirt on fedora28 host and then install nbdkit related packages. 2. rm -f test.sock 3. nbdkit -U test.sock example1 4. guestfish --format=raw -a 'nbd://?socket=test.sock' run --------------------------------------------------------- Original error from libvirt: internal error: process exited while connecting to monitor: 2018-06-20T08:40:16.518284Z qemu-system-i386: -drive file=nbd+unix://?socket=test.sock,format=raw,if=none,id=drive-scsi0-0-0-0,cache=writeback: Failed to connect socket test.sock: No such file or directory [code=1 int1=-1] --------------------------------------------------------- I can reproduce this bug, but when I turn the relative paths to absolute paths, another error pops up. # killall nbdkit # rm -rf test.sock # nbdkit -U test.sock example1 # guestfish --format=raw -a 'nbd://?socket=/home/test.sock' run ---------------------------------------------------------- Original error from libvirt: internal error: process exited while connecting to monitor: 2018-06-20 08:43:20.115+0000: Domain id=5 is tainted: high-privileges 2018-06-20 08:43:20.115+0000: Domain id=5 is tainted: custom-argv 2018-06-20T08:43:20.197767Z qemu-system-i386: -drive file=nbd:unix:/home/test.sock,format=raw,if=none,id=drive-scsi0-0-0-0,cache=writeback: request for write access conflicts with read-only export [code=1 int1=-1] rjones, do you know the reason about the error above? > rjones, do you know the reason about the error above?
Ooops, my example was wrong.
Try changing the nbdkit command to use the example3 plugin
which is writable:
nbdkit -U test.sock example3
BTW you shouldn't need to run the tests as root.
> Try changing the nbdkit command to use the example3 plugin
> which is writable:
>
> nbdkit -U test.sock example3
>
> BTW you shouldn't need to run the tests as root.
The example3 plugin is OK. Thanks a lot.
Upstream in https://github.com/libguestfs/libguestfs/commit/70bc83f893e6e0daf20ca7c9b7bfe875ceaed594 which will be included in libguestfs >= 1.39.6. I'll also backport this to 1.38 at some point. Note the current bug is against RHEL 7 so I'm not going to close it. Verified with packages: libguestfs-1.38.2-8.el7.x86_64 nbdkit-1.2.6-1.el7.x86_64 libvirt-4.5.0-3.el7.x86_64 Steps: 1.Install nbdkit and nbdkit-example-plugins packages on rhel7.6 host, then run the following commands: $ rm -f test.sock $ nbdkit -U test.sock example3 $ guestfish --format=raw -a 'nbd://?socket=test.sock' run No error pops up. Verified it. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHEA-2018:3021 |