qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] QMP argument parser does not verify json type


From: Miguel Di Ciurcio Filho
Subject: [Qemu-devel] QMP argument parser does not verify json type
Date: Fri, 9 Jul 2010 16:44:50 -0300

Hi there,

I've run QEMU like this:

$ qemu -qmp tcp:localhost:3000,server,nowait -netdev type=tap,id=ndev1,vhost=on

Then I run these commands over QMP:

works:
{"execute": "device_add", "arguments": {"driver": "virtio-net-pci",
"csum": "off", "id": "nic1", "netdev": "ndev1"}}

works:
{"execute": "device_add", "arguments": {"driver": "virtio-net-pci",
"csum": false, "id": "nic1", "netdev": "ndev1"}}

works, no error reported, csum stays "on":
{"execute": "device_add", "arguments": {"driver": "virtio-net-pci",
"csum": [ ], "id": "nic1", "netdev": "ndev1"}}

works:
{"execute": "device_add", "arguments": {"driver": "virtio-net-pci",
"id": "nic1", "netdev": "ndev1", "vectors": "10"}}

works:
{"execute": "device_add", "arguments": {"driver": "virtio-net-pci",
"id": "nic1", "netdev": "ndev1", "vectors": 10}}

When specifying query-qdm I've faced this problem of internal QEMU
types against json types. The mapped types need to be verified
accordingly, IMHO.

First we query for supported devices and get:

{
   "name":"virtio-net-pci",
   "creatable":true,
   "bus":"PCI",
   "properties":[
      {
         "name":"vectors",
         "type": { "qdev": "uint32", "qmp": "integer" }
      },
     ...
    ]
}

And then this should result in an error:
{"execute": "device_add", "arguments": {"driver": "virtio-net-pci",
"id": "nic1", "netdev": "ndev1", "vectors": "10"}}

Regards,

Miguel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]