Bug 1026184 - QMP: querying -drive option returns a NULL parameter list
QMP: querying -drive option returns a NULL parameter list
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Amos Kong
Virtualization Bugs
: TestBlocker
Depends On:
Blocks: 821045 1059069
  Show dependency treegraph
Reported: 2013-11-04 01:45 EST by Amos Kong
Modified: 2015-05-24 20:07 EDT (History)
15 users (show)

See Also:
Fixed In Version: qemu-kvm-1.5.3-51.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-06-13 08:14:03 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Amos Kong 2013-11-04 01:45:59 EST
Description of problem:

{ 'execute': 'query-command-line-options', 'arguments': { 'option': 'drive' } }

    "return": [
            "parameters": [
            "option": "drive"

Currently we have three QemuOptsList (qemu_common_drive_opts,
qemu_legacy_drive_opts, and qemu_drive_opts)

only qemu_drive_opts is added to vm_config_groups[]

We query commandline options by checking information in vm_config_groups[],
so we can only get a NULL parameter list now.

Another issue is we also can't query legacy options of -drive.

Version-Release number of selected component (if applicable):

Steps to Reproduce:
1. execute qmp command to query -drive option

{ 'execute': 'query-command-line-options', 'arguments': { 'option': 'drive' } }

Actual results:
returns a NULL parameter

Expected results:
all parameter items will be returned.
Comment 2 Eric Blake 2013-11-13 10:18:50 EST
Libvirt is relying on the query-command-line-options for deciding whether to support drive discard options.
Comment 3 Osier Yang 2013-12-06 01:42:56 EST
Is the patch in qemu.git master now? except the drive discard, there are other 3 capability flags depended on query-command-line-options. So we would like see the patch could be backported as soon as possible.
Comment 11 Miroslav Rezanina 2014-03-05 05:32:31 EST
Fix included in qemu-kvm-1.5.3-51.el7
Comment 13 langfang 2014-03-09 22:41:38 EDT
Reproduce this bug as follow version:
# uname -r
# rpm -q qemu-kvm-rhev
# rpm -q seabios


1.Boot guest with 
 /usr/libexec/qemu-kvm -M pc-i440fx-rhel7.0.0 -cpu SandyBridge -enable-k048 -smp 4,sockets=2,cores=2,threads=1 -no-kvm-pit-reinjection -usb -device usb-tablet,id=input0 -name RHEL7.0 -uuid `uuidgen` -rtc base=localtime,clock=host,driftfix=slew -device ahci,id=ahci0 -drive if=none,file=/home/rhel7base.qcow2_v3,format=qcow2,id=drive-sata0-0-0 -device ide-drive,bus=ahci0.0,drive=drive-sata0-0-0,id=sata0-0-0  -netdev tap,id=hostdev0,vhost=on,script=/etc/qemu-ifup,queues=4 -device virtio-net-pci,netdev=hostdev0,vectors=10,mq=on,mac=14:32:19:82:9b:12,id=vnet0 -device virtio-balloon-pci,bus=pci.0,id=balloon0 -monitor stdio  -vnc :10 -vga qxl -qmp tcp:0:5555,server,nowait

2.# telnet 5555
Connected to
Escape character is '^]'.
{"QMP": {"version": {"qemu": {"micro": 3, "minor": 5, "major": 1}, "package": " (qemu-kvm-1.5.3-50.el7)"}, "capabilities": []}}
{"return": {}}
{ 'execute': 'query-command-line-options', 'arguments': { 'option': 'drive' } }

Results:returns a NULL parameter
{"return": [{"parameters": [], "option": "drive"}]}

Verify this bug as follow version:

# uname -r 
[root@localhost qemu52]# rpm -q qemu-kvm


Steps as same as reproduce 

{"return": [{"parameters": [{"name": "copy-on-read", "help": "copy read data from backing file into image file", "type": "boolean"}, {"name": "read-only", "help": "open drive file as read-only", "type": "boolean"}, {"name": "addr", "help": "pci address (virtio only)", "type": "string"}, {"name": "boot", "help": "(deprecated, ignored)", "type": "boolean"}, {"name": "trans", "help": "chs translation (auto, lba, none)", "type": "string"}, {"name": "secs", "help": "number of sectors (ide disk geometry)", "type": "number"}, {"name": "heads", "help": "number of heads (ide disk geometry)", "type": "number"}, {"name": "cyls", "help": "number of cylinders (ide disk geometry)", "type": "number"}, {"name": "if", "help": "interface (ide, scsi, sd, mtd, floppy, pflash, virtio)", "type": "string"}, {"name": "media", "help": "media type (disk, cdrom)", "type": "string"}, {"name": "index", "help": "index number", "type": "number"}, {"name": "unit", "help": "unit number (i.e. lun for scsi)", "type": "number"}, {"name": "bus", "help": "bus number", "type": "number"}, {"name": "throttling.bps-write", "help": "limit write bytes per second", "type": "number"}, {"name": "throttling.bps-read", "help": "limit read bytes per second", "type": "number"}, {"name": "throttling.bps-total", "help": "limit total bytes per second", "type": "number"}, {"name": "throttling.iops-write", "help": "limit write operations per second", "type": "number"}, {"name": "throttling.iops-read", "help": "limit read operations per second", "type": "number"}, {"name": "throttling.iops-total", "help": "limit total I/O operations per second", "type": "number"}, {"name": "werror", "help": "write error action", "type": "string"}, {"name": "rerror", "help": "read error action", "type": "string"}, {"name": "serial", "help": "disk serial number", "type": "string"}, {"name": "format", "help": "disk format (raw, qcow2, ...)", "type": "string"}, {"name": "aio", "help": "host AIO implementation (threads, native)", "type": "string"}, {"name": "cache.no-flush", "help": "ignore any flush requests for the device", "type": "boolean"}, {"name": "cache.direct", "help": "enables use of O_DIRECT (bypass the host page cache)", "type": "boolean"}, {"name": "cache.writeback", "help": "enables writeback mode for any caches", "type": "boolean"}, {"name": "discard", "help": "discard operation (ignore/off, unmap/on)", "type": "string"}, {"name": "file", "help": "disk image", "type": "string"}, {"name": "snapshot", "help": "enable/disable snapshot mode", "type": "boolean"}], "option": "drive"}]}

According to above test ,this bug fixed.
Comment 15 Ludek Smid 2014-06-13 08:14:03 EDT
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

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