summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2009-09-10 10:58:35 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-09-11 10:19:47 -0500
commit191bc01bc970bd1e86f34ddeab896b2b27fd5124 (patch)
tree2e88485ef5ca527010d714964bb441020f0df0b1 /qemu-config.c
parentqemu-option.h include protectors (diff)
downloadqemu-kvm-191bc01bc970bd1e86f34ddeab896b2b27fd5124.tar.gz
qemu-kvm-191bc01bc970bd1e86f34ddeab896b2b27fd5124.tar.bz2
qemu-kvm-191bc01bc970bd1e86f34ddeab896b2b27fd5124.zip
switch chardev to QemuOpts: infrastructure, null device
start switching chardevs to QemuOpts. This patch adds the infrastructure and converts the null device. The patch brings two new functions: qemu_chr_open_opts() same as qemu_chr_open(), but uses QemuOpts instead of a option char string. qemu_chr_parse_compat() accepts a traditional chardev option string, returns the corresponding QemuOpts instance, to handle backward compatibility. The patch also adds a new -chardev switch which can be used to create named+unconnected chardevs, like this: -chardev null,id=test This uses the new qemu_chr_open_opts. Thus with this patch alone only the null device works. The other devices will follow ... Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'qemu-config.c')
-rw-r--r--qemu-config.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/qemu-config.c b/qemu-config.c
index 4808db053..b156c2441 100644
--- a/qemu-config.c
+++ b/qemu-config.c
@@ -75,6 +75,14 @@ QemuOptsList qemu_drive_opts = {
},
};
+QemuOptsList qemu_chardev_opts = {
+ .name = "chardev",
+ .head = TAILQ_HEAD_INITIALIZER(qemu_chardev_opts.head),
+ .desc = {
+ { /* end if list */ }
+ },
+};
+
QemuOptsList qemu_device_opts = {
.name = "device",
.head = TAILQ_HEAD_INITIALIZER(qemu_device_opts.head),
@@ -90,6 +98,7 @@ QemuOptsList qemu_device_opts = {
static QemuOptsList *lists[] = {
&qemu_drive_opts,
+ &qemu_chardev_opts,
&qemu_device_opts,
NULL,
};