summaryrefslogtreecommitdiffstats
path: root/spice-qemu-char.c
diff options
context:
space:
mode:
authormalc2011-08-05 08:07:10 +0200
committermalc2011-08-05 08:07:10 +0200
commita67a47d2b559a7733c3f89aeb2d81b19d2c027e4 (patch)
tree146a7b6eebbee1367453fde501d4462ac6d9f8b4 /spice-qemu-char.c
parentMerge branch 'master' of git://git.qemu.org/qemu (diff)
parentMerge remote-tracking branch 'mst/for_anthony' into staging (diff)
downloadqemu-a67a47d2b559a7733c3f89aeb2d81b19d2c027e4.tar.gz
qemu-a67a47d2b559a7733c3f89aeb2d81b19d2c027e4.tar.xz
qemu-a67a47d2b559a7733c3f89aeb2d81b19d2c027e4.zip
Merge branch 'master' of git://git.qemu.org/qemu
Diffstat (limited to 'spice-qemu-char.c')
-rw-r--r--spice-qemu-char.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/spice-qemu-char.c b/spice-qemu-char.c
index 605c241239..95bf6b65d1 100644
--- a/spice-qemu-char.c
+++ b/spice-qemu-char.c
@@ -159,7 +159,7 @@ static void print_allowed_subtypes(void)
fprintf(stderr, "\n");
}
-CharDriverState *qemu_chr_open_spice(QemuOpts *opts)
+int qemu_chr_open_spice(QemuOpts *opts, CharDriverState **_chr)
{
CharDriverState *chr;
SpiceCharDriver *s;
@@ -171,7 +171,7 @@ CharDriverState *qemu_chr_open_spice(QemuOpts *opts)
if (name == NULL) {
fprintf(stderr, "spice-qemu-char: missing name parameter\n");
print_allowed_subtypes();
- return NULL;
+ return -EINVAL;
}
for(;*psubtype != NULL; ++psubtype) {
if (strcmp(name, *psubtype) == 0) {
@@ -182,7 +182,7 @@ CharDriverState *qemu_chr_open_spice(QemuOpts *opts)
if (subtype == NULL) {
fprintf(stderr, "spice-qemu-char: unsupported name\n");
print_allowed_subtypes();
- return NULL;
+ return -EINVAL;
}
chr = qemu_mallocz(sizeof(CharDriverState));
@@ -199,5 +199,6 @@ CharDriverState *qemu_chr_open_spice(QemuOpts *opts)
qemu_chr_generic_open(chr);
- return chr;
+ *_chr = chr;
+ return 0;
}