RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1086603 - fail to repeat hot-plug and hot-unplg disk with same bootindex value specified
Summary: fail to repeat hot-plug and hot-unplg disk with same bootindex value specified
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Marcel Apfelbaum
QA Contact: Virtualization Bugs
URL:
Whiteboard:
: 771545 1006384 (view as bug list)
Depends On:
Blocks: 963588 1314591
TreeView+ depends on / blocked
 
Reported: 2014-04-11 07:49 UTC by Sibiao Luo
Modified: 2016-03-04 01:52 UTC (History)
15 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1314591 (view as bug list)
Environment:
Last Closed: 2016-03-04 01:52:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Sibiao Luo 2014-04-11 07:49:30 UTC
Description of problem:
as subject, both the drive_add|del/device_del and blockdev_add/device_del hit the same issue, maybe hot-unplug not clear up some variable caused this issue.
btw, the issuse different to the bug 963588.

Version-Release number of selected component (if applicable):
host info:
# uname -r && rpm -q qemu-kvm
3.10.0-121.el7.x86_64
qemu-kvm-1.5.3-60.el7.x86_64
guest info:
# uname -r
3.10.0-121.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.launch a QEMU guest.
2.hut-plug a disk using blockdev_add/__com.redhat_drive_add with bootindex specified.
3.hut-unplug the disk.
4.hut-plug the disk again using blockdev_add/__com.redhat_drive_add with the same bootindex in step2.

Actual results:
after step 4, fail to hot-plug again with the same bootindex value specified, QEMU will quit with message '(qemu) Two devices with same boot index 2'.

{"execute":"__com.redhat_drive_add","arguments": {"file":"/home/my-data-disk.raw","format":"raw","id":"drive-data-disk","aio":"native","werror":"stop","rerror":"stop"}}
{"return": {}}

{"execute":"device_add","arguments":{"driver":"virtio-blk-pci","drive":"drive-data-disk","id":"data-disk","bus":"pci.0","scsi":"off","addr":"0x9","bootindex":"2"}}
{"return": {}}

{"execute":"device_del","arguments":{"id":"data-disk"}}
{"return": {}}
{"timestamp": {"seconds": 1397200532, "microseconds": 784087}, "event": "DEVICE_DELETED", "data": {"path": "/machine/peripheral/data-disk/virtio-backend"}}
{"timestamp": {"seconds": 1397200532, "microseconds": 786714}, "event": "DEVICE_DELETED", "data": {"device": "data-disk", "path": "/machine/peripheral/data-disk"}}

{"execute":"__com.redhat_drive_add","arguments": {"file":"/home/my-data-disk.raw","format":"raw","id":"drive-data-disk","aio":"native","werror":"stop","rerror":"stop"}}
{"return": {}}

{"execute":"device_add","arguments":{"driver":"virtio-blk-pci","drive":"drive-data-disk","id":"data-disk","bus":"pci.0","scsi":"off","addr":"0x9","bootindex":"2"}}
Connection closed by foreign host.

Expected results:
it can repeat hot-plug and hot-unplg disk with the same bootindex value specified successfully.

Additional info:
use blockdev-add also fail to hot-plug again with the same bootindex value specified, QEMU will quit with message '(qemu) Two devices with same boot index 2'.
(qemu) Two devices with same boot index 2

{"execute":"qmp_capabilities"}
{"return": {}}
{ "execute": "blockdev-add", "arguments": {'options' : {'driver': 'raw', 'id':'drive-disk1', 'read-only': true, 'discard':'unmap', 'file': {'driver': 'file', 'filename': '/home/my-data-disk.raw'}, 'cache': { 'writeback': false, 'direct': true, 'no-flush': false }}} }
{"return": {}}
{"execute":"device_add","arguments":{"driver":"virtio-blk-pci","drive":"drive-disk1","id":"data-disk1","bus":"pci.0","scsi":"off","addr":"0x8","bootindex":"2"}}
{"return": {}}

{"execute":"device_del","arguments":{"id":"data-disk1"}}
{"return": {}}
{"timestamp": {"seconds": 1397202469, "microseconds": 383426}, "event": "DEVICE_DELETED", "data": {"path": "/machine/peripheral/data-disk1/virtio-backend"}}
{"timestamp": {"seconds": 1397202469, "microseconds": 385980}, "event": "DEVICE_DELETED", "data": {"device": "data-disk1", "path": "/machine/peripheral/data-disk1"}}
{"execute":"__com.redhat_drive_del","arguments":{"id":"drive-disk1"}}
{"return": {}}

{ "execute": "blockdev-add", "arguments": {'options' : {'driver': 'raw', 'id':'drive-disk1', 'read-only': true, 'discard':'unmap', 'file': {'driver': 'file', 'filename': '/home/my-data-disk.raw'}, 'cache': { 'writeback': false, 'direct': true, 'no-flush': false }}} }
{"return": {}}
{"execute":"device_add","arguments":{"driver":"virtio-blk-pci","drive":"drive-disk1","id":"data-disk1","bus":"pci.0","scsi":"off","addr":"0x8","bootindex":"2"}}
Connection closed by foreign host.

Comment 1 Sibiao Luo 2014-04-11 08:11:43 UTC
##
# @BlockdevOptionsBase
#
# Options that are available for all block devices, independent of the block
# driver.
#
# @driver:      block driver name
# @id:          #optional id by which the new block device can be referred to.
#               This is a required option on the top level of blockdev-add, and
#               currently not allowed on any other level.
# @node-name:   #optional the name of a block driver state node (Since 2.0)
# @discard:     #optional discard-related options (default: ignore)
# @cache:       #optional cache-related options
# @aio:         #optional AIO backend (default: threads)
# @rerror:      #optional how to handle read errors on the device
#               (default: report)
# @werror:      #optional how to handle write errors on the device
#               (default: enospc)
# @read-only:   #optional whether the block device should be read-only
#               (default: false)
#
# Since: 1.7

Comment 4 Markus Armbruster 2014-06-24 13:56:14 UTC
Assigning to Marcel, because he already has related bug 771545.

Comment 5 Ronen Hod 2014-07-13 13:17:07 UTC
*** Bug 1006384 has been marked as a duplicate of this bug. ***

Comment 7 Marcel Apfelbaum 2014-11-02 14:11:30 UTC
*** Bug 771545 has been marked as a duplicate of this bug. ***

Comment 14 jingzhao 2016-03-03 01:35:39 UTC
(In reply to Sibiao Luo from comment #0)
> Description of problem:
> as subject, both the drive_add|del/device_del and blockdev_add/device_del
> hit the same issue, maybe hot-unplug not clear up some variable caused this
> issue.
> btw, the issuse different to the bug 963588.
> 
> Version-Release number of selected component (if applicable):
> host info:
> # uname -r && rpm -q qemu-kvm
> 3.10.0-121.el7.x86_64
> qemu-kvm-1.5.3-60.el7.x86_64
> guest info:
> # uname -r
> 3.10.0-121.el7.x86_64
> 
> How reproducible:
> 100%
> 
> Steps to Reproduce:
> 1.launch a QEMU guest.
> 2.hut-plug a disk using blockdev_add/__com.redhat_drive_add with bootindex
> specified.
> 3.hut-unplug the disk.
> 4.hut-plug the disk again using blockdev_add/__com.redhat_drive_add with the
> same bootindex in step2.
> 
> Actual results:
> after step 4, fail to hot-plug again with the same bootindex value
> specified, QEMU will quit with message '(qemu) Two devices with same boot
> index 2'.
> 
> {"execute":"__com.redhat_drive_add","arguments":
> {"file":"/home/my-data-disk.raw","format":"raw","id":"drive-data-disk","aio":
> "native","werror":"stop","rerror":"stop"}}
> {"return": {}}
> 
> {"execute":"device_add","arguments":{"driver":"virtio-blk-pci","drive":
> "drive-data-disk","id":"data-disk","bus":"pci.0","scsi":"off","addr":"0x9",
> "bootindex":"2"}}
> {"return": {}}
> 
> {"execute":"device_del","arguments":{"id":"data-disk"}}
> {"return": {}}
> {"timestamp": {"seconds": 1397200532, "microseconds": 784087}, "event":
> "DEVICE_DELETED", "data": {"path":
> "/machine/peripheral/data-disk/virtio-backend"}}
> {"timestamp": {"seconds": 1397200532, "microseconds": 786714}, "event":
> "DEVICE_DELETED", "data": {"device": "data-disk", "path":
> "/machine/peripheral/data-disk"}}
> 
> {"execute":"__com.redhat_drive_add","arguments":
> {"file":"/home/my-data-disk.raw","format":"raw","id":"drive-data-disk","aio":
> "native","werror":"stop","rerror":"stop"}}
> {"return": {}}
> 
> {"execute":"device_add","arguments":{"driver":"virtio-blk-pci","drive":
> "drive-data-disk","id":"data-disk","bus":"pci.0","scsi":"off","addr":"0x9",
> "bootindex":"2"}}
> Connection closed by foreign host.
> 
> Expected results:
> it can repeat hot-plug and hot-unplg disk with the same bootindex value
> specified successfully.

--- Didn't reproduced with kernel-3.10.0-350.el7.x86_64 and qemu-kvm-rhev-2.3.0-31.el7_2.8.x86_64.

Following is the verified steps:
1. Boot vm with following cli:

/usr/libexec/qemu-kvm \
-M pc \
-cpu SandyBridge \
-nodefaults -rtc base=utc \
-m 4G \
-smp 2,sockets=2,cores=1,threads=1 \
-enable-kvm \
-name rhel7 \
-uuid 990ea161-6b67-47b2-b803-19fb01d30d12 \
-smbios type=1,manufacturer='Red Hat',product='RHEV Hypervisor',version=el6,serial=koTUXQrb,uuid=feebc8fd-f8b0-4e75-abc3-e63fcdb67170 \
-k en-us \
-monitor stdio \
-serial unix:/tmp/serial0,server,nowait \
-boot menu=on \
-bios /usr/share/seabios/bios.bin \
-vga std \
-vnc :0 \
-drive file=/home/rhel.img,if=none,id=drive-virtio-disk0,format=raw,cache=none,werror=stop,rerror=stop,aio=threads \
-device virtio-blk-pci,scsi=off,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=0 \
-netdev tap,id=hostnet1,vhost=on \
-device virtio-net-pci,netdev=hostnet1,id=net1,mac=54:52:00:B6:40:22 \
-qmp tcp::8887,server,nowait \

2. In qmp:

{"QMP": {"version": {"qemu": {"micro": 0, "minor": 3, "major": 2}, "package": " (qemu-kvm-rhev-2.3.0-31.el7_2.8)"}, "capabilities": []}}
{"execute":"qmp_capabilities"}
{"return": {}}
{"execute":"__com.redhat_drive_add","arguments": {"file":"/home/my-data-disk.raw","format":"raw","id":"drive-data-disk","aio":"native","werror":"stop","rerror":"stop"}}
{"return": {}}
{"execute":"device_add","arguments":{"driver":"virtio-blk-pci","drive":"drive-data-disk","id":"data-disk","bus":"pci.0","scsi":"off","addr":"0x9","bootindex":"2"}}
{"return": {}}
{"execute":"device_del","arguments":{"id":"data-disk"}}
{"return": {}}
{"timestamp": {"seconds": 1456967507, "microseconds": 298262}, "event": "DEVICE_DELETED", "data": {"path": "/machine/peripheral/data-disk/virtio-backend"}}
{"timestamp": {"seconds": 1456967507, "microseconds": 298758}, "event": "DEVICE_DELETED", "data": {"device": "data-disk", "path": "/machine/peripheral/data-disk"}}
{"execute":"__com.redhat_drive_add","arguments": {"file":"/home/my-data-disk.raw","format":"raw","id":"drive-data-disk","aio":"native","werror":"stop","rerror":"stop"}}
{"return": {}}
{"execute":"device_add","arguments":{"driver":"virtio-blk-pci","drive":"drive-data-disk","id":"data-disk","bus":"pci.0","scsi":"off","addr":"0x9","bootindex":"2"}}
{"return": {}}
{"timestamp": {"seconds": 1456967598, "microseconds": 339963}, "event": "SHUTDOWN"}
Connection closed by foreign host.

> 
> Additional info:
> use blockdev-add also fail to hot-plug again with the same bootindex value
> specified, QEMU will quit with message '(qemu) Two devices with same boot
> index 2'.
> (qemu) Two devices with same boot index 2
> 
> {"execute":"qmp_capabilities"}
> {"return": {}}
> { "execute": "blockdev-add", "arguments": {'options' : {'driver': 'raw',
> 'id':'drive-disk1', 'read-only': true, 'discard':'unmap', 'file': {'driver':
> 'file', 'filename': '/home/my-data-disk.raw'}, 'cache': { 'writeback':
> false, 'direct': true, 'no-flush': false }}} }
> {"return": {}}
> {"execute":"device_add","arguments":{"driver":"virtio-blk-pci","drive":
> "drive-disk1","id":"data-disk1","bus":"pci.0","scsi":"off","addr":"0x8",
> "bootindex":"2"}}
> {"return": {}}
> 
> {"execute":"device_del","arguments":{"id":"data-disk1"}}
> {"return": {}}
> {"timestamp": {"seconds": 1397202469, "microseconds": 383426}, "event":
> "DEVICE_DELETED", "data": {"path":
> "/machine/peripheral/data-disk1/virtio-backend"}}
> {"timestamp": {"seconds": 1397202469, "microseconds": 385980}, "event":
> "DEVICE_DELETED", "data": {"device": "data-disk1", "path":
> "/machine/peripheral/data-disk1"}}
> {"execute":"__com.redhat_drive_del","arguments":{"id":"drive-disk1"}}
> {"return": {}}
> 
> { "execute": "blockdev-add", "arguments": {'options' : {'driver': 'raw',
> 'id':'drive-disk1', 'read-only': true, 'discard':'unmap', 'file': {'driver':
> 'file', 'filename': '/home/my-data-disk.raw'}, 'cache': { 'writeback':
> false, 'direct': true, 'no-flush': false }}} }
> {"return": {}}
> {"execute":"device_add","arguments":{"driver":"virtio-blk-pci","drive":
> "drive-disk1","id":"data-disk1","bus":"pci.0","scsi":"off","addr":"0x8",
> "bootindex":"2"}}
> Connection closed by foreign host.

--Blocked with above steps because hit another issue.
  Hot-unplug the disk failed.(kernel-3.10.0-350.el7.x86_64 and qemu-kvm-rhev-2.3.0-31.el7_2.8.x86_64.)
Following is the reproduced steps
1. Boot vm with following cli:

/usr/libexec/qemu-kvm \
-M pc \
-cpu SandyBridge \
-nodefaults -rtc base=utc \
-m 4G \
-smp 2,sockets=2,cores=1,threads=1 \
-enable-kvm \
-name rhel7 \
-uuid 990ea161-6b67-47b2-b803-19fb01d30d12 \
-smbios type=1,manufacturer='Red Hat',product='RHEV Hypervisor',version=el6,serial=koTUXQrb,uuid=feebc8fd-f8b0-4e75-abc3-e63fcdb67170 \
-k en-us \
-monitor stdio \
-serial unix:/tmp/serial0,server,nowait \
-boot menu=on \
-bios /usr/share/seabios/bios.bin \
-vga std \
-vnc :0 \
-drive file=/home/rhel.img,if=none,id=drive-virtio-disk0,format=raw,cache=none,werror=stop,rerror=stop,aio=threads \
-device virtio-blk-pci,scsi=off,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=0 \
-netdev tap,id=hostnet1,vhost=on \
-device virtio-net-pci,netdev=hostnet1,id=net1,mac=54:52:00:B6:40:22 \
-qmp tcp::8887,server,nowait \

2. In qmp:

{ "execute": "blockdev-add", "arguments": {'options' : {'driver': 'raw', 'id':'drive-disk1', 'read-only': true, 'discard':'unmap', 'file': {'driver': 'file', 'filename': '/home/my-data-disk.raw'}, 'cache': { 'writeback': false, 'direct': true, 'no-flush': false }}} }
{"return": {}}
{"execute":"device_add","arguments":{"driver":"virtio-blk-pci","drive":"drive-disk1","id":"data-disk1","bus":"pci.0","scsi":"off","addr":"0x8","bootindex":"2"}}
{"return": {}}

3. In hmp:
(qemu) info block
drive-virtio-disk0: /home/rhel.img (raw)
    Cache mode:       writethrough, direct
(qemu) info block
drive-virtio-disk0: /home/rhel.img (raw)
    Cache mode:       writeback, direct

drive-disk1: /home/my-data-disk.raw (raw, read-only)
    Cache mode:       writethrough, direct

4.In qmp deleted the disk
{"execute":"device_del","arguments":{"id":"data-disk1"}}
{"return": {}}
{"timestamp": {"seconds": 1456968290, "microseconds": 66122}, "event": "DEVICE_DELETED", "data": {"path": "/machine/peripheral/data-disk1/virtio-backend"}}
{"timestamp": {"seconds": 1456968290, "microseconds": 66195}, "event": "DEVICE_DELETED", "data": {"device": "data-disk1", "path": "/machine/peripheral/data-disk1"}}


5.In guest, we can check the disk deleted through "fdisk -l"

6.But In hmp we can see the disk through "info block"
(qemu) info block
drive-virtio-disk0: /home/rhel.img (raw)
    Cache mode:       writeback, direct

drive-disk1: /home/my-data-disk.raw (raw, read-only)
    Removable device: not locked, tray closed
    Cache mode:       writethrough, direct

7. In qmp, add the disk again and we didn't add the disk
{ "execute": "blockdev-add", "arguments": {'options' : {'driver': 'raw', 'id':'drive-disk1', 'read-only': true, 'discard':'unmap', 'file': {'driver': 'file', 'filename': '/home/my-data-disk.raw'}, 'cache': { 'writeback': false, 'direct': true, 'no-flush': false }}} }
{"error": {"class": "GenericError", "desc": "Device with id 'drive-disk1' already exists"}}

Macel, should we file another bug for tracking the above issue?

Thanks
Jing

Comment 15 Marcel Apfelbaum 2016-03-03 11:53:46 UTC
Hi Jing,

Yes please, close this BZ and open a new one.

Thanks,
Marcel

Comment 16 jingzhao 2016-03-04 01:52:31 UTC
(In reply to Marcel Apfelbaum from comment #15)
> Hi Jing,
> 
> Yes please, close this BZ and open a new one.
> 
> Thanks,
> Marcel

According to comments14, closed this bug. Opened a new bug (bug1314591) for tracking the new issue.

Thanks
Jing


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