[PATCH 8/8] vbox: Stop reporting RC in error messages

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

 



As shown in the commit that introduced vboxReportError(), we are
appending the retval of a failed VirtualBox API onto our error
messages. Well, this is no longer needed because
vboxReportError() already appends the VirtualBox error in plain
text.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/vbox/vbox_common.c | 301 ++++++++++++++++++-----------------------
 1 file changed, 132 insertions(+), 169 deletions(-)

diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c
index cf404ea9d7..0a83cc5a61 100644
--- a/src/vbox/vbox_common.c
+++ b/src/vbox/vbox_common.c
@@ -570,8 +570,8 @@ vboxSetStorageController(virDomainControllerDef *controller,
 
     if (NS_FAILED(rc)) {
         vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                        _("Failed to add storage controller (name: %s, busType: %d), rc=%08x"),
-                        debugName, vboxBusType, rc);
+                        _("Failed to add storage controller (name: %s, busType: %d)"),
+                        debugName, vboxBusType);
         goto cleanup;
     }
 
@@ -581,7 +581,7 @@ vboxSetStorageController(virDomainControllerDef *controller,
                                                             vboxModel);
         if (NS_FAILED(rc)) {
             vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                            _("Failed to change storage controller model, rc=%08x"), rc);
+                            _("Failed to change storage controller model"));
             goto cleanup;
         }
     }
@@ -795,9 +795,8 @@ static int vboxConnectListDomains(virConnectPtr conn, int *ids, int nids)
 
     rc = gVBoxAPI.UArray.vboxArrayGet(&machines, data->vboxObj, ARRAY_GET_MACHINES);
     if (NS_FAILED(rc)) {
-        vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                        _("Could not get list of Domains, rc=%08x"),
-                        (unsigned)rc);
+        vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                        _("Could not get list of Domains"));
         goto cleanup;
     }
 
@@ -837,8 +836,8 @@ static int vboxConnectNumOfDomains(virConnectPtr conn)
 
     rc = gVBoxAPI.UArray.vboxArrayGet(&machines, data->vboxObj, ARRAY_GET_MACHINES);
     if (NS_FAILED(rc)) {
-        vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                        _("Could not get number of Domains, rc=%08x"), (unsigned)rc);
+        vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                        _("Could not get number of Domains"));
         goto cleanup;
     }
 
@@ -891,8 +890,8 @@ static virDomainPtr vboxDomainLookupByID(virConnectPtr conn, int id)
 
     rc = gVBoxAPI.UArray.vboxArrayGet(&machines, data->vboxObj, ARRAY_GET_MACHINES);
     if (NS_FAILED(rc)) {
-        vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                        _("Could not get list of machines, rc=%08x"), (unsigned)rc);
+        vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                        _("Could not get list of machines"));
         return NULL;
     }
 
@@ -958,7 +957,7 @@ virDomainPtr vboxDomainLookupByUUID(virConnectPtr conn,
     rc = gVBoxAPI.UArray.vboxArrayGet(&machines, data->vboxObj, ARRAY_GET_MACHINES);
     if (NS_FAILED(rc)) {
         vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                        _("Could not get list of machines, rc=%08x"), (unsigned)rc);
+                        _("Could not get list of machines"));
         return NULL;
     }
 
@@ -1030,7 +1029,7 @@ vboxDomainLookupByName(virConnectPtr conn, const char *name)
     rc = gVBoxAPI.UArray.vboxArrayGet(&machines, data->vboxObj, ARRAY_GET_MACHINES);
     if (NS_FAILED(rc)) {
         vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                        _("Could not get list of machines, rc=%08x"), (unsigned)rc);
+                        _("Could not get list of machines"));
         return NULL;
     }
 
@@ -1270,8 +1269,8 @@ vboxAttachDrives(virDomainDef *def, struct _vboxDriver *data, IMachine *machine)
 
             if (!medium) {
                 vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                                _("Failed to open the following disk/dvd/floppy to the machine: %s, rc=%08x"),
-                                src, rc);
+                                _("Failed to open the following disk/dvd/floppy to the machine: %s"),
+                                src);
                 ret = -1;
                 goto cleanup;
             }
@@ -1279,8 +1278,8 @@ vboxAttachDrives(virDomainDef *def, struct _vboxDriver *data, IMachine *machine)
             rc = gVBoxAPI.UIMedium.GetId(medium, &mediumUUID);
             if (NS_FAILED(rc)) {
                 vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                                _("Can't get the UUID of the file to be attached as harddisk/dvd/floppy: %s, rc=%08x"),
-                                src, rc);
+                                _("Can't get the UUID of the file to be attached as harddisk/dvd/floppy: %s"),
+                                src);
                 ret = -1;
                 goto cleanup;
             }
@@ -1314,8 +1313,8 @@ vboxAttachDrives(virDomainDef *def, struct _vboxDriver *data, IMachine *machine)
 
         if (NS_FAILED(rc)) {
             vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                            _("Could not attach the file as harddisk/dvd/floppy: %s, rc=%08x"),
-                            src, rc);
+                            _("Could not attach the file as harddisk/dvd/floppy: %s"),
+                            src);
             ret = -1;
             goto cleanup;
         } else {
@@ -1977,7 +1976,7 @@ vboxDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags
 
     if (NS_FAILED(rc)) {
         vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                        _("could not define a domain, rc=%08x"), (unsigned)rc);
+                        _("could not define a domain"));
         goto cleanup;
     }
 
@@ -1985,8 +1984,8 @@ vboxDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags
                                           VIR_DIV_UP(def->mem.cur_balloon, 1024));
     if (NS_FAILED(rc)) {
         vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                        _("could not set the memory size of the domain to: %llu Kb, rc=%08x"),
-                        def->mem.cur_balloon, (unsigned)rc);
+                        _("could not set the memory size of the domain to: %llu Kb"),
+                        def->mem.cur_balloon);
     }
 
     if (virDomainDefHasVcpusOffline(def)) {
@@ -1996,8 +1995,8 @@ vboxDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags
     rc = gVBoxAPI.UIMachine.SetCPUCount(machine, virDomainDefGetVcpusMax(def));
     if (NS_FAILED(rc)) {
         vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                        _("could not set the number of virtual CPUs to: %u, rc=%08x"),
-                        virDomainDefGetVcpusMax(def), (unsigned)rc);
+                        _("could not set the number of virtual CPUs to: %u"),
+                        virDomainDefGetVcpusMax(def));
     }
 
     rc = gVBoxAPI.UIMachine.SetCPUProperty(machine, CPUPropertyType_PAE,
@@ -2005,9 +2004,9 @@ vboxDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags
                                            VIR_TRISTATE_SWITCH_ON);
     if (NS_FAILED(rc)) {
         vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                        _("could not change PAE status to: %s, rc=%08x"),
+                        _("could not change PAE status to: %s"),
                         (def->features[VIR_DOMAIN_FEATURE_PAE] == VIR_TRISTATE_SWITCH_ON)
-                        ? _("Enabled") : _("Disabled"), (unsigned)rc);
+                        ? _("Enabled") : _("Disabled"));
     }
 
     gVBoxAPI.UIMachine.GetBIOSSettings(machine, &bios);
@@ -2017,18 +2016,18 @@ vboxDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags
                                                     VIR_TRISTATE_SWITCH_ON);
         if (NS_FAILED(rc)) {
             vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                            _("could not change ACPI status to: %s, rc=%08x"),
+                            _("could not change ACPI status to: %s"),
                             (def->features[VIR_DOMAIN_FEATURE_ACPI] == VIR_TRISTATE_SWITCH_ON)
-                            ? _("Enabled") : _("Disabled"), (unsigned)rc);
+                            ? _("Enabled") : _("Disabled"));
         }
         rc = gVBoxAPI.UIBIOSSettings.SetIOAPICEnabled(bios,
                                                       def->features[VIR_DOMAIN_FEATURE_APIC] ==
                                                       VIR_TRISTATE_SWITCH_ON);
         if (NS_FAILED(rc)) {
             vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                            _("could not change APIC status to: %s, rc=%08x"),
+                            _("could not change APIC status to: %s"),
                             (def->features[VIR_DOMAIN_FEATURE_APIC] == VIR_TRISTATE_SWITCH_ON)
-                            ? _("Enabled") : _("Disabled"), (unsigned)rc);
+                            ? _("Enabled") : _("Disabled"));
         }
         VBOX_RELEASE(bios);
     }
@@ -2036,8 +2035,8 @@ vboxDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags
     /* Register the machine before attaching other devices to it */
     rc = gVBoxAPI.UIVirtualBox.RegisterMachine(data->vboxObj, machine);
     if (NS_FAILED(rc)) {
-        vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                        _("could not define a domain, rc=%08x"), (unsigned)rc);
+        vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                        _("could not define a domain"));
         goto cleanup;
     }
 
@@ -2081,7 +2080,7 @@ vboxDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags
     rc = gVBoxAPI.UIMachine.SaveSettings(machine);
     if (NS_FAILED(rc)) {
         vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                        _("Failed to save VM settings, rc=%08x"), rc);
+                        _("Failed to save VM settings"));
         machineReady = false;
     }
 
@@ -2137,8 +2136,8 @@ static int vboxDomainUndefineFlags(virDomainPtr dom, unsigned int flags)
         gVBoxAPI.deleteConfig(machine);
         ret = 0;
     } else {
-        vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                        _("could not delete the domain, rc=%08x"), (unsigned)rc);
+        vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                        _("could not delete the domain"));
     }
 
     vboxIIDUnalloc(&iid);
@@ -2317,8 +2316,8 @@ static int vboxDomainCreateWithFlags(virDomainPtr dom, unsigned int flags)
 
     rc = gVBoxAPI.UArray.vboxArrayGet(&machines, data->vboxObj, ARRAY_GET_MACHINES);
     if (NS_FAILED(rc)) {
-        vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                        _("Could not get list of machines, rc=%08x"), (unsigned)rc);
+        vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                        _("Could not get list of machines"));
         return -1;
     }
 
@@ -2417,7 +2416,7 @@ static int vboxDomainIsActive(virDomainPtr dom)
     rc = gVBoxAPI.UArray.vboxArrayGet(&machines, data->vboxObj, ARRAY_GET_MACHINES);
     if (NS_FAILED(rc)) {
         vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                        _("Could not get list of machines, rc=%08x"), (unsigned)rc);
+                        _("Could not get list of machines"));
         return ret;
     }
 
@@ -2830,8 +2829,8 @@ static int vboxDomainSetMemory(virDomainPtr dom, unsigned long memory)
             ret = 0;
         } else {
             vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                            _("could not set the memory size of the domain to: %lu Kb, rc=%08x"),
-                            memory, (unsigned)rc);
+                            _("could not set the memory size of the domain to: %lu Kb"),
+                            memory);
         }
     }
     gVBoxAPI.UISession.Close(data->vboxSession);
@@ -2857,8 +2856,8 @@ static int vboxDomainGetInfo(virDomainPtr dom, virDomainInfoPtr info)
 
     rc = gVBoxAPI.UArray.vboxArrayGet(&machines, data->vboxObj, ARRAY_GET_MACHINES);
     if (NS_FAILED(rc)) {
-        vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                        _("Could not get list of machines, rc=%08x"), (unsigned)rc);
+        vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                        _("Could not get list of machines"));
         return -1;
     }
 
@@ -2985,8 +2984,8 @@ static int vboxDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
                 ret = 0;
             } else {
                 vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                                _("could not set the number of cpus of the domain to: %u, rc=%08x"),
-                                CPUCount, (unsigned)rc);
+                                _("could not set the number of cpus of the domain to: %u"),
+                                CPUCount);
             }
             VBOX_RELEASE(machine);
         } else {
@@ -3286,8 +3285,8 @@ vboxDumpDisks(virDomainDef *def, struct _vboxDriver *data, IMachine *machine)
 
         rc = gVBoxAPI.UIMediumAttachment.GetMedium(mediumAttachment, &medium);
         if (NS_FAILED(rc)) {
-            vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                            _("Could not get IMedium, rc=%08x"), rc);
+            vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                            _("Could not get IMedium"));
             goto cleanup;
         }
 
@@ -3327,16 +3326,15 @@ vboxDumpDisks(virDomainDef *def, struct _vboxDriver *data, IMachine *machine)
         rc = gVBoxAPI.UIMediumAttachment.GetMedium(mediumAttachment, &medium);
         if (NS_FAILED(rc)) {
             vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                            _("Could not get IMedium, rc=%08x"), rc);
+                            _("Could not get IMedium"));
             goto cleanup;
         }
 
         rc = gVBoxAPI.UIMediumAttachment.GetController(mediumAttachment,
                                                        &controllerName);
         if (NS_FAILED(rc)) {
-            vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                            _("Failed to get storage controller name, rc=%08x"),
-                            rc);
+            vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                            _("Failed to get storage controller name"));
             goto cleanup;
         }
 
@@ -3344,44 +3342,41 @@ vboxDumpDisks(virDomainDef *def, struct _vboxDriver *data, IMachine *machine)
                                                            controllerName,
                                                            &controller);
         if (NS_FAILED(rc)) {
-            vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                            _("Could not get storage controller by name, rc=%08x"),
-                            rc);
+            vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                            _("Could not get storage controller by name"));
             goto cleanup;
         }
 
         rc = gVBoxAPI.UIMediumAttachment.GetType(mediumAttachment, &deviceType);
         if (NS_FAILED(rc)) {
-            vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                            _("Could not get device type, rc=%08x"), rc);
+            vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                            _("Could not get device type"));
             goto cleanup;
         }
         rc = gVBoxAPI.UIMediumAttachment.GetPort(mediumAttachment, &devicePort);
         if (NS_FAILED(rc)) {
-            vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                            _("Could not get device port, rc=%08x"), rc);
+            vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                            _("Could not get device port"));
             goto cleanup;
         }
         rc = gVBoxAPI.UIMediumAttachment.GetDevice(mediumAttachment, &deviceSlot);
         if (NS_FAILED(rc)) {
-            vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                            _("Could not get device slot, rc=%08x"), rc);
+            vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                            _("Could not get device slot"));
             goto cleanup;
         }
         rc = gVBoxAPI.UIStorageController.GetBus(controller, &storageBus);
         if (NS_FAILED(rc)) {
-            vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                            _("Could not get storage controller bus, rc=%08x"),
-                            rc);
+            vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                            _("Could not get storage controller bus"));
             goto cleanup;
         }
 
         if (medium) {
             rc = gVBoxAPI.UIMedium.GetLocation(medium, &mediumLocUtf16);
             if (NS_FAILED(rc)) {
-                vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                                _("Could not get medium storage location, rc=%08x"),
-                                rc);
+                vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                                _("Could not get medium storage location"));
                 goto cleanup;
             }
 
@@ -3391,8 +3386,8 @@ vboxDumpDisks(virDomainDef *def, struct _vboxDriver *data, IMachine *machine)
 
             rc = gVBoxAPI.UIMedium.GetReadOnly(medium, &readOnly);
             if (NS_FAILED(rc)) {
-                vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                                _("Could not get read only state, rc=%08x"), rc);
+                vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                                _("Could not get read only state"));
                 goto cleanup;
             }
         }
@@ -4218,9 +4213,8 @@ static int vboxConnectListDefinedDomains(virConnectPtr conn,
     rc = gVBoxAPI.UArray.vboxArrayGet(&machines, data->vboxObj,
                                       ARRAY_GET_MACHINES);
     if (NS_FAILED(rc)) {
-        vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                        _("Could not get list of Defined Domains, rc=%08x"),
-                        (unsigned)rc);
+        vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                        _("Could not get list of Defined Domains"));
         goto cleanup;
     }
 
@@ -4271,9 +4265,8 @@ static int vboxConnectNumOfDefinedDomains(virConnectPtr conn)
     rc = gVBoxAPI.UArray.vboxArrayGet(&machines, data->vboxObj,
                                       ARRAY_GET_MACHINES);
     if (NS_FAILED(rc)) {
-        vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                        _("Could not get number of Defined Domains, rc=%08x"),
-                        (unsigned)rc);
+        vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                        _("Could not get number of Defined Domains"));
         goto cleanup;
     }
 
@@ -4364,8 +4357,8 @@ static int vboxDomainAttachDeviceImpl(virDomainPtr dom,
 
             if (NS_FAILED(rc)) {
                 vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                                _("could not attach shared folder '%s', rc=%08x"),
-                                dev->data.fs->dst, (unsigned)rc);
+                                _("could not attach shared folder '%s'"),
+                                dev->data.fs->dst);
                 ret = -1;
             } else {
                 ret = 0;
@@ -4482,8 +4475,8 @@ static int vboxDomainDetachDevice(virDomainPtr dom, const char *xml)
 
             if (NS_FAILED(rc)) {
                 vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                                _("could not detach shared folder '%s', rc=%08x"),
-                                dev->data.fs->dst, (unsigned)rc);
+                                _("could not detach shared folder '%s'"),
+                                dev->data.fs->dst);
             } else {
                 ret = 0;
             }
@@ -4538,9 +4531,8 @@ static int vboxCloseDisksRecursively(virDomainPtr dom, char *location)
                                           AccessMode_ReadWrite,
                                           &medium);
     if (NS_FAILED(rc)) {
-        vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                        _("Unable to open HardDisk, rc=%08x"),
-                        (unsigned)rc);
+        vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                        _("Unable to open HardDisk"));
         goto cleanup;
     }
     rc = gVBoxAPI.UIMedium.GetChildren(medium, &childrenSize, &children);
@@ -4572,9 +4564,8 @@ static int vboxCloseDisksRecursively(virDomainPtr dom, char *location)
     }
     rc = gVBoxAPI.UIMedium.Close(medium);
     if (NS_FAILED(rc)) {
-        vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                        _("Unable to close HardDisk, rc=%08x"),
-                        (unsigned)rc);
+        vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                        _("Unable to close HardDisk"));
         goto cleanup;
     }
 
@@ -4738,9 +4729,8 @@ vboxSnapshotRedefine(virDomainPtr dom,
                                                   AccessMode_ReadWrite,
                                                   &readWriteMedium);
             if (NS_FAILED(rc)) {
-                vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                                _("Unable to open HardDisk, rc=%08x"),
-                                (unsigned)rc);
+                vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                                _("Unable to open HardDisk"));
                 VBOX_UTF16_FREE(locationUtf);
                 goto cleanup;
             }
@@ -4791,9 +4781,8 @@ vboxSnapshotRedefine(virDomainPtr dom,
             }
             rc = gVBoxAPI.UIMedium.Close(readWriteMedium);
             if (NS_FAILED(rc)) {
-                vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                                _("Unable to close HardDisk, rc=%08x"),
-                                (unsigned)rc);
+                vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                                _("Unable to close HardDisk"));
                 goto cleanup;
             }
         }
@@ -4845,8 +4834,7 @@ vboxSnapshotRedefine(virDomainPtr dom,
                                               &readOnlyMedium);
         if (NS_FAILED(rc)) {
             vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                            _("Unable to open HardDisk, rc=%08x"),
-                            (unsigned)rc);
+                            _("Unable to open HardDisk"));
             VBOX_UTF16_FREE(locationUtf);
             goto cleanup;
         }
@@ -4882,9 +4870,8 @@ vboxSnapshotRedefine(virDomainPtr dom,
 
         rc = gVBoxAPI.UIMedium.GetId(parentReadOnlyMedium, &parentiid);
         if (NS_FAILED(rc)) {
-            vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                            _("Unable to get hard disk id, rc=%08x"),
-                            (unsigned)rc);
+            vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                            _("Unable to get hard disk id"));
             VIR_FREE(uuid);
             goto cleanup;
         }
@@ -4893,9 +4880,8 @@ vboxSnapshotRedefine(virDomainPtr dom,
 
         rc = gVBoxAPI.UIMedium.Close(readOnlyMedium);
         if (NS_FAILED(rc)) {
-            vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                            _("Unable to close HardDisk, rc=%08x"),
-                            (unsigned)rc);
+            vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                            _("Unable to close HardDisk"));
             VIR_FREE(uuid);
             VIR_FREE(parentUuid);
             goto cleanup;
@@ -4922,9 +4908,8 @@ vboxSnapshotRedefine(virDomainPtr dom,
                                        &aMediaSize,
                                        &aMedia);
     if (NS_FAILED(rc)) {
-        vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                        _("Unable to unregister machine, rc=%08x"),
-                        (unsigned)rc);
+        vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                        _("Unable to unregister machine"));
         goto cleanup;
     }
     VBOX_RELEASE(machine);
@@ -4954,9 +4939,8 @@ vboxSnapshotRedefine(virDomainPtr dom,
                 resultCodeUnion resultCode;
                 rc = gVBoxAPI.UIMedium.DeleteStorage(medium, &progress);
                 if (NS_FAILED(rc)) {
-                    vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                                    _("Unable to delete medium, rc=%08x"),
-                                    (unsigned)rc);
+                    vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                                    _("Unable to delete medium"));
                     VIR_FREE(locationUtf8);
                     goto cleanup;
                 }
@@ -5088,9 +5072,8 @@ vboxSnapshotRedefine(virDomainPtr dom,
                                                   &medium);
             VBOX_UTF16_FREE(locationUtf16);
             if (NS_FAILED(rc)) {
-                vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                                _("Unable to open HardDisk, rc=%08x"),
-                                (unsigned)rc);
+                vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                                _("Unable to open HardDisk"));
                 goto cleanup;
             }
         }
@@ -5121,9 +5104,8 @@ vboxSnapshotRedefine(virDomainPtr dom,
                                                  AccessMode_ReadWrite,
                                                  &medium);
             if (NS_FAILED(rc)) {
-                vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                                _("Unable to open HardDisk, rc=%08x"),
-                                (unsigned)rc);
+                vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                                _("Unable to open HardDisk"));
                 goto cleanup;
             }
             VBOX_UTF16_FREE(locationUtf16);
@@ -5201,9 +5183,8 @@ vboxSnapshotRedefine(virDomainPtr dom,
             /* Close disk */
             rc = gVBoxAPI.UIMedium.Close(medium);
             if (NS_FAILED(rc)) {
-                vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                                _("Unable to close HardDisk, rc=%08x"),
-                                (unsigned)rc);
+                vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                                _("Unable to close HardDisk"));
                 goto cleanup;
             }
         }
@@ -5235,9 +5216,8 @@ vboxSnapshotRedefine(virDomainPtr dom,
                                                   AccessMode_ReadWrite,
                                                   &medium);
             if (NS_FAILED(rc)) {
-                vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                                _("Unable to open HardDisk, rc=%08x"),
-                                (unsigned)rc);
+                vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                                _("Unable to open HardDisk"));
                 VBOX_UTF16_FREE(locationUtf16);
                 goto cleanup;
             }
@@ -5245,9 +5225,8 @@ vboxSnapshotRedefine(virDomainPtr dom,
 
             rc = gVBoxAPI.UIMedium.GetId(medium, &parentiid);
             if (NS_FAILED(rc)) {
-                vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                                _("Unable to get hardDisk Id, rc=%08x"),
-                                (unsigned)rc);
+                vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                                _("Unable to get hardDisk Id"));
                 goto cleanup;
             }
             gVBoxAPI.UIID.vboxIIDToUtf8(data, &parentiid, &parentUuid);
@@ -5264,9 +5243,8 @@ vboxSnapshotRedefine(virDomainPtr dom,
             VBOX_UTF16_FREE(newLocation);
             VBOX_UTF16_FREE(formatUtf16);
             if (NS_FAILED(rc)) {
-                vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                                _("Unable to create HardDisk, rc=%08x"),
-                                (unsigned)rc);
+                vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                                _("Unable to create HardDisk"));
                 goto cleanup;
             }
 
@@ -5291,9 +5269,8 @@ vboxSnapshotRedefine(virDomainPtr dom,
 
             rc = gVBoxAPI.UIMedium.GetId(newMedium, &iid);
             if (NS_FAILED(rc)) {
-                vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                                _("Unable to get medium uuid, rc=%08x"),
-                                (unsigned)rc);
+                vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                                _("Unable to get medium uuid"));
                 goto cleanup;
             }
             gVBoxAPI.UIID.vboxIIDToUtf8(data, &iid, &uuid);
@@ -5339,9 +5316,8 @@ vboxSnapshotRedefine(virDomainPtr dom,
             /* Closing the "fake" disk */
             rc = gVBoxAPI.UIMedium.Close(newMedium);
             if (NS_FAILED(rc)) {
-                vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                                _("Unable to close the new medium, rc=%08x"),
-                                (unsigned)rc);
+                vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                                _("Unable to close the new medium"));
                 goto cleanup;
             }
         }
@@ -5388,16 +5364,14 @@ vboxSnapshotRedefine(virDomainPtr dom,
                                                   AccessMode_ReadWrite,
                                                   &medium);
             if (NS_FAILED(rc)) {
-                vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                                _("Unable to open HardDisk, rc=%08x"),
-                                (unsigned)rc);
+                vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                                _("Unable to open HardDisk"));
                 goto cleanup;
             }
             rc = gVBoxAPI.UIMedium.Close(medium);
             if (NS_FAILED(rc)) {
-                vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                                _("Unable to close HardDisk, rc=%08x"),
-                                (unsigned)rc);
+                vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                                _("Unable to close HardDisk"));
                 goto cleanup;
             }
             VBOX_UTF16_FREE(locationUtf16);
@@ -5414,17 +5388,15 @@ vboxSnapshotRedefine(virDomainPtr dom,
                                            settingsFilePath,
                                            &machine);
     if (NS_FAILED(rc)) {
-        vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                        _("Unable to open Machine, rc=%08x"),
-                        (unsigned)rc);
+        vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                        _("Unable to open Machine"));
         goto cleanup;
     }
 
     rc = gVBoxAPI.UIVirtualBox.RegisterMachine(data->vboxObj, machine);
     if (NS_FAILED(rc)) {
-        vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                        _("Unable to register Machine, rc=%08x"),
-                        (unsigned)rc);
+        vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                        _("Unable to register Machine"));
         goto cleanup;
     }
 
@@ -6972,17 +6944,15 @@ vboxDomainSnapshotDeleteMetadataOnly(virDomainSnapshotPtr snapshot)
                                                       AccessMode_ReadWrite,
                                                       &medium);
                 if (NS_FAILED(rc)) {
-                    vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                                    _("Unable to open HardDisk, rc=%08x"),
-                                    (unsigned)rc);
+                    vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                                    _("Unable to open HardDisk"));
                     goto cleanup;
                 }
 
                 rc = gVBoxAPI.UIMedium.GetId(medium, &parentiid);
                 if (NS_FAILED(rc)) {
-                    vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                                    _("Unable to get hardDisk Id, rc=%08x"),
-                                    (unsigned)rc);
+                    vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                                    _("Unable to get hardDisk Id"));
                     goto cleanup;
                 }
                 gVBoxAPI.UIID.vboxIIDToUtf8(data, &parentiid, &parentUuid);
@@ -6998,9 +6968,8 @@ vboxDomainSnapshotDeleteMetadataOnly(virDomainSnapshotPtr snapshot)
                                                           newLocation,
                                                           &newMedium);
                 if (NS_FAILED(rc)) {
-                    vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                                    _("Unable to create HardDisk, rc=%08x"),
-                                    (unsigned)rc);
+                    vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                                    _("Unable to create HardDisk"));
                     goto cleanup;
                 }
                 VBOX_UTF16_FREE(formatUtf16);
@@ -7027,9 +6996,8 @@ vboxDomainSnapshotDeleteMetadataOnly(virDomainSnapshotPtr snapshot)
 
                 rc = gVBoxAPI.UIMedium.GetId(newMedium, &iid);
                 if (NS_FAILED(rc)) {
-                    vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                                    _("Unable to get medium uuid, rc=%08x"),
-                                    (unsigned)rc);
+                    vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                                    _("Unable to get medium uuid"));
                     VIR_FREE(disk);
                     goto cleanup;
                 }
@@ -7075,9 +7043,8 @@ vboxDomainSnapshotDeleteMetadataOnly(virDomainSnapshotPtr snapshot)
                 /* Closing the "fake" disk */
                 rc = gVBoxAPI.UIMedium.Close(newMedium);
                 if (NS_FAILED(rc)) {
-                    vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                                    _("Unable to close the new medium, rc=%08x"),
-                                    (unsigned)rc);
+                    vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                                    _("Unable to close the new medium"));
                     goto cleanup;
                 }
             }
@@ -7156,9 +7123,8 @@ vboxDomainSnapshotDeleteMetadataOnly(virDomainSnapshotPtr snapshot)
                                        &aMediaSize,
                                        &aMedia);
     if (NS_FAILED(rc)) {
-        vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                        _("Unable to unregister machine, rc=%08x"),
-                        (unsigned)rc);
+        vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                        _("Unable to unregister machine"));
         goto cleanup;
     }
     VBOX_RELEASE(machine);
@@ -7178,9 +7144,8 @@ vboxDomainSnapshotDeleteMetadataOnly(virDomainSnapshotPtr snapshot)
             resultCodeUnion resultCode;
             rc = gVBoxAPI.UIMedium.DeleteStorage(medium, &progress);
             if (NS_FAILED(rc)) {
-                vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                                _("Unable to delete medium, rc=%08x"),
-                                (unsigned)rc);
+                vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                                _("Unable to delete medium"));
                 goto cleanup;
             }
             gVBoxAPI.UIProgress.WaitForCompletion(progress, -1);
@@ -7235,17 +7200,15 @@ vboxDomainSnapshotDeleteMetadataOnly(virDomainSnapshotPtr snapshot)
                                            settingsFilePathUtf16,
                                            &machine);
     if (NS_FAILED(rc)) {
-        vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                        _("Unable to open Machine, rc=%08x"),
-                        (unsigned)rc);
+        vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                        _("Unable to open Machine"));
         goto cleanup;
     }
 
     rc = gVBoxAPI.UIVirtualBox.RegisterMachine(data->vboxObj, machine);
     if (NS_FAILED(rc)) {
-        vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                        _("Unable to register Machine, rc=%08x"),
-                        (unsigned)rc);
+        vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                        _("Unable to register Machine"));
         goto cleanup;
     }
 
@@ -7522,8 +7485,8 @@ vboxConnectListAllDomains(virConnectPtr conn,
 
     rc = gVBoxAPI.UArray.vboxArrayGet(&machines, data->vboxObj, ARRAY_GET_MACHINES);
     if (NS_FAILED(rc)) {
-        vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                        _("Could not get list of domains, rc=%08x"), (unsigned)rc);
+        vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                        _("Could not get list of domains"));
         goto cleanup;
     }
 
@@ -7722,8 +7685,8 @@ vboxDomainHasManagedSaveImage(virDomainPtr dom, unsigned int flags)
     VBOX_IID_INITIALIZE(&iid);
     rc = gVBoxAPI.UArray.vboxArrayGet(&machines, data->vboxObj, ARRAY_GET_MACHINES);
     if (NS_FAILED(rc)) {
-        vboxReportError(VIR_ERR_INTERNAL_ERROR,
-                        _("Could not get list of machines, rc=%08x"), (unsigned)rc);
+        vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                        _("Could not get list of machines"));
         return ret;
     }
 
-- 
2.39.1




[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]

  Powered by Linux