diff options
author | Markus Armbruster <armbru@redhat.com> | 2013-02-13 15:54:16 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-02-13 11:57:32 -0600 |
commit | d36b2b904ee921b380fad559cb824a40eb587bcb (patch) | |
tree | 505d25ee160bfcfedf695d4f581bd0d2fc060253 /qapi-schema.json | |
parent | d037d6bbbcdda6552254286b6da090ef0dc0d98a (diff) | |
download | qemu-d36b2b904ee921b380fad559cb824a40eb587bcb.zip qemu-d36b2b904ee921b380fad559cb824a40eb587bcb.tar.gz qemu-d36b2b904ee921b380fad559cb824a40eb587bcb.tar.bz2 |
qapi: Flatten away ChardevPort
Simplifies the schema and the code.
QMP command
{ "execute" : "chardev-add",
"arguments" : { "id" : "ser0",
"backend" : { "type" : "port",
"data" : { "type": "serial",
"device":"/dev/ttyS0"} } } }
becomes
{ "execute" : "chardev-add",
"arguments" : { "id" : "ser0",
"backend" : { "type" : "serial",
"data" : { "device":"/dev/ttyS0"} } } }
Bonus: nicer error messages. "unknown chardev port (1)" becomes
"character device backend type 'parallel' not supported".
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Message-id: 1360767256-610-3-git-send-email-armbru@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'qapi-schema.json')
-rw-r--r-- | qapi-schema.json | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/qapi-schema.json b/qapi-schema.json index bd289ae..7275b5d 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -3095,7 +3095,7 @@ 'out' : 'str' } } ## -# @ChardevPort: +# @ChardevHostdev: # # Configuration info for device chardevs. # @@ -3105,11 +3105,7 @@ # # Since: 1.4 ## -{ 'enum': 'ChardevPortKind', 'data': [ 'serial', - 'parallel' ] } - -{ 'type': 'ChardevPort', 'data': { 'device' : 'str', - 'type' : 'ChardevPortKind'} } +{ 'type': 'ChardevHostdev', 'data': { 'device' : 'str' } } ## # @ChardevSocket: @@ -3142,7 +3138,8 @@ { 'type': 'ChardevDummy', 'data': { } } { 'union': 'ChardevBackend', 'data': { 'file' : 'ChardevFile', - 'port' : 'ChardevPort', + 'serial' : 'ChardevHostdev', + 'parallel': 'ChardevHostdev', 'socket' : 'ChardevSocket', 'pty' : 'ChardevDummy', 'null' : 'ChardevDummy' } } |