[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] QMP argument parser does not verify json type
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] QMP argument parser does not verify json type |
Date: |
Tue, 13 Jul 2010 15:03:29 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
Miguel Di Ciurcio Filho <address@hidden> 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.