]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
qemu: s/VIR_ERR_NO_SUPPORT/VIR_ERR_OPERATION_UNSUPPORTED
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 20 Mar 2013 15:57:08 +0000 (16:57 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 21 Mar 2013 08:26:15 +0000 (09:26 +0100)
The VIR_ERR_NO_SUPPORT error code is reserved for cases where an
API is not implemented in a driver. It definitely should not be
used when an API execution fails due to unsupported operation.

src/qemu/qemu_driver.c
src/qemu/qemu_hotplug.c
src/qemu/qemu_monitor.c
src/qemu/qemu_monitor_text.c
src/qemu/qemu_process.c

index 3b1beb40def024fed0473deb55a98d0c91557343..1f9b8b20ac6c7f271d594006262a7570f3517c8f 100644 (file)
@@ -3141,7 +3141,7 @@ static int qemuDumpToFd(virQEMUDriverPtr driver, virDomainObjPtr vm,
     int ret = -1;
 
     if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DUMP_GUEST_MEMORY)) {
-        virReportError(VIR_ERR_NO_SUPPORT, "%s",
+        virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
                        _("dump-guest-memory is not supported"));
         return -1;
     }
index 044f8cda91e6aeab607869bc86799235bb120bad..de9edd4ca384336a2b7bebe4bbe180739b3a2343 100644 (file)
@@ -1468,7 +1468,7 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
     int ret = -1;
 
     if (!devslot || !(olddev = *devslot)) {
-        virReportError(VIR_ERR_NO_SUPPORT, "%s",
+        virReportError(VIR_ERR_OPERATION_FAILED, "%s",
                        _("cannot find existing network device to modify"));
         goto cleanup;
     }
@@ -1476,7 +1476,7 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
     oldType = virDomainNetGetActualType(olddev);
     if (oldType == VIR_DOMAIN_NET_TYPE_HOSTDEV) {
         /* no changes are possible to a type='hostdev' interface */
-        virReportError(VIR_ERR_NO_SUPPORT,
+        virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
                        _("cannot change config of '%s' network type"),
                        virDomainNetTypeToString(oldType));
         goto cleanup;
@@ -1499,7 +1499,7 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
     if (virMacAddrCmp(&olddev->mac, &newdev->mac)) {
         char oldmac[VIR_MAC_STRING_BUFLEN], newmac[VIR_MAC_STRING_BUFLEN];
 
-        virReportError(VIR_ERR_NO_SUPPORT,
+        virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
                        _("cannot change network interface mac address "
                          "from %s to %s"),
                        virMacAddrFormat(&olddev->mac, oldmac),
@@ -1508,7 +1508,7 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
     }
 
     if (STRNEQ_NULLABLE(olddev->model, newdev->model)) {
-        virReportError(VIR_ERR_NO_SUPPORT,
+        virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
                        _("cannot modify network device model from %s to %s"),
                        olddev->model ? olddev->model : "(default)",
                        newdev->model ? newdev->model : "(default)");
@@ -1520,7 +1520,7 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
          olddev->driver.virtio.txmode != newdev->driver.virtio.txmode ||
          olddev->driver.virtio.ioeventfd != newdev->driver.virtio.ioeventfd ||
          olddev->driver.virtio.event_idx != newdev->driver.virtio.event_idx)) {
-        virReportError(VIR_ERR_NO_SUPPORT, "%s",
+        virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
                        _("cannot modify virtio network device driver attributes"));
         goto cleanup;
     }
@@ -1534,7 +1534,7 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
     }
 
     if (STRNEQ_NULLABLE(olddev->script, newdev->script)) {
-        virReportError(VIR_ERR_NO_SUPPORT, "%s",
+        virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
                        _("cannot modify network device script attribute"));
         goto cleanup;
     }
@@ -1546,7 +1546,7 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
         goto cleanup;
     }
     if (STRNEQ_NULLABLE(olddev->ifname, newdev->ifname)) {
-        virReportError(VIR_ERR_NO_SUPPORT, "%s",
+        virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
                        _("cannot modify network device tap name"));
         goto cleanup;
     }
@@ -1564,7 +1564,7 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
     }
     if (!virDevicePCIAddressEqual(&olddev->info.addr.pci,
                                   &newdev->info.addr.pci)) {
-        virReportError(VIR_ERR_NO_SUPPORT, "%s",
+        virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
                        _("cannot modify network device guest PCI address"));
         goto cleanup;
     }
@@ -1575,22 +1575,22 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
         goto cleanup;
     }
     if (STRNEQ_NULLABLE(olddev->info.alias, newdev->info.alias)) {
-        virReportError(VIR_ERR_NO_SUPPORT, "%s",
+        virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
                        _("cannot modify network device alias"));
         goto cleanup;
     }
     if (olddev->info.rombar != newdev->info.rombar) {
-        virReportError(VIR_ERR_NO_SUPPORT, "%s",
+        virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
                        _("cannot modify network device rom bar setting"));
         goto cleanup;
     }
     if (STRNEQ_NULLABLE(olddev->info.romfile, newdev->info.romfile)) {
-        virReportError(VIR_ERR_NO_SUPPORT, "%s",
+        virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
                        _("cannot modify network rom file"));
         goto cleanup;
     }
     if (olddev->info.bootIndex != newdev->info.bootIndex) {
-        virReportError(VIR_ERR_NO_SUPPORT, "%s",
+        virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
                        _("cannot modify network device boot index setting"));
         goto cleanup;
     }
@@ -1617,7 +1617,7 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
 
     if (newType == VIR_DOMAIN_NET_TYPE_HOSTDEV) {
         /* can't turn it into a type='hostdev' interface */
-        virReportError(VIR_ERR_NO_SUPPORT,
+        virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
                        _("cannot change network interface type to '%s'"),
                        virDomainNetTypeToString(newType));
         goto cleanup;
@@ -1675,7 +1675,7 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
             break;
 
         default:
-            virReportError(VIR_ERR_NO_SUPPORT,
+            virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
                            _("unable to change config on '%s' network type"),
                            virDomainNetTypeToString(newdev->type));
             break;
@@ -1746,7 +1746,7 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
     /* FINALLY - actually perform the required actions */
 
     if (needReconnect) {
-        virReportError(VIR_ERR_NO_SUPPORT,
+        virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
                        _("unable to change config on '%s' network type"),
                        virDomainNetTypeToString(newdev->type));
         goto cleanup;
index 175aa57edcf9e29df8022657eafd65f526511e98..30f78203e788da3a683023910c03ab5cd85074b7 100644 (file)
@@ -2121,7 +2121,7 @@ qemuMonitorDumpToFd(qemuMonitorPtr mon, int fd)
         /* We don't have qemuMonitorTextDump(), so we should check mon->json
          * here.
          */
-        virReportError(VIR_ERR_NO_SUPPORT, "%s",
+        virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
                        _("dump-guest-memory is not supported in text mode"));
         return -1;
     }
index 25c82b6ef6f2960d91aaea3168c58ff85d4c4941..daade3d554c9160b5cd5c3f82cb5375173fe152c 100644 (file)
@@ -470,7 +470,7 @@ int qemuMonitorTextSetLink(qemuMonitorPtr mon, const char *name, enum virDomainN
 
     /* check if set_link command is supported */
     if (strstr(info, "\nunknown ")) {
-        virReportError(VIR_ERR_NO_SUPPORT,
+        virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
                        "%s",
                        _("\'set_link\' not supported by this qemu"));
         goto error;
index fcb3c5002176d1b3b3d55e78f85131f562a4b495..14aa8922ed60b25dd1c7b27c2e7567a1d1315e69 100644 (file)
@@ -1902,7 +1902,7 @@ qemuProcessSetLinkStates(virDomainObjPtr vm)
             VIR_DEBUG("Setting link state: %s", def->nets[i]->info.alias);
 
             if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_NETDEV)) {
-                virReportError(VIR_ERR_NO_SUPPORT, "%s",
+                virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
                                _("Setting of link state is not supported by this qemu"));
                 return -1;
             }