Patchwork [15/24] switch qemu-config to qemu_error

login
register
mail settings
Submitter Gerd Hoffmann
Date Sept. 25, 2009, 7:42 p.m.
Message ID <1253907769-1067-16-git-send-email-kraxel@redhat.com>
Download mbox | patch
Permalink /patch/34298/
State Superseded
Headers show

Comments

Gerd Hoffmann - Sept. 25, 2009, 7:42 p.m.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 qemu-config.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
Markus Armbruster - Sept. 28, 2009, 8:40 p.m.
This is to make it available for monitor code.  I can't see any use in
this patch series, but it's a good change all the same.
Gerd Hoffmann - Sept. 29, 2009, 8:57 a.m.
On 09/28/09 22:40, Markus Armbruster wrote:
> This is to make it available for monitor code.  I can't see any use in
> this patch series, but it's a good change all the same.

Patch #16 does.

cheers,
   Gerd

Patch

diff --git a/qemu-config.c b/qemu-config.c
index 39bf6a9..89b2b7c 100644
--- a/qemu-config.c
+++ b/qemu-config.c
@@ -1,6 +1,7 @@ 
 #include "qemu-common.h"
 #include "qemu-option.h"
 #include "qemu-config.h"
+#include "sysemu.h"
 
 QemuOptsList qemu_drive_opts = {
     .name = "drive",
@@ -166,7 +167,7 @@  int qemu_set_option(const char *str)
 
     rc = sscanf(str, "%63[^.].%63[^.].%63[^=]%n", group, id, arg, &offset);
     if (rc < 3 || str[offset] != '=') {
-        fprintf(stderr, "can't parse: \"%s\"\n", str);
+        qemu_error("can't parse: \"%s\"\n", str);
         return -1;
     }
 
@@ -175,19 +176,19 @@  int qemu_set_option(const char *str)
             break;
     }
     if (lists[i] == NULL) {
-        fprintf(stderr, "there is no option group \"%s\"\n", group);
+        qemu_error("there is no option group \"%s\"\n", group);
         return -1;
     }
 
     opts = qemu_opts_find(lists[i], id);
     if (!opts) {
-        fprintf(stderr, "there is no %s \"%s\" defined\n",
+        qemu_error("there is no %s \"%s\" defined\n",
                 lists[i]->name, id);
         return -1;
     }
 
     if (-1 == qemu_opt_set(opts, arg, str+offset+1)) {
-        fprintf(stderr, "failed to set \"%s\" for %s \"%s\"\n",
+        qemu_error("failed to set \"%s\" for %s \"%s\"\n",
                 arg, lists[i]->name, id);
         return -1;
     }