[PATCH 8/8] xen: Cleanup improper VIR_ERR_NO_SUPPORT use

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 src/xen/xen_hypervisor.c |    4 ++--
 src/xen/xend_internal.c  |   26 +++++++++++++-------------
 src/xen/xm_internal.c    |    3 ++-
 src/xenxs/xen_sxpr.c     |    4 ++--
 4 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/src/xen/xen_hypervisor.c b/src/xen/xen_hypervisor.c
index cb22b89..77085c9 100644
--- a/src/xen/xen_hypervisor.c
+++ b/src/xen/xen_hypervisor.c
@@ -1457,7 +1457,7 @@ xenHypervisorDomainBlockStats (virDomainPtr dom,
     xenUnifiedUnlock(priv);
     return ret;
 #else
-    virXenErrorFunc(VIR_ERR_NO_SUPPORT, __FUNCTION__,
+    virXenErrorFunc(VIR_ERR_OPERATION_INVALID, __FUNCTION__,
                     "block statistics not supported on this platform",
                     dom->id);
     return -1;
@@ -1495,7 +1495,7 @@ xenHypervisorDomainInterfaceStats (virDomainPtr dom,
 
     return linuxDomainInterfaceStats(path, stats);
 #else
-    virXenErrorFunc(VIR_ERR_NO_SUPPORT, __FUNCTION__,
+    virXenErrorFunc(VIR_ERR_OPERATION_INVALID, __FUNCTION__,
                     "/proc/net/dev: Interface not found", 0);
     return -1;
 #endif
diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c
index 6d5a854..f44d674 100644
--- a/src/xen/xend_internal.c
+++ b/src/xen/xend_internal.c
@@ -2793,14 +2793,14 @@ xenDaemonAttachDeviceFlags(virDomainPtr domain, const char *xml,
                 goto cleanup;
             }
         } else {
-            virXendError(VIR_ERR_NO_SUPPORT, "%s",
+            virXendError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
                          _("unsupported device type"));
             goto cleanup;
         }
         break;
 
     default:
-        virXendError(VIR_ERR_NO_SUPPORT, "%s",
+        virXendError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
                      _("unsupported device type"));
         goto cleanup;
     }
@@ -2921,7 +2921,7 @@ xenDaemonUpdateDeviceFlags(virDomainPtr domain, const char *xml,
         break;
 
     default:
-        virXendError(VIR_ERR_NO_SUPPORT, "%s",
+        virXendError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
                      _("unsupported device type"));
         goto cleanup;
     }
@@ -3032,7 +3032,7 @@ xenDaemonDetachDeviceFlags(virDomainPtr domain, const char *xml,
             if (xenFormatSxprOnePCI(dev->data.hostdev, &buf, 1) < 0)
                 goto cleanup;
         } else {
-            virXendError(VIR_ERR_NO_SUPPORT, "%s",
+            virXendError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
                          _("unsupported device type"));
             goto cleanup;
         }
@@ -3222,7 +3222,7 @@ xenDaemonDomainMigratePerform (virDomainPtr domain,
 
     /* Xen doesn't support renaming domains during migration. */
     if (dname) {
-        virXendError(VIR_ERR_NO_SUPPORT,
+        virXendError(VIR_ERR_OPERATION_INVALID,
                       "%s", _("xenDaemonDomainMigrate: Xen does not support"
                         " renaming domains during migration"));
         return -1;
@@ -3232,7 +3232,7 @@ xenDaemonDomainMigratePerform (virDomainPtr domain,
      * ignores it.
      */
     if (bandwidth) {
-        virXendError(VIR_ERR_NO_SUPPORT,
+        virXendError(VIR_ERR_OPERATION_INVALID,
                       "%s", _("xenDaemonDomainMigrate: Xen does not support"
                         " bandwidth limits during migration"));
         return -1;
@@ -3260,7 +3260,7 @@ xenDaemonDomainMigratePerform (virDomainPtr domain,
      * a nice error message.
      */
     if (flags & VIR_MIGRATE_PAUSED) {
-        virXendError(VIR_ERR_NO_SUPPORT,
+        virXendError(VIR_ERR_OPERATION_INVALID,
                       "%s", _("xenDaemonDomainMigrate: xend cannot migrate paused domains"));
         return -1;
     }
@@ -3268,7 +3268,7 @@ xenDaemonDomainMigratePerform (virDomainPtr domain,
     /* XXX we could easily do tunnelled & peer2peer migration too
        if we want to. support these... */
     if (flags != 0) {
-        virXendError(VIR_ERR_NO_SUPPORT,
+        virXendError(VIR_ERR_OPERATION_INVALID,
                       "%s", _("xenDaemonDomainMigrate: unsupported flag"));
         return -1;
     }
@@ -3569,7 +3569,7 @@ xenDaemonGetSchedulerType(virDomainPtr domain, int *nparams)
     /* Support only xendConfigVersion >=4 */
     priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
     if (priv->xendConfigVersion < 4) {
-        virXendError(VIR_ERR_NO_SUPPORT,
+        virXendError(VIR_ERR_OPERATION_INVALID,
                       "%s", _("unsupported in xendConfigVersion < 4"));
         return NULL;
     }
@@ -3645,7 +3645,7 @@ xenDaemonGetSchedulerParameters(virDomainPtr domain,
     /* Support only xendConfigVersion >=4 */
     priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
     if (priv->xendConfigVersion < 4) {
-        virXendError(VIR_ERR_NO_SUPPORT,
+        virXendError(VIR_ERR_OPERATION_INVALID,
                       "%s", _("unsupported in xendConfigVersion < 4"));
         return (-1);
     }
@@ -3752,7 +3752,7 @@ xenDaemonSetSchedulerParameters(virDomainPtr domain,
     /* Support only xendConfigVersion >=4 and active domains */
     priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
     if (priv->xendConfigVersion < 4) {
-        virXendError(VIR_ERR_NO_SUPPORT,
+        virXendError(VIR_ERR_OPERATION_INVALID,
                       "%s", _("unsupported in xendConfigVersion < 4"));
         return (-1);
     }
@@ -3871,7 +3871,7 @@ xenDaemonDomainBlockPeek (virDomainPtr domain, const char *path,
                           domain->name);
     else {
         /* This call always fails for dom0. */
-        virXendError(VIR_ERR_NO_SUPPORT,
+        virXendError(VIR_ERR_OPERATION_INVALID,
                       "%s", _("domainBlockPeek is not supported for dom0"));
         return -1;
     }
@@ -4060,7 +4060,7 @@ virDomainXMLDevID(virDomainPtr domain,
         if (tmp == NULL)
             return -1;
     } else {
-        virXendError(VIR_ERR_NO_SUPPORT,
+        virXendError(VIR_ERR_OPERATION_INVALID,
                      "%s", _("hotplug of device type not supported"));
         return -1;
     }
diff --git a/src/xen/xm_internal.c b/src/xen/xm_internal.c
index 95387c9..24311a7 100644
--- a/src/xen/xm_internal.c
+++ b/src/xen/xm_internal.c
@@ -1571,7 +1571,8 @@ xenXMDomainBlockPeek (virDomainPtr dom ATTRIBUTE_UNUSED,
                       size_t size ATTRIBUTE_UNUSED,
                       void *buffer ATTRIBUTE_UNUSED)
 {
-    xenXMError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
+    xenXMError(VIR_ERR_OPERATION_INVALID, "%s",
+               _("block peeking not implemented"));
     return -1;
 }
 
diff --git a/src/xenxs/xen_sxpr.c b/src/xenxs/xen_sxpr.c
index 1f5be5f..6d83040 100644
--- a/src/xenxs/xen_sxpr.c
+++ b/src/xenxs/xen_sxpr.c
@@ -1865,7 +1865,7 @@ xenFormatSxprOnePCI(virDomainHostdevDefPtr def,
                     int detach)
 {
     if (def->managed) {
-        XENXS_ERROR(VIR_ERR_NO_SUPPORT, "%s",
+        XENXS_ERROR(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
                      _("managed PCI devices not supported with XenD"));
         return -1;
     }
@@ -1915,7 +1915,7 @@ xenFormatSxprAllPCI(virDomainDefPtr def,
         if (def->hostdevs[i]->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
             def->hostdevs[i]->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI) {
             if (def->hostdevs[i]->managed) {
-                XENXS_ERROR(VIR_ERR_NO_SUPPORT, "%s",
+                XENXS_ERROR(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
                              _("managed PCI devices not supported with XenD"));
                 return -1;
             }
-- 
1.7.6

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]