]> xenbits.xensource.com Git - libvirt.git/commitdiff
Fix error message on redirdev caps detection
authorJán Tomko <jtomko@redhat.com>
Tue, 16 Dec 2014 15:29:00 +0000 (16:29 +0100)
committerJán Tomko <jtomko@redhat.com>
Wed, 17 Dec 2014 15:23:45 +0000 (16:23 +0100)
src/qemu/qemu_command.c
src/qemu/qemu_hotplug.c

index 53d662906b186780ae95f5d64faffc8f74c570cd..11e7cffb9532d9da12dc67b9eadc36027a5c8db0 100644 (file)
@@ -9512,8 +9512,12 @@ qemuBuildCommandLine(virConnectPtr conn,
         virCommandAddArg(cmd, devstr);
         VIR_FREE(devstr);
 
-        if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE))
+        if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) {
+            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                           _("redirected devices are not supported by this QEMU"));
             goto error;
+        }
+
 
         virCommandAddArg(cmd, "-device");
         if (!(devstr = qemuBuildRedirdevDevStr(def, redirdev, qemuCaps)))
index 5b65283aa2e78fbee0071b97e7b246afa4078c1e..21e9713099d8b45aa16cd0a472d20e2a5352a433 100644 (file)
@@ -1358,13 +1358,17 @@ int qemuDomainAttachRedirdevDevice(virQEMUDriverPtr driver,
     virDomainDefPtr def = vm->def;
     char *devstr = NULL;
 
-    if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
-        if (qemuAssignDeviceRedirdevAlias(vm->def, redirdev, -1) < 0)
-            goto error;
-        if (!(devstr = qemuBuildRedirdevDevStr(def, redirdev, priv->qemuCaps)))
-            goto error;
+    if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                       _("redirected devices are not supported by this QEMU"));
+        goto error;
     }
 
+    if (qemuAssignDeviceRedirdevAlias(vm->def, redirdev, -1) < 0)
+        goto error;
+    if (!(devstr = qemuBuildRedirdevDevStr(def, redirdev, priv->qemuCaps)))
+        goto error;
+
     if (VIR_REALLOC_N(vm->def->redirdevs, vm->def->nredirdevs+1) < 0)
         goto error;