Patchwork [16/19] spice-qemu-char: Chardev open error reporting, spicevmc part

login
register
mail settings
Submitter Markus Armbruster
Date Feb. 7, 2012, 2:09 p.m.
Message ID <1328623766-12287-17-git-send-email-armbru@redhat.com>
Download mbox | patch
Permalink /patch/139942/
State New
Headers show

Comments

Markus Armbruster - Feb. 7, 2012, 2:09 p.m.
Convert to error_report().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 spice-qemu-char.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

Patch

diff --git a/spice-qemu-char.c b/spice-qemu-char.c
index 1e735ff..290437d 100644
--- a/spice-qemu-char.c
+++ b/spice-qemu-char.c
@@ -176,16 +176,16 @@  static void print_allowed_subtypes(void)
     const char** psubtype;
     int i;
 
-    fprintf(stderr, "allowed names: ");
+    error_printf("allowed names: ");
     for(i=0, psubtype = spice_server_char_device_recognized_subtypes();
         *psubtype != NULL; ++psubtype, ++i) {
         if (i == 0) {
-            fprintf(stderr, "%s", *psubtype);
+            error_printf("%s", *psubtype);
         } else {
-            fprintf(stderr, ", %s", *psubtype);
+            error_printf(", %s", *psubtype);
         }
     }
-    fprintf(stderr, "\n");
+    error_printf("\n");
 }
 
 CharDriverState *qemu_chr_open_spice(QemuOpts *opts)
@@ -198,7 +198,7 @@  CharDriverState *qemu_chr_open_spice(QemuOpts *opts)
     const char *subtype = NULL;
 
     if (name == NULL) {
-        fprintf(stderr, "spice-qemu-char: missing name parameter\n");
+        error_report("spicevmc character device requires parameter name");
         print_allowed_subtypes();
         return NULL;
     }
@@ -209,7 +209,7 @@  CharDriverState *qemu_chr_open_spice(QemuOpts *opts)
         }
     }
     if (subtype == NULL) {
-        fprintf(stderr, "spice-qemu-char: unsupported name\n");
+        error_report("name '%s' is not supported", name);
         print_allowed_subtypes();
         return NULL;
     }