vboxReportErrorHelper(data, errcode, __FILE__, \
__FUNCTION__, __LINE__, __VA_ARGS__)
-static void G_GNUC_PRINTF(6, 7) G_GNUC_UNUSED
+static void G_GNUC_PRINTF(6, 7)
vboxReportErrorHelper(struct _vboxDriver *data,
int errcode,
const char *filename,
/* Get machine for the call to VBOX_SESSION_OPEN_EXISTING */
if (NS_FAILED(gVBoxAPI.UIVirtualBox.GetMachine(data->vboxObj, iid, machine))) {
- virReportError(VIR_ERR_NO_DOMAIN, "%s",
- _("no domain with matching uuid"));
+ vboxReportError(VIR_ERR_NO_DOMAIN, "%s",
+ _("no domain with matching uuid"));
return -1;
}
case VIR_DOMAIN_CONTROLLER_TYPE_XENBUS:
case VIR_DOMAIN_CONTROLLER_TYPE_ISA:
case VIR_DOMAIN_CONTROLLER_TYPE_LAST:
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("The vbox driver does not support %s controller type"),
- virDomainControllerTypeToString(controller->type));
+ vboxReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("The vbox driver does not support %s controller type"),
+ virDomainControllerTypeToString(controller->type));
return -1;
}
case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_NCR53C90:
case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_DC390:
case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_AM53C974:
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("The vbox driver does not support %s SCSI "
- "controller model"),
- virDomainControllerModelSCSITypeToString(controller->model));
+ vboxReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("The vbox driver does not support %s SCSI "
+ "controller model"),
+ virDomainControllerModelSCSITypeToString(controller->model));
goto cleanup;
case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_DEFAULT:
case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LAST:
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unexpected SCSI controller model %d"),
- controller->model);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unexpected SCSI controller model %d"),
+ controller->model);
goto cleanup;
}
/* libvirt ide model => vbox ide model */
break;
case VIR_DOMAIN_CONTROLLER_MODEL_IDE_LAST:
case VIR_DOMAIN_CONTROLLER_MODEL_IDE_DEFAULT:
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Unexpected IDE controller model %d"),
- controller->model);
+ vboxReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Unexpected IDE controller model %d"),
+ controller->model);
goto cleanup;
}
}
vboxBusType, &vboxController);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to add storage controller "
- "(name: %s, busType: %d), rc=%08x"),
- debugName, vboxBusType, rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Failed to add storage controller "
+ "(name: %s, busType: %d), rc=%08x"),
+ debugName, vboxBusType, rc);
goto cleanup;
}
rc = gVBoxAPI.UIStorageController.SetControllerType(vboxController,
vboxModel);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to change storage controller model, "
"rc=%08x"), rc);
goto cleanup;
rc = gVBoxAPI.UArray.vboxArrayGet(&machines, data->vboxObj, ARRAY_GET_MACHINES);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Could not get list of Domains, rc=%08x"),
- (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not get list of Domains, rc=%08x"),
+ (unsigned)rc);
goto cleanup;
}
rc = gVBoxAPI.UArray.vboxArrayGet(&machines, data->vboxObj, ARRAY_GET_MACHINES);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Could not get number of Domains, rc=%08x"), (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not get number of Domains, rc=%08x"), (unsigned)rc);
goto cleanup;
}
/* Internal vbox IDs start from 0, the public libvirt ID
* starts from 1, so refuse id == 0, and adjust the rest */
if (id == 0) {
- virReportError(VIR_ERR_NO_DOMAIN,
- _("no domain with matching id %d"), id);
+ vboxReportError(VIR_ERR_NO_DOMAIN,
+ _("no domain with matching id %d"), id);
return NULL;
}
id = id - 1;
rc = gVBoxAPI.UArray.vboxArrayGet(&machines, data->vboxObj, ARRAY_GET_MACHINES);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Could not get list of machines, rc=%08x"), (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not get list of machines, rc=%08x"), (unsigned)rc);
return NULL;
}
VBOX_IID_INITIALIZE(&iid);
rc = gVBoxAPI.UArray.vboxArrayGet(&machines, data->vboxObj, ARRAY_GET_MACHINES);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Could not get list of machines, rc=%08x"), (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not get list of machines, rc=%08x"), (unsigned)rc);
return NULL;
}
VBOX_IID_INITIALIZE(&iid);
rc = gVBoxAPI.UArray.vboxArrayGet(&machines, data->vboxObj, ARRAY_GET_MACHINES);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Could not get list of machines, rc=%08x"), (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not get list of machines, rc=%08x"), (unsigned)rc);
return NULL;
}
deviceSlot = disk->info.addr.drive.bus;
if (type != VIR_STORAGE_TYPE_FILE) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Unsupported storage type %s, the only supported "
- "type is %s"),
- virStorageTypeToString(type),
- virStorageTypeToString(VIR_STORAGE_TYPE_FILE));
+ vboxReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Unsupported storage type %s, the only supported "
+ "type is %s"),
+ virStorageTypeToString(type),
+ virStorageTypeToString(VIR_STORAGE_TYPE_FILE));
ret = -1;
goto cleanup;
}
switch ((virDomainDiskDevice) disk->device) {
case VIR_DOMAIN_DISK_DEVICE_DISK:
if (!src) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("Missing disk source file path"));
+ vboxReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("Missing disk source file path"));
ret = -1;
goto cleanup;
}
break;
case VIR_DOMAIN_DISK_DEVICE_LUN:
case VIR_DOMAIN_DISK_DEVICE_LAST:
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("The vbox driver does not support %s disk device"),
- virDomainDiskDeviceTypeToString(disk->device));
+ vboxReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("The vbox driver does not support %s disk device"),
+ virDomainDiskDeviceTypeToString(disk->device));
ret = -1;
goto cleanup;
}
case VIR_DOMAIN_DISK_BUS_SD:
case VIR_DOMAIN_DISK_BUS_NONE:
case VIR_DOMAIN_DISK_BUS_LAST:
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("The vbox driver does not support %s bus type"),
- virDomainDiskBusTypeToString(disk->bus));
+ vboxReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("The vbox driver does not support %s bus type"),
+ virDomainDiskBusTypeToString(disk->bus));
ret = -1;
goto cleanup;
}
}
if (!medium) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to open the following disk/dvd/floppy "
- "to the machine: %s, rc=%08x"), src, rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Failed to open the following disk/dvd/floppy "
+ "to the machine: %s, rc=%08x"), src, rc);
ret = -1;
goto cleanup;
}
rc = gVBoxAPI.UIMedium.GetId(medium, &mediumUUID);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Can't get the UUID of the file to be attached "
- "as harddisk/dvd/floppy: %s, rc=%08x"),
- src, 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);
ret = -1;
goto cleanup;
}
medium);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Could not attach the file as "
- "harddisk/dvd/floppy: %s, rc=%08x"), src, rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not attach the file as "
+ "harddisk/dvd/floppy: %s, rc=%08x"), src, rc);
ret = -1;
goto cleanup;
} else {
VIR_DEBUG("NIC(%zu): ipaddr: %s", i, ipStr);
VIR_FREE(ipStr);
} else if (def->nets[i]->guestIP.nips > 1) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("Driver does not support setting multiple IP addresses"));
+ vboxReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("Driver does not support setting multiple IP addresses"));
return -1;
}
}
rc = gVBoxAPI.UIVirtualBox.CreateMachine(data, def, &machine, uuidstr);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("could not define a domain, rc=%08x"), (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("could not define a domain, rc=%08x"), (unsigned)rc);
goto cleanup;
}
rc = gVBoxAPI.UIMachine.SetMemorySize(machine,
VIR_DIV_UP(def->mem.cur_balloon, 1024));
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("could not set the memory size of the domain to: %llu Kb, "
- "rc=%08x"),
- def->mem.cur_balloon, (unsigned)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);
}
if (virDomainDefHasVcpusOffline(def)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("current vcpu count must equal maximum"));
+ vboxReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("current vcpu count must equal maximum"));
}
rc = gVBoxAPI.UIMachine.SetCPUCount(machine, virDomainDefGetVcpusMax(def));
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("could not set the number of virtual CPUs to: %u, rc=%08x"),
- virDomainDefGetVcpusMax(def), (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("could not set the number of virtual CPUs to: %u, rc=%08x"),
+ virDomainDefGetVcpusMax(def), (unsigned)rc);
}
rc = gVBoxAPI.UIMachine.SetCPUProperty(machine, CPUPropertyType_PAE,
def->features[VIR_DOMAIN_FEATURE_PAE] ==
VIR_TRISTATE_SWITCH_ON);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("could not change PAE status to: %s, rc=%08x"),
- (def->features[VIR_DOMAIN_FEATURE_PAE] == VIR_TRISTATE_SWITCH_ON)
- ? _("Enabled") : _("Disabled"), (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("could not change PAE status to: %s, rc=%08x"),
+ (def->features[VIR_DOMAIN_FEATURE_PAE] == VIR_TRISTATE_SWITCH_ON)
+ ? _("Enabled") : _("Disabled"), (unsigned)rc);
}
gVBoxAPI.UIMachine.GetBIOSSettings(machine, &bios);
def->features[VIR_DOMAIN_FEATURE_ACPI] ==
VIR_TRISTATE_SWITCH_ON);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("could not change ACPI status to: %s, rc=%08x"),
- (def->features[VIR_DOMAIN_FEATURE_ACPI] == VIR_TRISTATE_SWITCH_ON)
- ? _("Enabled") : _("Disabled"), (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("could not change ACPI status to: %s, rc=%08x"),
+ (def->features[VIR_DOMAIN_FEATURE_ACPI] == VIR_TRISTATE_SWITCH_ON)
+ ? _("Enabled") : _("Disabled"), (unsigned)rc);
}
rc = gVBoxAPI.UIBIOSSettings.SetIOAPICEnabled(bios,
def->features[VIR_DOMAIN_FEATURE_APIC] ==
VIR_TRISTATE_SWITCH_ON);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("could not change APIC status to: %s, rc=%08x"),
- (def->features[VIR_DOMAIN_FEATURE_APIC] == VIR_TRISTATE_SWITCH_ON)
- ? _("Enabled") : _("Disabled"), (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("could not change APIC status to: %s, rc=%08x"),
+ (def->features[VIR_DOMAIN_FEATURE_APIC] == VIR_TRISTATE_SWITCH_ON)
+ ? _("Enabled") : _("Disabled"), (unsigned)rc);
}
VBOX_RELEASE(bios);
}
/* Register the machine before attaching other devices to it */
rc = gVBoxAPI.UIVirtualBox.RegisterMachine(data->vboxObj, machine);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("could not define a domain, rc=%08x"), (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("could not define a domain, rc=%08x"), (unsigned)rc);
goto cleanup;
}
*/
rc = gVBoxAPI.UIMachine.SaveSettings(machine);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to save VM settings, rc=%08x"), rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Failed to save VM settings, rc=%08x"), rc);
machineReady = false;
}
gVBoxAPI.deleteConfig(machine);
ret = 0;
} else {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("could not delete the domain, rc=%08x"), (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("could not delete the domain, rc=%08x"), (unsigned)rc);
}
vboxIIDUnalloc(&iid);
&progress);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_OPERATION_FAILED, "%s",
- _("OpenRemoteSession/LaunchVMProcess failed, domain can't be started"));
+ vboxReportError(VIR_ERR_OPERATION_FAILED, "%s",
+ _("OpenRemoteSession/LaunchVMProcess failed, domain can't be started"));
goto cleanup;
} else {
PRBool completed = 0;
virCheckFlags(0, -1);
if (!dom->name) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Error while reading the domain name"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Error while reading the domain name"));
return -1;
}
rc = gVBoxAPI.UArray.vboxArrayGet(&machines, data->vboxObj, ARRAY_GET_MACHINES);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Could not get list of machines, rc=%08x"), (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not get list of machines, rc=%08x"), (unsigned)rc);
return -1;
}
if (gVBoxAPI.machineStateChecker.NotStart(state)) {
ret = vboxStartMachine(dom, i, machine);
} else {
- virReportError(VIR_ERR_OPERATION_FAILED, "%s",
- _("machine is not in "
- "poweroff|saved|aborted state, so "
- "couldn't start it"));
+ vboxReportError(VIR_ERR_OPERATION_FAILED, "%s",
+ _("machine is not in "
+ "poweroff|saved|aborted state, so "
+ "couldn't start it"));
ret = -1;
}
}
VBOX_IID_INITIALIZE(&iid);
rc = gVBoxAPI.UArray.vboxArrayGet(&machines, data->vboxObj, ARRAY_GET_MACHINES);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Could not get list of machines, rc=%08x"), (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not get list of machines, rc=%08x"), (unsigned)rc);
return ret;
}
VBOX_RELEASE(console);
ret = 0;
} else {
- virReportError(VIR_ERR_OPERATION_FAILED, "%s",
- _("error while suspending the domain"));
+ vboxReportError(VIR_ERR_OPERATION_FAILED, "%s",
+ _("error while suspending the domain"));
goto cleanup;
}
gVBoxAPI.UISession.Close(data->vboxSession);
} else {
- virReportError(VIR_ERR_OPERATION_FAILED, "%s",
- _("machine not in running state to suspend it"));
+ vboxReportError(VIR_ERR_OPERATION_FAILED, "%s",
+ _("machine not in running state to suspend it"));
goto cleanup;
}
VBOX_RELEASE(console);
ret = 0;
} else {
- virReportError(VIR_ERR_OPERATION_FAILED, "%s",
- _("error while resuming the domain"));
+ vboxReportError(VIR_ERR_OPERATION_FAILED, "%s",
+ _("error while resuming the domain"));
goto cleanup;
}
gVBoxAPI.UISession.Close(data->vboxSession);
} else {
- virReportError(VIR_ERR_OPERATION_FAILED, "%s",
- _("machine not paused, so can't resume it"));
+ vboxReportError(VIR_ERR_OPERATION_FAILED, "%s",
+ _("machine not paused, so can't resume it"));
goto cleanup;
}
gVBoxAPI.UIMachine.GetState(machine, &state);
if (gVBoxAPI.machineStateChecker.Paused(state)) {
- virReportError(VIR_ERR_OPERATION_FAILED, "%s",
- _("machine paused, so can't power it down"));
+ vboxReportError(VIR_ERR_OPERATION_FAILED, "%s",
+ _("machine paused, so can't power it down"));
goto cleanup;
} else if (gVBoxAPI.machineStateChecker.PoweredOff(state)) {
- virReportError(VIR_ERR_OPERATION_FAILED, "%s",
- _("machine already powered down"));
+ vboxReportError(VIR_ERR_OPERATION_FAILED, "%s",
+ _("machine already powered down"));
goto cleanup;
}
}
gVBoxAPI.UISession.Close(data->vboxSession);
} else {
- virReportError(VIR_ERR_OPERATION_FAILED, "%s",
- _("machine not running, so can't reboot it"));
+ vboxReportError(VIR_ERR_OPERATION_FAILED, "%s",
+ _("machine not running, so can't reboot it"));
goto cleanup;
}
gVBoxAPI.UIMachine.GetState(machine, &state);
if (gVBoxAPI.machineStateChecker.PoweredOff(state)) {
- virReportError(VIR_ERR_OPERATION_FAILED, "%s",
- _("machine already powered down"));
+ vboxReportError(VIR_ERR_OPERATION_FAILED, "%s",
+ _("machine already powered down"));
goto cleanup;
}
gVBoxAPI.UIMachine.GetState(machine, &state);
if (!gVBoxAPI.machineStateChecker.PoweredOff(state)) {
- virReportError(VIR_ERR_OPERATION_FAILED, "%s",
- _("memory size can't be changed unless domain is powered down"));
+ vboxReportError(VIR_ERR_OPERATION_FAILED, "%s",
+ _("memory size can't be changed unless domain is powered down"));
goto cleanup;
}
gVBoxAPI.UIMachine.SaveSettings(machine);
ret = 0;
} else {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("could not set the memory size of the "
- "domain to: %lu Kb, rc=%08x"),
- memory, (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("could not set the memory size of the "
+ "domain to: %lu Kb, rc=%08x"),
+ memory, (unsigned)rc);
}
}
gVBoxAPI.UISession.Close(data->vboxSession);
rc = gVBoxAPI.UArray.vboxArrayGet(&machines, data->vboxObj, ARRAY_GET_MACHINES);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Could not get list of machines, rc=%08x"), (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not get list of machines, rc=%08x"), (unsigned)rc);
return -1;
}
return ret;
if (flags != VIR_DOMAIN_AFFECT_LIVE) {
- virReportError(VIR_ERR_INVALID_ARG, _("unsupported flags: (0x%x)"), flags);
+ vboxReportError(VIR_ERR_INVALID_ARG, _("unsupported flags: (0x%x)"), flags);
return -1;
}
gVBoxAPI.UIMachine.SaveSettings(machine);
ret = 0;
} else {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("could not set the number of cpus of the domain "
- "to: %u, rc=%08x"),
- CPUCount, (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("could not set the number of cpus of the domain "
+ "to: %u, rc=%08x"),
+ CPUCount, (unsigned)rc);
}
VBOX_RELEASE(machine);
} else {
- virReportError(VIR_ERR_NO_DOMAIN,
- _("no domain with matching id %d"), dom->id);
+ vboxReportError(VIR_ERR_NO_DOMAIN,
+ _("no domain with matching id %d"), dom->id);
}
} else {
- virReportError(VIR_ERR_NO_DOMAIN,
- _("can't open session to the domain with id %d"), dom->id);
+ vboxReportError(VIR_ERR_NO_DOMAIN,
+ _("can't open session to the domain with id %d"), dom->id);
}
gVBoxAPI.UISession.Close(data->vboxSession);
return ret;
if (flags != (VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_VCPU_MAXIMUM)) {
- virReportError(VIR_ERR_INVALID_ARG, _("unsupported flags: (0x%x)"), flags);
+ vboxReportError(VIR_ERR_INVALID_ARG, _("unsupported flags: (0x%x)"), flags);
return -1;
}
rc = gVBoxAPI.UIMediumAttachment.GetMedium(mediumAttachment, &medium);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Could not get IMedium, rc=%08x"), rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not get IMedium, rc=%08x"), rc);
goto cleanup;
}
rc = gVBoxAPI.UIMediumAttachment.GetMedium(mediumAttachment, &medium);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Could not get IMedium, rc=%08x"), rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not get IMedium, rc=%08x"), rc);
goto cleanup;
}
rc = gVBoxAPI.UIMediumAttachment.GetController(mediumAttachment,
&controllerName);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to get storage controller name, rc=%08x"),
- rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Failed to get storage controller name, rc=%08x"),
+ rc);
goto cleanup;
}
controllerName,
&controller);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Could not get storage controller by name, rc=%08x"),
- rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not get storage controller by name, rc=%08x"),
+ rc);
goto cleanup;
}
rc = gVBoxAPI.UIMediumAttachment.GetType(mediumAttachment, &deviceType);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Could not get device type, rc=%08x"), rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not get device type, rc=%08x"), rc);
goto cleanup;
}
rc = gVBoxAPI.UIMediumAttachment.GetPort(mediumAttachment, &devicePort);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Could not get device port, rc=%08x"), rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not get device port, rc=%08x"), rc);
goto cleanup;
}
rc = gVBoxAPI.UIMediumAttachment.GetDevice(mediumAttachment, &deviceSlot);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Could not get device slot, rc=%08x"), rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not get device slot, rc=%08x"), rc);
goto cleanup;
}
rc = gVBoxAPI.UIStorageController.GetBus(controller, &storageBus);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Could not get storage controller bus, rc=%08x"),
- rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not get storage controller bus, rc=%08x"),
+ rc);
goto cleanup;
}
if (medium) {
rc = gVBoxAPI.UIMedium.GetLocation(medium, &mediumLocUtf16);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Could not get medium storage location, rc=%08x"),
- rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not get medium storage location, rc=%08x"),
+ rc);
goto cleanup;
}
rc = gVBoxAPI.UIMedium.GetReadOnly(medium, &readOnly);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Could not get read only state, rc=%08x"), rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not get read only state, rc=%08x"), rc);
goto cleanup;
}
}
sdCount);
if (!disk->dst) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Could not generate medium name for the disk "
- "at: port:%d, slot:%d"), devicePort, deviceSlot);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not generate medium name for the disk "
+ "at: port:%d, slot:%d"), devicePort, deviceSlot);
goto cleanup;
}
break;
case StorageBus_Null:
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Unsupported null storage bus"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unsupported null storage bus"));
goto cleanup;
}
case DeviceType_USB:
case DeviceType_SharedFolder:
case DeviceType_Null:
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unsupported vbox device type: %d"), deviceType);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unsupported vbox device type: %d"), deviceType);
goto cleanup;
}
rc = gVBoxAPI.UArray.vboxArrayGet(&machines, data->vboxObj,
ARRAY_GET_MACHINES);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Could not get list of Defined Domains, rc=%08x"),
- (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not get list of Defined Domains, rc=%08x"),
+ (unsigned)rc);
goto cleanup;
}
rc = gVBoxAPI.UArray.vboxArrayGet(&machines, data->vboxObj,
ARRAY_GET_MACHINES);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Could not get number of Defined Domains, rc=%08x"),
- (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not get number of Defined Domains, rc=%08x"),
+ (unsigned)rc);
goto cleanup;
}
writable, PR_FALSE);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("could not attach shared folder '%s', rc=%08x"),
- dev->data.fs->dst, (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("could not attach shared folder '%s', rc=%08x"),
+ dev->data.fs->dst, (unsigned)rc);
ret = -1;
} else {
ret = 0;
VBOX_RELEASE(machine);
if (ret == -VIR_ERR_ARGUMENT_UNSUPPORTED) {
- virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, _("Unsupported device type %d"), dev->type);
+ vboxReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, _("Unsupported device type %d"), dev->type);
ret = -1;
}
}
rc = gVBoxAPI.UIMachine.RemoveSharedFolder(machine, nameUtf16);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("could not detach shared folder '%s', rc=%08x"),
- dev->data.fs->dst, (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("could not detach shared folder '%s', rc=%08x"),
+ dev->data.fs->dst, (unsigned)rc);
} else {
ret = 0;
}
VBOX_RELEASE(machine);
if (ret == -VIR_ERR_ARGUMENT_UNSUPPORTED) {
- virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, _("Unsupported device type %d"), dev->type);
+ vboxReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, _("Unsupported device type %d"), dev->type);
ret = -1;
}
}
AccessMode_ReadWrite,
&medium);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to open HardDisk, rc=%08x"),
- (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to open HardDisk, rc=%08x"),
+ (unsigned)rc);
goto cleanup;
}
rc = gVBoxAPI.UIMedium.GetChildren(medium, &childrenSize, &children);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Unable to get disk children"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to get disk children"));
goto cleanup;
}
for (i = 0; i < childrenSize; i++) {
char *childLocation = NULL;
rc = gVBoxAPI.UIMedium.GetLocation(childMedium, &childLocationUtf);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Unable to get childMedium location"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to get childMedium location"));
goto cleanup;
}
VBOX_UTF16_TO_UTF8(childLocationUtf, &childLocation);
VBOX_UTF16_FREE(childLocationUtf);
if (vboxCloseDisksRecursively(dom, childLocation) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Unable to close disk children"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to close disk children"));
goto cleanup;
}
VIR_FREE(childLocation);
}
rc = gVBoxAPI.UIMedium.Close(medium);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to close HardDisk, rc=%08x"),
- (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to close HardDisk, rc=%08x"),
+ (unsigned)rc);
goto cleanup;
}
/* It may failed when the machine is not mutable. */
rc = gVBoxAPI.UIMachine.GetSettingsFilePath(machine, &settingsFilePath);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("cannot get settings file path"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("cannot get settings file path"));
goto cleanup;
}
VBOX_UTF16_TO_UTF8(settingsFilePath, &settingsFilePath_Utf8);
/* Getting the machine name to retrieve the machine location path. */
rc = gVBoxAPI.UIMachine.GetName(machine, &machineNameUtf16);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("cannot get machine name"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("cannot get machine name"));
goto cleanup;
}
VBOX_UTF16_TO_UTF8(machineNameUtf16, &machineName);
nameTmpUse = g_strdup_printf("%s.vbox", machineName);
machineLocationPath = virStringReplace(settingsFilePath_Utf8, nameTmpUse, "");
if (machineLocationPath == NULL) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Unable to get the machine location path"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to get the machine location path"));
goto cleanup;
}
/* We create the xml struct with the settings file path. */
snapshotMachineDesc = virVBoxSnapshotConfLoadVboxFile(settingsFilePath_Utf8, machineLocationPath);
if (snapshotMachineDesc == NULL) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("cannot create a vboxSnapshotXmlPtr"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("cannot create a vboxSnapshotXmlPtr"));
goto cleanup;
}
if (snapshotMachineDesc->currentSnapshot != NULL) {
* the machine unregistration.
*/
if (virVBoxSnapshotConfRemoveFakeDisks(snapshotMachineDesc) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Unable to remove Fake Disks"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to remove Fake Disks"));
goto cleanup;
}
realReadWriteDisksPathSize = virVBoxSnapshotConfGetRWDisksPathsFromLibvirtXML(currentSnapshotXmlFilePath,
/* The read-only disk number is necessarily greater or equal to the
* read-write disk number */
if (realReadOnlyDisksPathSize < realReadWriteDisksPathSize) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("The read only disk number must be greater or equal to the "
- " read write disk number"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("The read only disk number must be greater or equal to the "
+ " read write disk number"));
goto cleanup;
}
for (it = 0; it < realReadWriteDisksPathSize; it++) {
AccessMode_ReadWrite,
&readWriteMedium);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to open HardDisk, rc=%08x"),
- (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to open HardDisk, rc=%08x"),
+ (unsigned)rc);
VBOX_UTF16_FREE(locationUtf);
goto cleanup;
}
rc = gVBoxAPI.UIMedium.GetId(readWriteMedium, &iid);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Unable to get the read write medium id"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to get the read write medium id"));
goto cleanup;
}
gVBoxAPI.UIID.vboxIIDToUtf8(data, &iid, &uuid);
rc = gVBoxAPI.UIMedium.GetFormat(readWriteMedium, &formatUtf);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Unable to get the read write medium format"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to get the read write medium format"));
goto cleanup;
}
VBOX_UTF16_TO_UTF8(formatUtf, &format);
if (virVBoxSnapshotConfAddHardDiskToMediaRegistry(readWriteDisk,
snapshotMachineDesc->mediaRegistry,
parentUuid) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Unable to add hard disk to media Registry"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to add hard disk to media Registry"));
VIR_FREE(readWriteDisk);
goto cleanup;
}
rc = gVBoxAPI.UIMedium.Close(readWriteMedium);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to close HardDisk, rc=%08x"),
- (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to close HardDisk, rc=%08x"),
+ (unsigned)rc);
goto cleanup;
}
}
diskInMediaRegistry = virVBoxSnapshotConfDiskIsInMediaRegistry(snapshotMachineDesc,
def->parent.dom->disks[it]->src->path);
if (diskInMediaRegistry == -1) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Unable to know if disk is in media registry"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to know if disk is in media registry"));
goto cleanup;
}
if (diskInMediaRegistry == 1) /* Nothing to do. */
AccessMode_ReadWrite,
&readOnlyMedium);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to open HardDisk, rc=%08x"),
- (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to open HardDisk, rc=%08x"),
+ (unsigned)rc);
VBOX_UTF16_FREE(locationUtf);
goto cleanup;
}
rc = gVBoxAPI.UIMedium.GetId(readOnlyMedium, &iid);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Unable to get hard disk id"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to get hard disk id"));
goto cleanup;
}
gVBoxAPI.UIID.vboxIIDToUtf8(data, &iid, &uuid);
rc = gVBoxAPI.UIMedium.GetFormat(readOnlyMedium, &formatUtf);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Unable to get hard disk format"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to get hard disk format"));
VIR_FREE(uuid);
goto cleanup;
}
/* This disk is already in the media registry */
rc = gVBoxAPI.UIMedium.GetParent(readOnlyMedium, &parentReadOnlyMedium);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Unable to get parent hard disk"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to get parent hard disk"));
VIR_FREE(uuid);
goto cleanup;
}
rc = gVBoxAPI.UIMedium.GetId(parentReadOnlyMedium, &parentiid);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to get hard disk id, rc=%08x"),
- (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to get hard disk id, rc=%08x"),
+ (unsigned)rc);
VIR_FREE(uuid);
goto cleanup;
}
rc = gVBoxAPI.UIMedium.Close(readOnlyMedium);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to close HardDisk, rc=%08x"),
- (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to close HardDisk, rc=%08x"),
+ (unsigned)rc);
VIR_FREE(uuid);
VIR_FREE(parentUuid);
goto cleanup;
readOnlyDisk->location = g_strdup(def->parent.dom->disks[it]->src->path);
if (virVBoxSnapshotConfAddHardDiskToMediaRegistry(readOnlyDisk, snapshotMachineDesc->mediaRegistry,
- parentUuid) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Unable to add hard disk to media registry"));
+ parentUuid) < 0) {
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to add hard disk to media registry"));
VIR_FREE(readOnlyDisk);
goto cleanup;
}
&aMediaSize,
&aMedia);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to unregister machine, rc=%08x"),
- (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to unregister machine, rc=%08x"),
+ (unsigned)rc);
goto cleanup;
}
VBOX_RELEASE(machine);
char *locationUtf8 = NULL;
rc = gVBoxAPI.UIMedium.GetLocation(medium, &locationUtf16);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Unable to get medium location"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to get medium location"));
goto cleanup;
}
VBOX_UTF16_TO_UTF8(locationUtf16, &locationUtf8);
resultCodeUnion resultCode;
rc = gVBoxAPI.UIMedium.DeleteStorage(medium, &progress);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to delete medium, rc=%08x"),
- (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to delete medium, rc=%08x"),
+ (unsigned)rc);
VIR_FREE(locationUtf8);
goto cleanup;
}
gVBoxAPI.UIProgress.WaitForCompletion(progress, -1);
gVBoxAPI.UIProgress.GetResultCode(progress, &resultCode);
if (RC_FAILED(resultCode)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Error while closing medium, rc=%08x"),
- resultCode.uResultCode);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Error while closing medium, rc=%08x"),
+ resultCode.uResultCode);
VIR_FREE(locationUtf8);
goto cleanup;
}
/* Close all disks that failed to close normally. */
for (it = 0; it < snapshotMachineDesc->mediaRegistry->ndisks; it++) {
if (vboxCloseDisksRecursively(dom, snapshotMachineDesc->mediaRegistry->disks[it]->location) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Unable to close recursively all disks"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to close recursively all disks"));
goto cleanup;
}
}
VIR_FREE(tmp);
}
if (virVBoxSnapshotConfAddSnapshotToXmlMachine(newSnapshotPtr, snapshotMachineDesc, def->parent.parent_name) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Unable to add the snapshot to the machine description"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to add the snapshot to the machine description"));
goto cleanup;
}
/*
&medium);
VBOX_UTF16_FREE(locationUtf16);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to open HardDisk, rc=%08x"),
- (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to open HardDisk, rc=%08x"),
+ (unsigned)rc);
goto cleanup;
}
}
AccessMode_ReadWrite,
&medium);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to open HardDisk, rc=%08x"),
- (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to open HardDisk, rc=%08x"),
+ (unsigned)rc);
goto cleanup;
}
VBOX_UTF16_FREE(locationUtf16);
rc = gVBoxAPI.UIMedium.GetFormat(medium, &formatUtf16);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Unable to get disk format"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to get disk format"));
VIR_FREE(disk);
goto cleanup;
}
rc = gVBoxAPI.UIMedium.GetId(medium, &iid);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Unable to get disk uuid"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to get disk uuid"));
VIR_FREE(disk);
goto cleanup;
}
rc = gVBoxAPI.UIMedium.GetParent(medium, &parentDisk);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Unable to get disk parent"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to get disk parent"));
VIR_FREE(disk);
goto cleanup;
}
if (virVBoxSnapshotConfAddHardDiskToMediaRegistry(disk,
snapshotMachineDesc->mediaRegistry,
parentUuid) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Unable to add hard disk to the media registry"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to add hard disk to the media registry"));
VIR_FREE(disk);
goto cleanup;
}
it + 1,
&searchResultTab);
if (resultSize != it + 1) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to find UUID %s"), searchResultTab[it]);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to find UUID %s"), searchResultTab[it]);
goto cleanup;
}
/* Close disk */
rc = gVBoxAPI.UIMedium.Close(medium);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to close HardDisk, rc=%08x"),
- (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to close HardDisk, rc=%08x"),
+ (unsigned)rc);
goto cleanup;
}
}
AccessMode_ReadWrite,
&medium);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to open HardDisk, rc=%08x"),
- (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to open HardDisk, rc=%08x"),
+ (unsigned)rc);
VBOX_UTF16_FREE(locationUtf16);
goto cleanup;
}
rc = gVBoxAPI.UIMedium.GetId(medium, &parentiid);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to get hardDisk Id, rc=%08x"),
- (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to get hardDisk Id, rc=%08x"),
+ (unsigned)rc);
goto cleanup;
}
gVBoxAPI.UIID.vboxIIDToUtf8(data, &parentiid, &parentUuid);
VBOX_UTF16_FREE(newLocation);
VBOX_UTF16_FREE(formatUtf16);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to create HardDisk, rc=%08x"),
- (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to create HardDisk, rc=%08x"),
+ (unsigned)rc);
goto cleanup;
}
gVBoxAPI.UIProgress.WaitForCompletion(progress, -1);
gVBoxAPI.UIProgress.GetResultCode(progress, &resultCode);
if (RC_FAILED(resultCode)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Error while creating diff storage, rc=%08x"),
- resultCode.uResultCode);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Error while creating diff storage, rc=%08x"),
+ resultCode.uResultCode);
goto cleanup;
}
VBOX_RELEASE(progress);
rc = gVBoxAPI.UIMedium.GetId(newMedium, &iid);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to get medium uuid, rc=%08x"),
- (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to get medium uuid, rc=%08x"),
+ (unsigned)rc);
goto cleanup;
}
gVBoxAPI.UIID.vboxIIDToUtf8(data, &iid, &uuid);
if (virVBoxSnapshotConfAddHardDiskToMediaRegistry(newHardDisk,
snapshotMachineDesc->mediaRegistry,
parentUuid) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Unable to add hard disk to the media registry"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to add hard disk to the media registry"));
goto cleanup;
}
newHardDisk = NULL; /* Consumed by above */
it + 1,
&searchResultTab);
if (resultSize != it + 1) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to find UUID %s"), searchResultTab[it]);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to find UUID %s"), searchResultTab[it]);
goto cleanup;
}
/* Closing the "fake" disk */
rc = gVBoxAPI.UIMedium.Close(newMedium);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to close the new medium, rc=%08x"),
- (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to close the new medium, rc=%08x"),
+ (unsigned)rc);
goto cleanup;
}
}
data->xmlopt,
VIR_DOMAIN_SNAPSHOT_FORMAT_SECURE);
if (snapshotContent == NULL) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Unable to get snapshot content"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to get snapshot content"));
goto cleanup;
}
if (virFileWriteStr(currentSnapshotXmlFilePath, snapshotContent, 0644) < 0) {
AccessMode_ReadWrite,
&medium);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to open HardDisk, rc=%08x"),
- (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to open HardDisk, rc=%08x"),
+ (unsigned)rc);
goto cleanup;
}
rc = gVBoxAPI.UIMedium.Close(medium);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to close HardDisk, rc=%08x"),
- (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to close HardDisk, rc=%08x"),
+ (unsigned)rc);
goto cleanup;
}
VBOX_UTF16_FREE(locationUtf16);
/* Now, we rewrite the 'machineName'.vbox file to redefine the machine. */
if (virVBoxSnapshotConfSaveVboxFile(snapshotMachineDesc, settingsFilePath_Utf8) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Unable to serialize the machine description"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to serialize the machine description"));
goto cleanup;
}
rc = gVBoxAPI.UIVirtualBox.OpenMachine(data->vboxObj,
settingsFilePath,
&machine);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to open Machine, rc=%08x"),
- (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to open Machine, rc=%08x"),
+ (unsigned)rc);
goto cleanup;
}
rc = gVBoxAPI.UIVirtualBox.RegisterMachine(data->vboxObj, machine);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to register Machine, rc=%08x"),
- (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to register Machine, rc=%08x"),
+ (unsigned)rc);
goto cleanup;
}
rc = gVBoxAPI.UIMachine.GetState(machine, &state);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("could not get domain state"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("could not get domain state"));
goto cleanup;
}
if (NS_SUCCEEDED(rc))
rc = gVBoxAPI.UISession.GetConsole(data->vboxSession, &console);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("could not open VirtualBox session with domain %s"),
- dom->name);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("could not open VirtualBox session with domain %s"),
+ dom->name);
goto cleanup;
}
rc = gVBoxAPI.UIConsole.TakeSnapshot(console, name, description, &progress);
if (NS_FAILED(rc) || !progress) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("could not take snapshot of domain %s"), dom->name);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("could not take snapshot of domain %s"), dom->name);
goto cleanup;
}
gVBoxAPI.UIProgress.WaitForCompletion(progress, -1);
gVBoxAPI.UIProgress.GetResultCode(progress, &result);
if (RC_FAILED(result)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("could not take snapshot of domain %s"), dom->name);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("could not take snapshot of domain %s"), dom->name);
goto cleanup;
}
rc = gVBoxAPI.UIMachine.GetCurrentSnapshot(machine, &snapshot);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("could not get current snapshot of domain %s"),
- dom->name);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("could not get current snapshot of domain %s"),
+ dom->name);
goto cleanup;
}
IMachine *machine,
ISnapshot ***snapshots)
{
+ struct _vboxDriver *data = dom->conn->privateData;
vboxIID empty;
ISnapshot **list = NULL;
PRUint32 count;
VBOX_IID_INITIALIZE(&empty);
rc = gVBoxAPI.UIMachine.GetSnapshotCount(machine, &count);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("could not get snapshot count for domain %s"),
- dom->name);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("could not get snapshot count for domain %s"),
+ dom->name);
goto error;
}
rc = gVBoxAPI.UIMachine.FindSnapshot(machine, &empty, list);
if (NS_FAILED(rc) || !list[0]) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("could not get root snapshot for domain %s"),
- dom->name);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("could not get root snapshot for domain %s"),
+ dom->name);
goto error;
}
size_t i;
if (!list[next]) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("unexpected number of snapshots < %u"), count);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("unexpected number of snapshots < %u"), count);
goto error;
}
rc = gVBoxAPI.UArray.vboxArrayGet(&children, list[next],
gVBoxAPI.UArray.handleSnapshotGetChildren(list[next]));
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("could not get children snapshots"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("could not get children snapshots"));
goto error;
}
for (i = 0; i < children.count; i++) {
if (!child)
continue;
if (top == count) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("unexpected number of snapshots > %u"), count);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("unexpected number of snapshots > %u"), count);
gVBoxAPI.UArray.vboxArrayRelease(&children);
goto error;
}
rc = gVBoxAPI.UISnapshot.GetName(snapshots[i], &nameUtf16);
if (NS_FAILED(rc) || !nameUtf16) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("could not get snapshot name"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("could not get snapshot name"));
goto cleanup;
}
VBOX_UTF16_TO_UTF8(nameUtf16, &nameUtf8);
}
if (!snapshot) {
- virReportError(VIR_ERR_OPERATION_INVALID,
- _("domain %s has no snapshots with name %s"),
- dom->name, name);
+ vboxReportError(VIR_ERR_OPERATION_INVALID,
+ _("domain %s has no snapshots with name %s"),
+ dom->name, name);
goto cleanup;
}
rc = gVBoxAPI.UISnapshot.GetId(snap, &snapIid);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Could not get snapshot id"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Could not get snapshot id"));
goto cleanup;
}
vboxIIDUnalloc(&snapIid);
rc = gVBoxAPI.UISnapshot.GetMachine(snap, &snapMachine);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("could not get machine"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("could not get machine"));
goto cleanup;
}
def->ndisks = 0;
rc = gVBoxAPI.UArray.vboxArrayGet(&mediumAttachments, snapMachine,
gVBoxAPI.UArray.handleMachineGetMediumAttachments(snapMachine));
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("no medium attachments"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("no medium attachments"));
goto cleanup;
}
/* get the number of attachments */
rc = gVBoxAPI.UIMediumAttachment.GetMedium(imediumattach, &medium);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("cannot get medium"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("cannot get medium"));
goto cleanup;
}
if (medium) {
rc = gVBoxAPI.UIMediumAttachment.GetController(imediumattach,
&storageControllerName);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Cannot get storage controller name"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Cannot get storage controller name"));
goto cleanup;
}
&storageController);
VBOX_UTF16_FREE(storageControllerName);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Cannot get storage controller by name"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Cannot get storage controller by name"));
goto cleanup;
}
rc = gVBoxAPI.UIStorageController.GetBus(storageController, &storageBus);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Cannot get storage controller bus"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Cannot get storage controller bus"));
VBOX_RELEASE(storageController);
goto cleanup;
}
rc = gVBoxAPI.UIMediumAttachment.GetType(imediumattach, &deviceType);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Cannot get medium attachment type"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Cannot get medium attachment type"));
VBOX_RELEASE(storageController);
goto cleanup;
}
rc = gVBoxAPI.UIMediumAttachment.GetPort(imediumattach, &devicePort);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Cannot get medium attachment port"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Cannot get medium attachment port"));
VBOX_RELEASE(storageController);
goto cleanup;
}
rc = gVBoxAPI.UIMediumAttachment.GetDevice(imediumattach, &deviceSlot);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Cannot get medium attachment slot"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Cannot get medium attachment slot"));
VBOX_RELEASE(storageController);
goto cleanup;
}
rc = gVBoxAPI.UIMediumAttachment.GetMedium(imediumattach, &disk);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Cannot get medium"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Cannot get medium"));
VBOX_RELEASE(storageController);
goto cleanup;
}
handle = gVBoxAPI.UArray.handleMediumGetChildren(disk);
rc = gVBoxAPI.UArray.vboxArrayGet(&children, disk, handle);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("cannot get children disk"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("cannot get children disk"));
goto cleanup;
}
handle = gVBoxAPI.UArray.handleMediumGetSnapshotIds(disk);
rc = gVBoxAPI.UArray.vboxArrayGetWithIIDArg(&snapshotIids, disk,
handle, &domiid);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("cannot get snapshot ids"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("cannot get snapshot ids"));
goto cleanup;
}
for (j = 0; j < children.count; ++j) {
if (STREQ(diskSnapIdStr, snapshotUuidStr)) {
rc = gVBoxAPI.UIMedium.GetLocation(child, &childLocUtf16);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("cannot get disk location"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("cannot get disk location"));
VBOX_RELEASE(storageController);
VBOX_RELEASE(disk);
VBOX_RELEASE(child);
rc = gVBoxAPI.UISnapshot.GetMachine(snap, &snapMachine);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("cannot get machine"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("cannot get machine"));
goto cleanup;
}
/*
rc = gVBoxAPI.UArray.vboxArrayGet(&mediumAttachments, snapMachine,
gVBoxAPI.UArray.handleMachineGetMediumAttachments(snapMachine));
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("cannot get medium attachments"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("cannot get medium attachments"));
goto cleanup;
}
/* get the number of attachments */
rc = gVBoxAPI.UIMediumAttachment.GetMedium(imediumattach, &medium);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("cannot get medium"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("cannot get medium"));
goto cleanup;
}
if (medium) {
continue;
rc = gVBoxAPI.UIMediumAttachment.GetController(imediumattach, &storageControllerName);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Cannot get storage controller name"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Cannot get storage controller name"));
goto cleanup;
}
if (!storageControllerName)
&storageController);
VBOX_UTF16_FREE(storageControllerName);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Cannot get storage controller"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Cannot get storage controller"));
goto cleanup;
}
if (!storageController)
continue;
rc = gVBoxAPI.UIStorageController.GetBus(storageController, &storageBus);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Cannot get storage controller bus"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Cannot get storage controller bus"));
goto cleanup;
}
rc = gVBoxAPI.UIMediumAttachment.GetPort(imediumattach, &devicePort);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Cannot get medium attachment port"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Cannot get medium attachment port"));
goto cleanup;
}
rc = gVBoxAPI.UIMediumAttachment.GetDevice(imediumattach, &deviceSlot);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Cannot get device slot"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Cannot get device slot"));
goto cleanup;
}
rc = gVBoxAPI.UIMediumAttachment.GetMedium(imediumattach, &disk);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Cannot get medium"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Cannot get medium"));
goto cleanup;
}
rc = gVBoxAPI.UIMedium.GetLocation(disk, &mediumLocUtf16);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Cannot get disk location"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Cannot get disk location"));
goto cleanup;
}
VBOX_UTF16_TO_UTF8(mediumLocUtf16, &mediumLocUtf8);
VBOX_UTF8_FREE(mediumLocUtf8);
rc = gVBoxAPI.UIMedium.GetReadOnly(disk, &readOnly);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Cannot get read only attribute"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Cannot get read only attribute"));
goto cleanup;
}
deviceSlot,
sdCount);
if (!defdom->disks[diskCount]->dst) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Could not generate medium name for the disk "
- "at: port:%d, slot:%d"), devicePort, deviceSlot);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not generate medium name for the disk "
+ "at: port:%d, slot:%d"), devicePort, deviceSlot);
ret = -1;
goto cleanup;
}
rc = gVBoxAPI.UIMediumAttachment.GetType(imediumattach, &deviceType);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("cannot get medium attachment type"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("cannot get medium attachment type"));
goto cleanup;
}
if (deviceType == DeviceType_HardDisk)
rc = gVBoxAPI.UISnapshot.GetDescription(snap, &str16);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("could not get description of snapshot %s"),
- snapshot->name);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("could not get description of snapshot %s"),
+ snapshot->name);
goto cleanup;
}
if (str16) {
rc = gVBoxAPI.UISnapshot.GetTimeStamp(snap, ×tamp);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("could not get creation time of snapshot %s"),
- snapshot->name);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("could not get creation time of snapshot %s"),
+ snapshot->name);
goto cleanup;
}
/* timestamp is in milliseconds while creationTime in seconds */
rc = gVBoxAPI.UISnapshot.GetParent(snap, &parent);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("could not get parent of snapshot %s"),
- snapshot->name);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("could not get parent of snapshot %s"),
+ snapshot->name);
goto cleanup;
}
if (parent) {
rc = gVBoxAPI.UISnapshot.GetName(parent, &str16);
if (NS_FAILED(rc) || !str16) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("could not get name of parent of snapshot %s"),
- snapshot->name);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("could not get name of parent of snapshot %s"),
+ snapshot->name);
goto cleanup;
}
VBOX_UTF16_TO_UTF8(str16, &str8);
rc = gVBoxAPI.UISnapshot.GetOnline(snap, &online);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("could not get online state of snapshot %s"),
- snapshot->name);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("could not get online state of snapshot %s"),
+ snapshot->name);
goto cleanup;
}
if (online)
rc = gVBoxAPI.UIMachine.GetSnapshotCount(machine, &snapshotCount);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("could not get snapshot count for domain %s"),
- dom->name);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("could not get snapshot count for domain %s"),
+ dom->name);
goto cleanup;
}
snapshots = g_new0(ISnapshot *, 1);
rc = gVBoxAPI.UIMachine.FindSnapshot(machine, &empty, snapshots);
if (NS_FAILED(rc) || !snapshots[0]) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("could not get root snapshot for domain %s"),
- dom->name);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("could not get root snapshot for domain %s"),
+ dom->name);
goto cleanup;
}
count = 1;
rc = gVBoxAPI.UISnapshot.GetName(snapshots[i], &nameUtf16);
if (NS_FAILED(rc) || !nameUtf16) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("could not get snapshot name"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("could not get snapshot name"));
goto cleanup;
}
VBOX_UTF16_TO_UTF8(nameUtf16, &name);
rc = gVBoxAPI.UIMachine.GetCurrentSnapshot(machine, &snapshot);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("could not get current snapshot"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("could not get current snapshot"));
goto cleanup;
}
rc = gVBoxAPI.UISnapshot.GetParent(snap, &parent);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("could not get parent of snapshot %s"),
- snapshot->name);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("could not get parent of snapshot %s"),
+ snapshot->name);
goto cleanup;
}
if (!parent) {
- virReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT,
- _("snapshot '%s' does not have a parent"),
- snapshot->name);
+ vboxReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT,
+ _("snapshot '%s' does not have a parent"),
+ snapshot->name);
goto cleanup;
}
rc = gVBoxAPI.UISnapshot.GetName(parent, &nameUtf16);
if (NS_FAILED(rc) || !nameUtf16) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("could not get name of parent of snapshot %s"),
- snapshot->name);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("could not get name of parent of snapshot %s"),
+ snapshot->name);
goto cleanup;
}
VBOX_UTF16_TO_UTF8(nameUtf16, &name);
rc = gVBoxAPI.UIMachine.GetCurrentSnapshot(machine, &snapshot);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("could not get current snapshot"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("could not get current snapshot"));
goto cleanup;
}
if (!snapshot) {
- virReportError(VIR_ERR_OPERATION_INVALID, "%s",
- _("domain has no snapshots"));
+ vboxReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("domain has no snapshots"));
goto cleanup;
}
rc = gVBoxAPI.UISnapshot.GetName(snapshot, &nameUtf16);
if (NS_FAILED(rc) || !nameUtf16) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("could not get current snapshot name"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("could not get current snapshot name"));
goto cleanup;
}
rc = gVBoxAPI.UIMachine.GetCurrentSnapshot(machine, ¤t);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("could not get current snapshot"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("could not get current snapshot"));
goto cleanup;
}
if (!current) {
rc = gVBoxAPI.UISnapshot.GetName(current, &nameUtf16);
if (NS_FAILED(rc) || !nameUtf16) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("could not get current snapshot name"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("could not get current snapshot name"));
goto cleanup;
}
rc = gVBoxAPI.UISnapshot.GetOnline(newSnapshot, &online);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("could not get online state of snapshot %s"),
- snapshot->name);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("could not get online state of snapshot %s"),
+ snapshot->name);
goto cleanup;
}
rc = gVBoxAPI.UIMachine.GetCurrentSnapshot(machine, &prevSnapshot);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("could not get current snapshot of domain %s"),
- dom->name);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("could not get current snapshot of domain %s"),
+ dom->name);
goto cleanup;
}
rc = gVBoxAPI.UIMachine.GetState(machine, &state);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("could not get domain state"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("could not get domain state"));
goto cleanup;
}
if (gVBoxAPI.machineStateChecker.Online(state)) {
- virReportError(VIR_ERR_OPERATION_INVALID, "%s",
- _("cannot revert snapshot of running domain"));
+ vboxReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("cannot revert snapshot of running domain"));
goto cleanup;
}
VBOX_IID_INITIALIZE(&iid);
rc = gVBoxAPI.UISnapshot.GetId(snapshot, &iid);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("could not get snapshot UUID"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("could not get snapshot UUID"));
goto cleanup;
}
rc = gVBoxAPI.UIConsole.DeleteSnapshot(console, &iid, &progress);
if (NS_FAILED(rc) || !progress) {
if (rc == VBOX_E_INVALID_VM_STATE) {
- virReportError(VIR_ERR_OPERATION_INVALID, "%s",
- _("cannot delete domain snapshot for running domain"));
+ vboxReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("cannot delete domain snapshot for running domain"));
} else {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("could not delete snapshot"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("could not delete snapshot"));
}
goto cleanup;
}
gVBoxAPI.UIProgress.WaitForCompletion(progress, -1);
gVBoxAPI.UIProgress.GetResultCode(progress, &result);
if (RC_FAILED(result)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("could not delete snapshot"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("could not delete snapshot"));
goto cleanup;
}
rc = gVBoxAPI.UArray.vboxArrayGet(&children, snapshot,
gVBoxAPI.UArray.handleSnapshotGetChildren(snapshot));
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("could not get children snapshots"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("could not get children snapshots"));
goto cleanup;
}
defXml = vboxDomainSnapshotGetXMLDesc(snapshot, 0);
if (!defXml) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Unable to get XML Desc of snapshot"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to get XML Desc of snapshot"));
goto cleanup;
}
def = virDomainSnapshotDefParseString(defXml,
data->xmlopt, NULL, NULL,
VIR_DOMAIN_SNAPSHOT_PARSE_REDEFINE);
if (!def) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Unable to get a virDomainSnapshotDef *"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to get a virDomainSnapshotDef *"));
goto cleanup;
}
goto cleanup;
rc = gVBoxAPI.UIMachine.GetSettingsFilePath(machine, &settingsFilePathUtf16);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("cannot get settings file path"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("cannot get settings file path"));
goto cleanup;
}
VBOX_UTF16_TO_UTF8(settingsFilePathUtf16, &settingsFilepath);
/* Getting the machine name to retrieve the machine location path. */
rc = gVBoxAPI.UIMachine.GetName(machine, &machineNameUtf16);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("cannot get machine name"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("cannot get machine name"));
goto cleanup;
}
VBOX_UTF16_TO_UTF8(machineNameUtf16, &machineName);
nameTmpUse = g_strdup_printf("%s.vbox", machineName);
machineLocationPath = virStringReplace(settingsFilepath, nameTmpUse, "");
if (machineLocationPath == NULL) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Unable to get the machine location path"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to get the machine location path"));
goto cleanup;
}
snapshotMachineDesc = virVBoxSnapshotConfLoadVboxFile(settingsFilepath, machineLocationPath);
if (!snapshotMachineDesc) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("cannot create a vboxSnapshotXmlPtr"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("cannot create a vboxSnapshotXmlPtr"));
goto cleanup;
}
isCurrent = virVBoxSnapshotConfIsCurrentSnapshot(snapshotMachineDesc, def->parent.name);
if (isCurrent < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Unable to know if the snapshot is the current snapshot"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to know if the snapshot is the current snapshot"));
goto cleanup;
}
if (isCurrent) {
readOnly = virVBoxSnapshotConfHardDiskPtrByLocation(snapshotMachineDesc,
def->parent.dom->disks[it]->src->path);
if (!readOnly) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Cannot get hard disk by location"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Cannot get hard disk by location"));
goto cleanup;
}
if (readOnly->parent == NULL) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("The read only disk has no parent"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("The read only disk has no parent"));
goto cleanup;
}
AccessMode_ReadWrite,
&medium);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to open HardDisk, rc=%08x"),
- (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to open HardDisk, rc=%08x"),
+ (unsigned)rc);
goto cleanup;
}
rc = gVBoxAPI.UIMedium.GetId(medium, &parentiid);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to get hardDisk Id, rc=%08x"),
- (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to get hardDisk Id, rc=%08x"),
+ (unsigned)rc);
goto cleanup;
}
gVBoxAPI.UIID.vboxIIDToUtf8(data, &parentiid, &parentUuid);
newLocation,
&newMedium);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to create HardDisk, rc=%08x"),
- (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to create HardDisk, rc=%08x"),
+ (unsigned)rc);
goto cleanup;
}
VBOX_UTF16_FREE(formatUtf16);
gVBoxAPI.UIProgress.WaitForCompletion(progress, -1);
gVBoxAPI.UIProgress.GetResultCode(progress, &resultCode);
if (RC_FAILED(resultCode)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Error while creating diff storage, rc=%08x"),
- resultCode.uResultCode);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Error while creating diff storage, rc=%08x"),
+ resultCode.uResultCode);
goto cleanup;
}
VBOX_RELEASE(progress);
rc = gVBoxAPI.UIMedium.GetId(newMedium, &iid);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to get medium uuid, rc=%08x"),
- (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to get medium uuid, rc=%08x"),
+ (unsigned)rc);
VIR_FREE(disk);
goto cleanup;
}
if (virVBoxSnapshotConfAddHardDiskToMediaRegistry(disk,
snapshotMachineDesc->mediaRegistry,
parentUuid) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Unable to add hard disk to the media registry"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to add hard disk to the media registry"));
goto cleanup;
}
/* Adding fake disks to the machine storage controllers */
it + 1,
&searchResultTab);
if (resultSize != it + 1) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to find UUID %s"), searchResultTab[it]);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to find UUID %s"), searchResultTab[it]);
goto cleanup;
}
/* Closing the "fake" disk */
rc = gVBoxAPI.UIMedium.Close(newMedium);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to close the new medium, rc=%08x"),
- (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to close the new medium, rc=%08x"),
+ (unsigned)rc);
goto cleanup;
}
}
uuidRO = virVBoxSnapshotConfHardDiskUuidByLocation(snapshotMachineDesc,
def->parent.dom->disks[it]->src->path);
if (!uuidRO) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("No such disk in media registry %s"),
- def->parent.dom->disks[it]->src->path);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("No such disk in media registry %s"),
+ def->parent.dom->disks[it]->src->path);
goto cleanup;
}
it + 1,
&searchResultTab);
if (resultSize != it + 1) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to find UUID %s"),
- searchResultTab[it]);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to find UUID %s"),
+ searchResultTab[it]);
goto cleanup;
}
virVBoxSnapshotConfHardDiskUuidByLocation(snapshotMachineDesc,
def->disks[it].src->path);
if (!uuidRW) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to find UUID for location %s"), def->disks[it].src->path);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to find UUID for location %s"), def->disks[it].src->path);
goto cleanup;
}
if (virVBoxSnapshotConfRemoveHardDisk(snapshotMachineDesc->mediaRegistry, uuidRW) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to remove disk from media registry. uuid = %s"), uuidRW);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to remove disk from media registry. uuid = %s"), uuidRW);
goto cleanup;
}
}
virVBoxSnapshotConfHardDiskUuidByLocation(snapshotMachineDesc,
def->parent.dom->disks[it]->src->path);
if (!uuidRO) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to find UUID for location %s"), def->parent.dom->disks[it]->src->path);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to find UUID for location %s"), def->parent.dom->disks[it]->src->path);
goto cleanup;
}
if (virVBoxSnapshotConfRemoveHardDisk(snapshotMachineDesc->mediaRegistry, uuidRO) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to remove disk from media registry. uuid = %s"), uuidRO);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to remove disk from media registry. uuid = %s"), uuidRO);
goto cleanup;
}
}
&aMediaSize,
&aMedia);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to unregister machine, rc=%08x"),
- (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to unregister machine, rc=%08x"),
+ (unsigned)rc);
goto cleanup;
}
VBOX_RELEASE(machine);
resultCodeUnion resultCode;
rc = gVBoxAPI.UIMedium.DeleteStorage(medium, &progress);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to delete medium, rc=%08x"),
- (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to delete medium, rc=%08x"),
+ (unsigned)rc);
goto cleanup;
}
gVBoxAPI.UIProgress.WaitForCompletion(progress, -1);
gVBoxAPI.UIProgress.GetResultCode(progress, &resultCode);
if (RC_FAILED(resultCode)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Error while closing medium, rc=%08x"),
- resultCode.uResultCode);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Error while closing medium, rc=%08x"),
+ resultCode.uResultCode);
goto cleanup;
}
VBOX_RELEASE(progress);
/* removing the snapshot */
if (virVBoxSnapshotConfRemoveSnapshot(snapshotMachineDesc, def->parent.name) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to remove snapshot %s"), def->parent.name);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to remove snapshot %s"), def->parent.name);
goto cleanup;
}
if (def->parent.parent_name != NULL) {
virVBoxSnapshotConfSnapshot *snap = virVBoxSnapshotConfSnapshotByName(snapshotMachineDesc->snapshot, def->parent.parent_name);
if (!snap) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Unable to get the snapshot to remove"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to get the snapshot to remove"));
goto cleanup;
}
snapshotMachineDesc->currentSnapshot = g_strdup(snap->uuid);
/* Registering the machine */
if (virVBoxSnapshotConfSaveVboxFile(snapshotMachineDesc, settingsFilepath) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Unable to serialize the machine description"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Unable to serialize the machine description"));
goto cleanup;
}
rc = gVBoxAPI.UIVirtualBox.OpenMachine(data->vboxObj,
settingsFilePathUtf16,
&machine);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to open Machine, rc=%08x"),
- (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to open Machine, rc=%08x"),
+ (unsigned)rc);
goto cleanup;
}
rc = gVBoxAPI.UIVirtualBox.RegisterMachine(data->vboxObj, machine);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to register Machine, rc=%08x"),
- (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to register Machine, rc=%08x"),
+ (unsigned)rc);
goto cleanup;
}
rc = gVBoxAPI.UIMachine.GetState(machine, &state);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("could not get domain state"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("could not get domain state"));
goto cleanup;
}
rc = gVBoxAPI.UArray.vboxArrayGet(&snapChildren, snap,
gVBoxAPI.UArray.handleSnapshotGetChildren(snap));
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("could not get snapshot children"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("could not get snapshot children"));
goto cleanup;
}
if (snapChildren.count != 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("cannot delete metadata of a snapshot with children"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("cannot delete metadata of a snapshot with children"));
goto cleanup;
} else if (gVBoxAPI.vboxSnapshotRedefine) {
ret = vboxDomainSnapshotDeleteMetadataOnly(snapshot);
}
if (gVBoxAPI.machineStateChecker.Online(state)) {
- virReportError(VIR_ERR_OPERATION_INVALID, "%s",
- _("cannot delete snapshots of running domain"));
+ vboxReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("cannot delete snapshots of running domain"));
goto cleanup;
}
if (NS_SUCCEEDED(rc))
rc = gVBoxAPI.UISession.GetConsole(data->vboxSession, &console);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("could not open VirtualBox session with domain %s"),
- dom->name);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("could not open VirtualBox session with domain %s"),
+ dom->name);
goto cleanup;
}
rc = gVBoxAPI.UIMachine.GetMonitorCount(machine, &max_screen);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_OPERATION_FAILED, "%s",
- _("unable to get monitor count"));
+ vboxReportError(VIR_ERR_OPERATION_FAILED, "%s",
+ _("unable to get monitor count"));
VBOX_RELEASE(machine);
return NULL;
}
if (screen >= max_screen) {
- virReportError(VIR_ERR_INVALID_ARG,
- _("screen ID higher than monitor "
- "count (%d)"), max_screen);
+ vboxReportError(VIR_ERR_INVALID_ARG,
+ _("screen ID higher than monitor "
+ "count (%d)"), max_screen);
VBOX_RELEASE(machine);
return NULL;
}
&xOrigin, &yOrigin);
if (NS_FAILED(rc) || !width || !height) {
- virReportError(VIR_ERR_OPERATION_FAILED, "%s",
- _("unable to get screen resolution"));
+ vboxReportError(VIR_ERR_OPERATION_FAILED, "%s",
+ _("unable to get screen resolution"));
goto endjob;
}
&screenDataSize,
&screenData);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_OPERATION_FAILED, "%s",
- _("failed to take screenshot"));
+ vboxReportError(VIR_ERR_OPERATION_FAILED, "%s",
+ _("failed to take screenshot"));
goto endjob;
}
ret = g_strdup("image/png");
if (virFDStreamOpenFile(st, tmp, 0, 0, O_RDONLY) < 0) {
- virReportError(VIR_ERR_OPERATION_FAILED, "%s",
- _("unable to open stream"));
+ vboxReportError(VIR_ERR_OPERATION_FAILED, "%s",
+ _("unable to open stream"));
VIR_FREE(ret);
}
endjob:
rc = gVBoxAPI.UArray.vboxArrayGet(&machines, data->vboxObj, ARRAY_GET_MACHINES);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Could not get list of domains, rc=%08x"), (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not get list of domains, rc=%08x"), (unsigned)rc);
goto cleanup;
}
if (MATCH(VIR_CONNECT_LIST_DOMAINS_FILTERS_SNAPSHOT)) {
rc = gVBoxAPI.UIMachine.GetSnapshotCount(machine, &snapshotCount);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("could not get snapshot count for listed domains"));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("could not get snapshot count for listed domains"));
goto cleanup;
}
if (!((MATCH(VIR_CONNECT_LIST_DOMAINS_HAS_SNAPSHOT) &&
VBOX_IID_INITIALIZE(&iid);
rc = gVBoxAPI.UArray.vboxArrayGet(&machines, data->vboxObj, ARRAY_GET_MACHINES);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Could not get list of machines, rc=%08x"), (unsigned)rc);
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not get list of machines, rc=%08x"), (unsigned)rc);
return ret;
}
keycode = virKeycodeValueTranslate(codeset, VIR_KEYCODE_SET_XT,
keyDownCodes[i]);
if (keycode < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("cannot translate keycode %u of %s codeset to"
- " xt keycode"),
- keyDownCodes[i],
- virKeycodeSetTypeToString(codeset));
+ vboxReportError(VIR_ERR_INTERNAL_ERROR,
+ _("cannot translate keycode %u of %s codeset to"
+ " xt keycode"),
+ keyDownCodes[i],
+ virKeycodeSetTypeToString(codeset));
goto cleanup;
}
keyDownCodes[i] = keycode;
rc = gVBoxAPI.UISession.OpenExisting(data, machine);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_OPERATION_FAILED,
- _("Unable to open VirtualBox session with domain %s"),
- dom->name);
+ vboxReportError(VIR_ERR_OPERATION_FAILED,
+ _("Unable to open VirtualBox session with domain %s"),
+ dom->name);
goto cleanup;
}
rc = gVBoxAPI.UISession.GetConsole(data->vboxSession, &console);
if (NS_FAILED(rc) || !console) {
- virReportError(VIR_ERR_OPERATION_FAILED,
- _("Unable to get Console object for domain %s"),
- dom->name);
+ vboxReportError(VIR_ERR_OPERATION_FAILED,
+ _("Unable to get Console object for domain %s"),
+ dom->name);
goto cleanup;
}
rc = gVBoxAPI.UIConsole.GetKeyboard(console, &keyboard);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_OPERATION_FAILED,
- _("Unable to get Keyboard object for domain %s"),
- dom->name);
+ vboxReportError(VIR_ERR_OPERATION_FAILED,
+ _("Unable to get Keyboard object for domain %s"),
+ dom->name);
goto cleanup;
}
&codesStored);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_OPERATION_FAILED,
- _("Unable to send keyboard scancodes for domain %s"),
- dom->name);
+ vboxReportError(VIR_ERR_OPERATION_FAILED,
+ _("Unable to send keyboard scancodes for domain %s"),
+ dom->name);
goto cleanup;
}
&codesStored);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_OPERATION_FAILED,
- _("Unable to send keyboard scan codes to domain %s"),
- dom->name);
+ vboxReportError(VIR_ERR_OPERATION_FAILED,
+ _("Unable to send keyboard scan codes to domain %s"),
+ dom->name);
goto cleanup;
}