]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Fix error reporting for getfd + host_net_add in QEMU
authorDaniel P. Berrange <berrange@redhat.com>
Thu, 15 Apr 2010 15:40:54 +0000 (16:40 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Mon, 19 Apr 2010 11:11:24 +0000 (12:11 +0100)
If either of the getfd or host_net_add monitor commands return
any text, this indicates an error condition. Don't ignore this!

* src/qemu/qemu_monitor_text.c: Report errors for getfd and
  host_net_add

src/qemu/qemu_monitor_text.c

index 48c9a545eb55d8414d78cf2e4479333263a67c5b..6ad07b1c7f71ec1ce860812b604c9b14f1d4268f 100644 (file)
@@ -1666,6 +1666,13 @@ int qemuMonitorTextSendFileHandle(qemuMonitorPtr mon,
         goto cleanup;
     }
 
+    if (STRNEQ(reply, "")) {
+        qemuReportError(VIR_ERR_INTERNAL_ERROR,
+                        _("unable to send TAP file handle: %s"),
+                        reply);
+        goto cleanup;
+    }
+
     ret = 0;
 
 cleanup:
@@ -1725,11 +1732,16 @@ int qemuMonitorTextAddHostNetwork(qemuMonitorPtr mon,
 
     if (qemuMonitorCommand(mon, cmd, &reply) < 0) {
         qemuReportError(VIR_ERR_OPERATION_FAILED,
-                        _("failed to close fd in qemu with '%s'"), cmd);
+                        _("failed to add host net with '%s'"), cmd);
         goto cleanup;
     }
 
-    /* XXX error messages here ? */
+    if (STRNEQ(reply, "")) {
+        qemuReportError(VIR_ERR_INTERNAL_ERROR,
+                        _("unable to add host net: %s"),
+                        reply);
+        goto cleanup;
+    }
 
     ret = 0;