Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1136752 - virtio-blk dataplane support for block_resize and hot unplug
virtio-blk dataplane support for block_resize and hot unplug
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev (Show other bugs)
7.1
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Stefan Hajnoczi
Virtualization Bugs
:
: 1139572 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-09-03 04:45 EDT by Stefan Hajnoczi
Modified: 2015-03-05 04:54 EST (History)
7 users (show)

See Also:
Fixed In Version: qemu-kvm-rhev-2.1.0-4.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-03-05 04:54:28 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker 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 09:37:36 EST

  None (edit)
Description Stefan Hajnoczi 2014-09-03 04:45:45 EDT
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 04:50:04 EDT
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 05:20:54 EDT
Patches backported and posted to rhvirt-patches.
Comment 4 Stefan Hajnoczi 2014-09-11 10:18:47 EDT
*** Bug 1139572 has been marked as a duplicate of this bug. ***
Comment 5 Miroslav Rezanina 2014-09-17 03:38:01 EDT
Fix included in qemu-kvm-rhev-2.1.0-4.el7
Comment 7 Sibiao Luo 2014-09-22 02:23:24 EDT
- 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 04:54:28 EST
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.