Bug 1493890
| Summary: | qemu hangs if shut down NBD service then make snapshot of the extra NBD disk. | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Longxiang Lyu <lolyu> |
| Component: | qemu-kvm-rhev | Assignee: | Eric Blake <eblake> |
| Status: | CLOSED DUPLICATE | QA Contact: | Longxiang Lyu <lolyu> |
| Severity: | low | Docs Contact: | |
| Priority: | low | ||
| Version: | 7.4 | CC: | aliang, chayang, coli, eblake, juzhang, knoel, lolyu, michen, qizhu, qzhang, shuang, virt-maint |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2017-10-06 18:03:36 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: | |||
(In reply to Longxiang Lyu from comment #0) > Description of problem: > qemu hangs if shut down NBD service then make snapshot of the extra NBD disk. > > Version-Release number of selected component (if applicable): > kernel-3.10.0-709.el7.x86_64 > qemu-kvm-rhev-2.9.0-16.el7_4.8 > > > How reproducible: > 100% > > Steps to Reproduce: > 1. use qemu to export a disk as NBD driver > # qemu-kvm -drive file=test.qcow2,format=raw,id=img0 -qmp > tcp:0:5555,server,nowait -monitor stdio -incoming tcp:0:6666 > qmp: > { "execute": "qmp_capabilities" } > { "execute": "nbd-server-start", "arguments": { "addr": { "type": "inet", > "data": { "host": "10.66.11.1", "port": "9000" } } } } > { "execute": "nbd-server-add", "arguments": { "device": "img0", "writable": > true } } Can you reproduce the VM hanging by using qemu-nbd instead of qemu-kvm as the NBD export? qemu-nbd -f raw test.qcow2 -p 9000 -x img0 > > 2. boot up a VM with the NBD image as additional driver > ... > -drive > file=/home/test/streamnbd/test.raw,format=raw,if=none,cache=none, > snapshot=off,rerror=stop,werror=stop,id=img0 \ > -device ide-hd,bus=ide.0,unit=0,drive=img0,id=ide-disk0,bootindex=0 \ > -drive > file=nbd://10.66.11.1:9000/img0,format=qcow2,if=none,cache=none,snapshot=off, > rerror=stop,werror=stop,id=img1 \ > -device ide-hd,bus=ide.0,unit=1,drive=img1,id=ide-disk1 \ > … > This requests that on EIO error on the NBD drive, the guest should stop... > 3. stop nbd service > { "execute" : "nbd-server-stop", "arguments" : {} } ...and this should cause an EIO error on the next access to the NBD drive > > 4. do snapshot of img1 > { "execute": "blockdev-snapshot-sync", "arguments": { "device": "img1", > "snapshot-file": "/home/test/streamnbd/sn1.qcow2", "format": "qcow2", > "mode": "absolute-paths" } } > > > Actual results: > guest hangs. > nothing returns after the snapshot command. I'm suspecting that this is yet another symptom of NBD client fixes that went in just before 2.10 was released; I'll try to reproduce it and double check whether this is a duplicate. > > Expected results: > guest functions normally and qemu should output error of snapshot The guest may be stopped at this point (due to the werror policy), but the QMP monitor should remain responsive. The set of NBD fixes that made it into 2.10 is incomplete compared to what I tested for fixing the bug in 2.9; therefore, even RHEL 7.5 will need backports (I'm waiting for the 7.5 build tree to open up). I'm adding 7.4.z?, since we probably also want this in z-stream. The following commits on top of 2.9.0-16.el7_4.8 are needed: already in 2.10: 72b6ffc7 d0a18013 d3d7d03f missed 2.10: 3c2db183 6e592fc9 02d2d860 a6934370 (In reply to Eric Blake from comment #2) > (In reply to Longxiang Lyu from comment #0) > > Description of problem: > > qemu hangs if shut down NBD service then make snapshot of the extra NBD disk. > > > > Version-Release number of selected component (if applicable): > > kernel-3.10.0-709.el7.x86_64 > > qemu-kvm-rhev-2.9.0-16.el7_4.8 > > > > > > How reproducible: > > 100% > > > > Steps to Reproduce: > > 1. use qemu to export a disk as NBD driver > > # qemu-kvm -drive file=test.qcow2,format=raw,id=img0 -qmp > > tcp:0:5555,server,nowait -monitor stdio -incoming tcp:0:6666 > > qmp: > > { "execute": "qmp_capabilities" } > > { "execute": "nbd-server-start", "arguments": { "addr": { "type": "inet", > > "data": { "host": "10.66.11.1", "port": "9000" } } } } > > { "execute": "nbd-server-add", "arguments": { "device": "img0", "writable": > > true } } > > Can you reproduce the VM hanging by using qemu-nbd instead of qemu-kvm as > the NBD export? > qemu-nbd -f raw test.qcow2 -p 9000 -x img0 > > > > > 2. boot up a VM with the NBD image as additional driver > > ... > > -drive > > file=/home/test/streamnbd/test.raw,format=raw,if=none,cache=none, > > snapshot=off,rerror=stop,werror=stop,id=img0 \ > > -device ide-hd,bus=ide.0,unit=0,drive=img0,id=ide-disk0,bootindex=0 \ > > -drive > > file=nbd://10.66.11.1:9000/img0,format=qcow2,if=none,cache=none,snapshot=off, > > rerror=stop,werror=stop,id=img1 \ > > -device ide-hd,bus=ide.0,unit=1,drive=img1,id=ide-disk1 \ > > … > > > > This requests that on EIO error on the NBD drive, the guest should stop... > > > 3. stop nbd service > > { "execute" : "nbd-server-stop", "arguments" : {} } > > ...and this should cause an EIO error on the next access to the NBD drive > > > > > 4. do snapshot of img1 > > { "execute": "blockdev-snapshot-sync", "arguments": { "device": "img1", > > "snapshot-file": "/home/test/streamnbd/sn1.qcow2", "format": "qcow2", > > "mode": "absolute-paths" } } > > > > > > Actual results: > > guest hangs. > > nothing returns after the snapshot command. > > I'm suspecting that this is yet another symptom of NBD client fixes that > went in just before 2.10 was released; I'll try to reproduce it and double > check whether this is a duplicate. > > > > > Expected results: > > guest functions normally and qemu should output error of snapshot > > The guest may be stopped at this point (due to the werror policy), but the > QMP monitor should remain responsive. Yes, I could reproduce this with qemu-nbd. 1. export addition.qcow2 # qemu-nbd -f raw addition.qcow2 -p 9000 -t -x addition.qcow2 2. boot up a VM with addition.qcow2 as second disk -drive file=/home/test/streamnbd/test.raw,format=raw,if=none,cache=none,snapshot=off,rerror=stop,werror=stop,id=img0 \ -device virtio-blk-pci,drive=img0,id=disk0,bootindex=0 \ -drive file=nbd://10.66.11.1:9000/addition.qcow2,format=qcow2,if=none,cache=none,snapshot=off,rerror=stop,werror=stop,id=img1 \ -device virtio-blk-pci,drive=img1,id=disk1 \ 3. kill qemu-nbd # kill -9 $(ps aux | grep qemu-nbd | head -n1 | awk '{ print $2 }') 4. do snapshot { "execute": "blockdev-snapshot-sync", "arguments": { "device": "img1", "snapshot-file": "/home/test/streamnbd/sn1.qcow2", "format": "qcow2", "mode": "absolute-paths" } } result: qemu hangs *** This bug has been marked as a duplicate of bug 1482478 *** |
Description of problem: qemu hangs if shut down NBD service then make snapshot of the extra NBD disk. Version-Release number of selected component (if applicable): kernel-3.10.0-709.el7.x86_64 qemu-kvm-rhev-2.9.0-16.el7_4.8 How reproducible: 100% Steps to Reproduce: 1. use qemu to export a disk as NBD driver # qemu-kvm -drive file=test.qcow2,format=raw,id=img0 -qmp tcp:0:5555,server,nowait -monitor stdio -incoming tcp:0:6666 qmp: { "execute": "qmp_capabilities" } { "execute": "nbd-server-start", "arguments": { "addr": { "type": "inet", "data": { "host": "10.66.11.1", "port": "9000" } } } } { "execute": "nbd-server-add", "arguments": { "device": "img0", "writable": true } } 2. boot up a VM with the NBD image as additional driver ... -drive file=/home/test/streamnbd/test.raw,format=raw,if=none,cache=none,snapshot=off,rerror=stop,werror=stop,id=img0 \ -device ide-hd,bus=ide.0,unit=0,drive=img0,id=ide-disk0,bootindex=0 \ -drive file=nbd://10.66.11.1:9000/img0,format=qcow2,if=none,cache=none,snapshot=off,rerror=stop,werror=stop,id=img1 \ -device ide-hd,bus=ide.0,unit=1,drive=img1,id=ide-disk1 \ … 3. stop nbd service { "execute" : "nbd-server-stop", "arguments" : {} } 4. do snapshot of img1 { "execute": "blockdev-snapshot-sync", "arguments": { "device": "img1", "snapshot-file": "/home/test/streamnbd/sn1.qcow2", "format": "qcow2", "mode": "absolute-paths" } } Actual results: guest hangs. nothing returns after the snapshot command. Expected results: guest functions normally and qemu should output error of snapshot Additional info: gdb output of the hanged qemu process # gdb -batch -ex bt -p 26715 [New LWP 26754] [New LWP 26746] [New LWP 26731] [New LWP 26730] [New LWP 26729] [New LWP 26728] [New LWP 26716] [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". 0x00007f4e4be03aff in ppoll () from /lib64/libc.so.6 #0 0x00007f4e4be03aff in ppoll () from /lib64/libc.so.6 #1 0x0000562eecf45fbb in ppoll (__ss=0x0, __timeout=0x0, __nfds=<optimized out>, __fds=<optimized out>) at /usr/include/bits/poll2.h:77 #2 qemu_poll_ns (fds=<optimized out>, nfds=<optimized out>, timeout=timeout@entry=-1) at util/qemu-timer.c:322 #3 0x0000562eecf47c75 in aio_poll (ctx=ctx@entry=0x562eee587980, blocking=<optimized out>) at util/aio-posix.c:622 #4 0x0000562eeced64a4 in bdrv_flush (bs=0x562eee6f0800) at block/io.c:2418 #5 0x0000562eecd49857 in external_snapshot_prepare (common=0x562ef0c98df0, errp=0x7fffe7aef268) at blockdev.c:1729 #6 0x0000562eecd4c1b7 in qmp_transaction (dev_list=dev_list@entry=0x7fffe7aef2e0, has_props=has_props@entry=false, props=<optimized out>, props@entry=0x0, errp=errp@entry=0x7fffe7aef398) at blockdev.c:2249 #7 0x0000562eecd4c3b4 in blockdev_do_action (errp=0x7fffe7aef398, action=0x7fffe7aef2d0) at blockdev.c:1257 #8 qmp_blockdev_snapshot_sync (has_device=<optimized out>, device=<optimized out>, has_node_name=<optimized out>, node_name=<optimized out>, snapshot_file=<optimized out>, has_snapshot_node_name=<optimized out>, snapshot_node_name=0x0, has_format=true, format=0x562eefbb85b8 "qcow2", has_mode=true, mode=NEW_IMAGE_MODE_ABSOLUTE_PATHS, errp=errp@entry=0x7fffe7aef398) at blockdev.c:1285 #9 0x0000562eecd592b1 in qmp_marshal_blockdev_snapshot_sync (args=<optimized out>, ret=<optimized out>, errp=0x7fffe7aef448) at qmp-marshal.c:1023 #10 0x0000562eecf3c189 in do_qmp_dispatch (errp=0x7fffe7aef440, request=0x562ef0438800, cmds=0x562eed53c420 <qmp_commands>) at qapi/qmp-dispatch.c:104 #11 qmp_dispatch (cmds=0x562eed53c420 <qmp_commands>, request=request@entry=0x562ef0438800) at qapi/qmp-dispatch.c:131 #12 0x0000562eecc791e7 in handle_qmp_command (parser=<optimized out>, tokens=<optimized out>) at /usr/src/debug/qemu-2.9.0/monitor.c:3850 #13 0x0000562eecf41618 in json_message_process_token (lexer=0x562eee50e088, input=0x562eee512580, type=JSON_RCURLY, x=170, y=5) at qobject/json-streamer.c:105 #14 0x0000562eecf5dd4b in json_lexer_feed_char (lexer=lexer@entry=0x562eee50e088, ch=125 '}', flush=flush@entry=false) at qobject/json-lexer.c:319 #15 0x0000562eecf5de0e in json_lexer_feed (lexer=0x562eee50e088, buffer=<optimized out>, size=<optimized out>) at qobject/json-lexer.c:369 #16 0x0000562eecf416d9 in json_message_parser_feed (parser=<optimized out>, buffer=<optimized out>, size=<optimized out>) at qobject/json-streamer.c:124 #17 0x0000562eecc7777b in monitor_qmp_read (opaque=<optimized out>, buf=<optimized out>, size=<optimized out>) at /usr/src/debug/qemu-2.9.0/monitor.c:3893 #18 0x0000562eecef8d1d in tcp_chr_read (chan=<optimized out>, cond=<optimized out>, opaque=<optimized out>) at chardev/char-socket.c:414 #19 0x00007f4e4d8004c9 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0 #20 0x0000562eecf46dec in glib_pollfds_poll () at util/main-loop.c:213 #21 os_host_main_loop_wait (timeout=<optimized out>) at util/main-loop.c:261 #22 main_loop_wait (nonblocking=nonblocking@entry=0) at util/main-loop.c:517 #23 0x0000562eecc3818c in main_loop () at vl.c:1909 #24 main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>) at vl.c:4733