]> git.proxmox.com Git - qemu.git/blobdiff - spice-qemu-char.c
Revert "qemu-char: Print strerror message on failure" and deps
[qemu.git] / spice-qemu-char.c
index 7e8eaa9fd8f523fc40229e544d36dd99f0e8e8df..1e735ffd090f5e5b0623a3f5432b3b284d1bc4c4 100644 (file)
@@ -188,7 +188,7 @@ static void print_allowed_subtypes(void)
     fprintf(stderr, "\n");
 }
 
-int qemu_chr_open_spice(QemuOpts *opts, CharDriverState **_chr)
+CharDriverState *qemu_chr_open_spice(QemuOpts *opts)
 {
     CharDriverState *chr;
     SpiceCharDriver *s;
@@ -200,7 +200,7 @@ int qemu_chr_open_spice(QemuOpts *opts, CharDriverState **_chr)
     if (name == NULL) {
         fprintf(stderr, "spice-qemu-char: missing name parameter\n");
         print_allowed_subtypes();
-        return -EINVAL;
+        return NULL;
     }
     for(;*psubtype != NULL; ++psubtype) {
         if (strcmp(name, *psubtype) == 0) {
@@ -211,7 +211,7 @@ int qemu_chr_open_spice(QemuOpts *opts, CharDriverState **_chr)
     if (subtype == NULL) {
         fprintf(stderr, "spice-qemu-char: unsupported name\n");
         print_allowed_subtypes();
-        return -EINVAL;
+        return NULL;
     }
 
     chr = g_malloc0(sizeof(CharDriverState));
@@ -233,6 +233,5 @@ int qemu_chr_open_spice(QemuOpts *opts, CharDriverState **_chr)
     }
 #endif
 
-    *_chr = chr;
-    return 0;
+    return chr;
 }