summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2010-03-25 17:22:32 +0100
committerAurelien Jarno <aurelien@aurel32.net>2010-04-18 23:46:48 +0200
commit975b63a4ee43870ffd96ce358ce597e42fbe1e1e (patch)
tree2b958199d0367a327a333d952b8c95665ed36813
parent7bc8401712d70dc12f230fb69cdb38511fd021b1 (diff)
downloadfocaccia-qemu-975b63a4ee43870ffd96ce358ce597e42fbe1e1e.tar.gz
focaccia-qemu-975b63a4ee43870ffd96ce358ce597e42fbe1e1e.zip
error: Convert qemu_opts_create() to QError
Fixes device_add to report duplicate ID properly in QMP, as
DuplicateId instead of UndefinedError.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
-rw-r--r--qemu-option.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/qemu-option.c b/qemu-option.c
index f83d07c1e7..12ce32240a 100644
--- a/qemu-option.c
+++ b/qemu-option.c
@@ -30,6 +30,7 @@
 #include "qemu-error.h"
 #include "qemu-objects.h"
 #include "qemu-option.h"
+#include "qerror.h"
 
 /*
  * Extracts the name of an option from the parameter string (p points at the
@@ -643,8 +644,7 @@ QemuOpts *qemu_opts_create(QemuOptsList *list, const char *id, int fail_if_exist
         opts = qemu_opts_find(list, id);
         if (opts != NULL) {
             if (fail_if_exists) {
-                fprintf(stderr, "tried to create id \"%s\" twice for \"%s\"\n",
-                        id, list->name);
+                qerror_report(QERR_DUPLICATE_ID, id, list->name);
                 return NULL;
             } else {
                 return opts;