]> xenbits.xensource.com Git - libvirt.git/commitdiff
storage: Replace VIR_ERROR with standard vir*Error in state driver init
authorJovanka Gulicoska <jovanka.gulicoska@gmail.com>
Mon, 23 May 2016 18:36:01 +0000 (20:36 +0200)
committerCole Robinson <crobinso@redhat.com>
Mon, 23 May 2016 19:42:46 +0000 (15:42 -0400)
Replace VIR_ERROR with virReportError and virReportSystemError

src/storage/storage_driver.c

index eb5f688facebf4885e0053a61176661decb29d8d..fb1b1a206e98048e98d0b3bdae146e0a1b2f6131 100644 (file)
@@ -88,7 +88,8 @@ storagePoolUpdateState(virStoragePoolObjPtr pool)
         goto error;
 
     if ((backend = virStorageBackendForType(pool->def->type)) == NULL) {
-        VIR_ERROR(_("Missing backend %d"), pool->def->type);
+        virReportError(VIR_ERR_INTERNAL_ERROR,
+                       _("Missing backend %d"), pool->def->type);
         goto error;
     }
 
@@ -98,8 +99,9 @@ storagePoolUpdateState(virStoragePoolObjPtr pool)
     active = false;
     if (backend->checkPool &&
         backend->checkPool(pool, &active) < 0) {
-        VIR_ERROR(_("Failed to initialize storage pool '%s': %s"),
-                  pool->def->name, virGetLastErrorMessage());
+        virReportError(VIR_ERR_INTERNAL_ERROR,
+                       _("Failed to initialize storage pool '%s': %s"),
+                       pool->def->name, virGetLastErrorMessage());
         goto error;
     }
 
@@ -112,8 +114,9 @@ storagePoolUpdateState(virStoragePoolObjPtr pool)
         if (backend->refreshPool(NULL, pool) < 0) {
             if (backend->stopPool)
                 backend->stopPool(NULL, pool);
-            VIR_ERROR(_("Failed to restart storage pool '%s': %s"),
-                      pool->def->name, virGetLastErrorMessage());
+            virReportError(VIR_ERR_INTERNAL_ERROR,
+                           _("Failed to restart storage pool '%s': %s"),
+                           pool->def->name, virGetLastErrorMessage());
             goto error;
         }
     }
@@ -172,8 +175,9 @@ storageDriverAutostart(void)
             !virStoragePoolObjIsActive(pool)) {
             if (backend->startPool &&
                 backend->startPool(conn, pool) < 0) {
-                VIR_ERROR(_("Failed to autostart storage pool '%s': %s"),
-                          pool->def->name, virGetLastErrorMessage());
+                virReportError(VIR_ERR_INTERNAL_ERROR,
+                               _("Failed to autostart storage pool '%s': %s"),
+                               pool->def->name, virGetLastErrorMessage());
                 virStoragePoolObjUnlock(pool);
                 continue;
             }
@@ -193,8 +197,9 @@ storageDriverAutostart(void)
                     unlink(stateFile);
                 if (backend->stopPool)
                     backend->stopPool(conn, pool);
-                VIR_ERROR(_("Failed to autostart storage pool '%s': %s"),
-                          pool->def->name, virGetLastErrorMessage());
+                virReportError(VIR_ERR_INTERNAL_ERROR,
+                               _("Failed to autostart storage pool '%s': %s"),
+                               pool->def->name, virGetLastErrorMessage());
             } else {
                 pool->active = true;
             }