Bug 1493901
Summary: | fail to quit qemu after stopping NBD service during block stream | ||
---|---|---|---|
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:58 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: |
Description
Longxiang Lyu
2017-09-21 07:09:33 UTC
Possibly a duplicate of bug 1493890 - at any rate, killing the NBD server while the VM is trying to access it should gracefully trigger EIO errors to the guest, and keep the QMP monitor responsive. I'll try to reproduce this to see if the fixes being made for other NBD bugs also cover this issue (In reply to Longxiang Lyu from comment #0) > Description of problem: > fail to quit qemu after stopping NBD service during block mirror > > 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 } } Presumably, this has to be a big enough disk, with non-zero contents, that... > { "execute": "block-stream", "arguments": { "device": "img1", "on-error": > "report" } } > > 4. stop shutdown NBD server > { "execute" : "nbd-server-stop", "arguments" : {} } you have enough time to kill the NBD server before the block-stream has a chance to complete (if the block-stream runs to completion, because the disk being streamed is too trivial, then I can't reproduce the hang). At any rate, am I correct that it is the client that is hanging, and not the server? Can you use qemu-nbd instead of qemu-kvm as the server (to make it less confusing WHICH process is hanging)? Steps to reproduce: 1. export the second disk to use: addition.qcow2 # qemu-img info addition.qcow2 image: addition.qcow2 file format: qcow2 virtual size: 5.0G (5368709120 bytes) disk size: 5.0G cluster_size: 65536 Format specific information: compat: 1.1 lazy refcounts: false refcount bits: 16 corrupt: false # qemu-nbd -f raw addition.qcow2 -p 9000 -t -x addition.qcow2 2. boot up a VM using addition.qcow2 as second disk #!/bin/bash /usr/libexec/qemu-kvm \ -name guest=test-virt \ -machine pc-i440fx-rhel7.4.0,accel=kvm \ -cpu SandyBridge \ -m 4G \ -smp 4,sockets=4,cores=1,threads=1 \ -boot strict=on \ -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 \ -netdev tap,id=hostnet0,vhost=on \ -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:12:b3:20:61,bus=pci.0 \ -device qxl-vga \ -usbdevice tablet \ -vnc :2 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x8 \ -monitor stdio \ -qmp tcp:0:4444,server,nowait \ 3. in qmp, block stream the second block device { "execute": "blockdev-snapshot-sync", "arguments": { "device": "img1", "snapshot-file": "/home/test/streamnbd/sn1.qcow2", "format": "qcow2", "mode": "absolute-paths" } } { "execute": "block-stream", "arguments": { "device": "img1", "on-error": "report" } } 4. kill qemu-nbd of step1 # kill -9 $(ps aux | grep qemu-nbd | head -n1 | awk '{ print $2 }') 5. quit qemu, the VM hangs. output from qmp: {"timestamp": {"seconds": 1506585789, "microseconds": 786009}, "event": "BLOCK_JOB_ERROR", "data": {"device": "img1", "operation": "read", "action": "report"}} {"timestamp": {"seconds": 1506585789, "microseconds": 786170}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "img1", "len": 5368709120, "offset": 1425539072, "speed": 0, "type": "stream", "error": "Input/output error"}} The stream job is forced complete. Then fail to quit the VM. *** This bug has been marked as a duplicate of bug 1482478 *** |