Bug 1136752 - virtio-blk dataplane support for block_resize and hot unplug
Summary: virtio-blk dataplane support for block_resize and hot unplug
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Stefan Hajnoczi
QA Contact: Virtualization Bugs
URL:
Whiteboard:
: 1139572 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-03 08:45 UTC by Stefan Hajnoczi
Modified: 2015-03-05 09:54 UTC (History)
7 users (show)

Fixed In Version: qemu-kvm-rhev-2.1.0-4.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-05 09:54:28 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0624 normal SHIPPED_LIVE Important: qemu-kvm-rhev security, bug fix, and enhancement update 2015-03-05 14:37:36 UTC

Description Stefan Hajnoczi 2014-09-03 08:45:45 UTC
Current qemu-kvm-rhev does not support block_resize or hot unplug of dataplane virtio-blk-pci devices.

The patches to add support for these commands have been merged upstream now.  Backport them to RHEV.

Comment 1 Stefan Hajnoczi 2014-09-03 08:50:04 UTC
Steps to verify:

1. Launch guest with a data.img disk that we will test:
$ qemu-system-x86_64 -enable-kvm -m 1024 -cpu host \
      -object iothread,id=iothread0 \
      -drive if=none,id=drive0,cache=none,format=raw,\
             aio=native,file=boot.img \
      -device virtio-blk-pci,drive=drive0,id=virtio-blk-pci0,\
              iothread=iothread0 \
      -drive if=none,id=drive1,cache=none,format=raw,\
             aio=native,file=data.img \
      -device virtio-blk-pci,drive=drive1,id=virtio-blk-pci1,\
              iothread=iothread0

2. Resize data.img:
(qemu) block_resize drive1 2G

3. Verify that the size has changed inside the guest:
(guest)# blockdev --getsz /dev/vdb

4. Hot unplug data.img:
(qemu) drive_del drive1
(qemu) device_del virtio-blk-pci1

5. Verify that the virtio-blk-pci device has disappeared:
(guest)# ls -l /dev/vdb
ls: cannot access /dev/vdb: No such file or directory

Comment 3 Stefan Hajnoczi 2014-09-03 09:20:54 UTC
Patches backported and posted to rhvirt-patches.

Comment 4 Stefan Hajnoczi 2014-09-11 14:18:47 UTC
*** Bug 1139572 has been marked as a duplicate of this bug. ***

Comment 5 Miroslav Rezanina 2014-09-17 07:38:01 UTC
Fix included in qemu-kvm-rhev-2.1.0-4.el7

Comment 7 Sibiao Luo 2014-09-22 06:23:24 UTC
- Reproduce this issue on qemu-kvm-rhev-2.1.0-3.el7.x86_64
host info:
host info:
# uname -r && rpm -q qemu-kvm-rhev
3.10.0-152.el7.x86_64
qemu-kvm-rhev-2.1.0-3.el7.x86_64

(qemu) block_resize drive-data-disk1 20G
Device 'drive-data-disk1' is in use

{"execute":"__com.redhat_drive_del","arguments":{"id":"drive-data-disk1"}}
{"error": {"class": "GenericError", "desc": "An undefined error has occurred"}}

(qemu) Device 'drive-data-disk1' is busy: block device is in use by data plane

#########################################################################

- Verify this issue on qemu-kvm-rhev-2.1.0-4.el7.x86_64 with the steps as comment #1.
host info:
# uname -r && rpm -q qemu-kvm-rhev
3.10.0-152.el7.x86_64
qemu-kvm-rhev-2.1.0-4.el7.x86_64

Steps:
0. Create a 10G raw data disk.
# qemu-img info my-data-disk.raw
image: my-data-disk.raw
file format: raw
virtual size: 10G (10737418240 bytes)
disk size: 0

1. Launch guest with a my-data-disk.raw disk that we will test:
e.g:...-object iothread,id=iothread0 -drive file=/home/my-data-disk.raw,if=none,id=drive-data-disk1,cache=none,format=raw,aio=native,werror=stop,rerror=stop -device virtio-blk-pci,drive=drive-data-disk1,bus=pci.0,addr=0x7,id=data-disk1,iothread=iothread0

2. Resize my-data-disk.raw:
(qemu) block_resize drive-data-disk1 15G

3. Verify that the size has changed inside the guest and host host:
(guest)# blockdev --getsz /dev/vda
31457280        <--------change from 20971520 to 31457280.

# qemu-img info /home/my-data-disk.raw
image: /home/my-data-disk.raw
file format: raw
virtual size: 15G (16106127360 bytes) <--------change from 10G to 15G.
disk size: 0

4. Hot unplug my-data-disk.raw:
HMP:
(qemu) drive_del drive-data-disk1
(qemu) device_del data-disk1
QMP:
{"execute":"__com.redhat_drive_del","arguments":{"id":"drive-data-disk1"}}
{"return": {}}
{"execute":"device_del","arguments":{"id":"data-disk1"}}
{"return": {}}

5. Verify that the virtio-blk-pci device has disappeared:
(guest)# ls -lh /dev/vda
ls: cannot access /dev/vda: No such file or directory

Best Regards,
sluo

Comment 9 errata-xmlrpc 2015-03-05 09:54:28 UTC
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://rhn.redhat.com/errata/RHSA-2015-0624.html


Note You need to log in before you can comment on or make changes to this bug.