All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] QMP argument parser does not verify json type
@ 2010-07-09 19:44 Miguel Di Ciurcio Filho
  2010-07-13 13:03 ` Markus Armbruster
  0 siblings, 1 reply; 3+ messages in thread
From: Miguel Di Ciurcio Filho @ 2010-07-09 19:44 UTC (permalink / raw)
  To: qemu-devel; +Cc: Markus Armbruster, Luiz Capitulino

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] QMP argument parser does not verify json type
  2010-07-09 19:44 [Qemu-devel] QMP argument parser does not verify json type Miguel Di Ciurcio Filho
@ 2010-07-13 13:03 ` Markus Armbruster
  2010-07-13 13:38   ` Miguel Di Ciurcio Filho
  0 siblings, 1 reply; 3+ messages in thread
From: Markus Armbruster @ 2010-07-13 13:03 UTC (permalink / raw)
  To: Miguel Di Ciurcio Filho; +Cc: qemu-devel, Luiz Capitulino

Miguel Di Ciurcio Filho <miguel.filho@gmail.com> writes:

> 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"}}

Yes.

This is where command line (QemuOpts), human monitor (args_type) and QMP
(QDict) meet.  Or rather collide.  It's a mess.  I can explain the gory
details, if anyone's interested.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] QMP argument parser does not verify json type
  2010-07-13 13:03 ` Markus Armbruster
@ 2010-07-13 13:38   ` Miguel Di Ciurcio Filho
  0 siblings, 0 replies; 3+ messages in thread
From: Miguel Di Ciurcio Filho @ 2010-07-13 13:38 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel, Luiz Capitulino

On Tue, Jul 13, 2010 at 10:03 AM, Markus Armbruster <armbru@redhat.com> wrote:
>>
>> And then this should result in an error:
>> {"execute": "device_add", "arguments": {"driver": "virtio-net-pci",
>> "id": "nic1", "netdev": "ndev1", "vectors": "10"}}
>
> Yes.
>
> This is where command line (QemuOpts), human monitor (args_type) and QMP
> (QDict) meet.  Or rather collide.  It's a mess.  I can explain the gory
> details, if anyone's interested.

I am :-D

I seriously tried to wrap my mind around this stuff, but as you said,
it is a mess.

Regards,

Miguel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-07-13 13:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-09 19:44 [Qemu-devel] QMP argument parser does not verify json type Miguel Di Ciurcio Filho
2010-07-13 13:03 ` Markus Armbruster
2010-07-13 13:38   ` Miguel Di Ciurcio Filho

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.