Bug 1026184

Summary: QMP: querying -drive option returns a NULL parameter list
Product: Red Hat Enterprise Linux 7 Reporter: Amos Kong <akong>
Component: qemu-kvmAssignee: Amos Kong <akong>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: acathrow, ailan, akong, bili, dallan, eblake, flang, hhuang, jentrena, juzhang, kwolf, pbonzini, rhod, sluo, virt-maint
Target Milestone: rcKeywords: TestBlocker
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qemu-kvm-1.5.3-51.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 12:14:03 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:
Bug Depends On:    
Bug Blocks: 821045, 1059069    

Description Amos Kong 2013-11-04 06:45:59 UTC
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):
qemu-kvm-1.5.3-9.el7


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 15:18:50 UTC
Libvirt is relying on the query-command-line-options for deciding whether to support drive discard options.

Comment 3 Osier Yang 2013-12-06 06:42:56 UTC
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 10:32:31 UTC
Fix included in qemu-kvm-1.5.3-51.el7

Comment 13 langfang 2014-03-10 02:41:38 UTC
Reproduce this bug as follow version:
Host:
# uname -r
3.10.0-99.el7.x86_64
# rpm -q qemu-kvm-rhev
qemu-kvm-rhev-1.5.3-50.el7.x86_64
# rpm -q seabios
seabios-1.7.2.2-11.el7.x86_64

Guest:
3.10.0-99.el7.x86_64

Steps:
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 10.66.5.251 5555
Trying 10.66.5.251...
Connected to 10.66.5.251.
Escape character is '^]'.
{"QMP": {"version": {"qemu": {"micro": 3, "minor": 5, "major": 1}, "package": " (qemu-kvm-1.5.3-50.el7)"}, "capabilities": []}}
{"execute":"qmp_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:
Host:

Version:
Host:
# uname -r 
3.10.0-99.el7.x86_64
[root@localhost qemu52]# rpm -q qemu-kvm
qemu-kvm-1.5.3-52.el7.x86_64

Guest:
3.10.0-99.el7.x86_64

Steps as same as reproduce 

Results:
{"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 12:14:03 UTC
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.