X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=spice-qemu-char.c;h=95bf6b65d15cca5ac7cecffc130571da05a0536f;hb=aad04cd024f0c59f0b96f032cde2e24eb3abba6d;hp=605c2412393b8679f1d6b0b7648619975b33443e;hpb=befeac45d4d9afb587eca9a27d975db4a7950960;p=qemu.git diff --git a/spice-qemu-char.c b/spice-qemu-char.c index 605c24123..95bf6b65d 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; }