Bug 1932785
| Summary: | [RFE] Add --pidfile option to qemu-storage-daemon | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux Advanced Virtualization | Reporter: | Stefan Hajnoczi <stefanha> |
| Component: | qemu-kvm | Assignee: | Stefan Hajnoczi <stefanha> |
| qemu-kvm sub component: | Storage | QA Contact: | qing.wang <qinwang> |
| Status: | CLOSED ERRATA | Docs Contact: | |
| Severity: | medium | ||
| Priority: | high | CC: | coli, ddepaula, jinzhao, juzhang, kwolf, rjones, virt-maint |
| Version: | 8.2 | Keywords: | FutureFeature, RFE, Triaged |
| Target Milestone: | rc | Flags: | pm-rhel:
mirror+
|
| Target Release: | 8.4 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | qemu-kvm-6.0.0-16.module+el8.5.0+10848+2dccc46d | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2021-11-16 07:51:47 UTC | Type: | Feature Request |
| 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: | 1901323 | ||
| Bug Blocks: | |||
|
Description
Stefan Hajnoczi
2021-02-25 09:19:06 UTC
Another case for this is to ensure that the server has started listening on the socket (so note the server must socket/bind/listen before writing the pidfile). The idea is you can poll for creation of the pidfile and then immediately connect to the socket. The command I was running was: qemu-storage-daemon --blockdev raw,file.driver=file,file.filename=/tmp/nbdftEX2V,node-name=disk0 --nbd-server addr.type=unix,addr.path=/tmp/sock --export nbd,node-name=disk0,id=nbd0,name=/ but we found that /tmp/sock (created by q-s-d) is not connectable until some short window after it has been created on disk. FWIW with Stefan's and Dan's help I was able to do synchronization-free socket passing to qemu-storage-daemon. It was definitely not obvious and could do with some documentation. https://gitlab.com/nbdkit/libnbd/-/commit/89113f484effb0e6c322314ba75c1cbe07a04543 (I mean race-free rather than synchronization-free) (In reply to Richard W.M. Jones from comment #2) > FWIW with Stefan's and Dan's help I was able to do synchronization-free > socket passing to qemu-storage-daemon. It was definitely not obvious and > could do with some documentation. > > https://gitlab.com/nbdkit/libnbd/-/commit/ > 89113f484effb0e6c322314ba75c1cbe07a04543 Thank you! I have submitted a documentation patch based on your Python code: https://lists.gnu.org/archive/html/qemu-devel/2021-03/msg00222.html I have posted a patch: https://lists.gnu.org/archive/html/qemu-devel/2021-03/msg00236.html Passed test on Red Hat Enterprise Linux release 8.5 Beta (Ootpa) 4.18.0-305.1.el8.x86_64 qemu-kvm-common-6.0.0-16.module+el8.5.0+10848+2dccc46d.x86_64 Test steps: 1.Check help message: qemu-storage-daemon -h --pidfile <path> write process ID to a file after startup 2.Miss path parameter qemu-storage-daemon --pidfile qemu-storage-daemon: option '--pidfile' requires an argument 3.give full parameter qemu-storage-daemon --pidfile /tmp/x.pid 4.pgrep -f qemu-storage-daemon and compare the content of pidfile, it should be same $ pgrep -f qemu-storage-daemon 449363 $ cat /tmp/x.pid 449363 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 (virt:av bug fix and enhancement update), 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/RHBA-2021:4684 |