From: "Daniel P. Berrange" <berrange@xxxxxxxxxx> Update the QEMU driver to use virReportError instead of the qemuReportError custom macro Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx> --- cfg.mk | 1 - src/qemu/qemu_agent.c | 142 ++-- src/qemu/qemu_capabilities.c | 16 +- src/qemu/qemu_cgroup.c | 26 +- src/qemu/qemu_command.c | 1066 ++++++++++++------------ src/qemu/qemu_conf.c | 26 +- src/qemu/qemu_conf.h | 4 - src/qemu/qemu_domain.c | 94 +-- src/qemu/qemu_driver.c | 1834 +++++++++++++++++++++--------------------- src/qemu/qemu_hostdev.c | 59 +- src/qemu/qemu_hotplug.c | 362 ++++----- src/qemu/qemu_migration.c | 284 +++---- src/qemu/qemu_monitor.c | 384 ++++----- src/qemu/qemu_monitor_json.c | 546 ++++++------- src/qemu/qemu_monitor_text.c | 532 ++++++------ src/qemu/qemu_process.c | 216 ++--- 16 files changed, 2795 insertions(+), 2797 deletions(-) diff --git a/cfg.mk b/cfg.mk index 699aeac..6e1f6af 100644 --- a/cfg.mk +++ b/cfg.mk @@ -509,7 +509,6 @@ msg_gen_function = msg_gen_function += VIR_ERROR msg_gen_function += lxcError msg_gen_function += nodeReportError -msg_gen_function += qemuReportError msg_gen_function += regerror msg_gen_function += vah_error msg_gen_function += vah_warning diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c index 7a0381c..12b9499 100644 --- a/src/qemu/qemu_agent.c +++ b/src/qemu/qemu_agent.c @@ -204,22 +204,22 @@ qemuAgentOpenUnix(const char *monitor, pid_t cpid, bool *inProgress) } if (virSetNonBlock(monfd) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("Unable to put monitor into non-blocking mode")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("Unable to put monitor into non-blocking mode")); goto error; } if (virSetCloseExec(monfd) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("Unable to set monitor close-on-exec flag")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("Unable to set monitor close-on-exec flag")); goto error; } memset(&addr, 0, sizeof(addr)); addr.sun_family = AF_UNIX; if (virStrcpyStatic(addr.sun_path, monitor) == NULL) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Agent path %s too big for destination"), monitor); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Agent path %s too big for destination"), monitor); goto error; } @@ -269,14 +269,14 @@ qemuAgentOpenPty(const char *monitor) int monfd; if ((monfd = open(monitor, O_RDWR | O_NONBLOCK)) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to open monitor path %s"), monitor); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Unable to open monitor path %s"), monitor); return -1; } if (virSetCloseExec(monfd) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("Unable to set monitor close-on-exec flag")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("Unable to set monitor close-on-exec flag")); goto error; } @@ -331,8 +331,8 @@ qemuAgentIOProcessLine(qemuAgentPtr mon, goto cleanup; if (obj->type != VIR_JSON_TYPE_OBJECT) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Parsed JSON reply '%s' isn't an object"), line); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Parsed JSON reply '%s' isn't an object"), line); goto cleanup; } @@ -362,12 +362,12 @@ qemuAgentIOProcessLine(qemuAgentPtr mon, goto cleanup; } - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Unexpected JSON reply '%s'"), line); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Unexpected JSON reply '%s'"), line); } } else { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Unknown JSON reply '%s'"), line); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Unknown JSON reply '%s'"), line); } cleanup: @@ -609,9 +609,9 @@ qemuAgentIO(int watch, int fd, int events, void *opaque) { if (mon->fd != fd || mon->watch != watch) { if (events & (VIR_EVENT_HANDLE_HANGUP | VIR_EVENT_HANDLE_ERROR)) eof = true; - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("event from unexpected fd %d!=%d / watch %d!=%d"), - mon->fd, fd, mon->watch, watch); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("event from unexpected fd %d!=%d / watch %d!=%d"), + mon->fd, fd, mon->watch, watch); error = true; } else if (mon->lastError.code != VIR_ERR_OK) { if (events & (VIR_EVENT_HANDLE_HANGUP | VIR_EVENT_HANDLE_ERROR)) @@ -649,23 +649,23 @@ qemuAgentIO(int watch, int fd, int events, void *opaque) { if (!error && events & VIR_EVENT_HANDLE_HANGUP) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("End of file from monitor")); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("End of file from monitor")); eof = 1; events &= ~VIR_EVENT_HANDLE_HANGUP; } if (!error && !eof && events & VIR_EVENT_HANDLE_ERROR) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Invalid file descriptor while waiting for monitor")); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Invalid file descriptor while waiting for monitor")); eof = 1; events &= ~VIR_EVENT_HANDLE_ERROR; } if (!error && events) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Unhandled event %d for monitor fd %d"), - events, mon->fd); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Unhandled event %d for monitor fd %d"), + events, mon->fd); error = 1; } } @@ -677,8 +677,8 @@ qemuAgentIO(int watch, int fd, int events, void *opaque) { } else { virErrorPtr err = virGetLastError(); if (!err) - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Error while processing monitor IO")); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Error while processing monitor IO")); virCopyLastError(&mon->lastError); virResetLastError(); } @@ -734,8 +734,8 @@ qemuAgentOpen(virDomainObjPtr vm, qemuAgentPtr mon; if (!cb || !cb->eofNotify) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("EOF notify callback must be supplied")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("EOF notify callback must be supplied")); return NULL; } @@ -745,14 +745,14 @@ qemuAgentOpen(virDomainObjPtr vm, } if (virMutexInit(&mon->lock) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("cannot initialize monitor mutex")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("cannot initialize monitor mutex")); VIR_FREE(mon); return NULL; } if (virCondInit(&mon->notify) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("cannot initialize monitor condition")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("cannot initialize monitor condition")); virMutexDestroy(&mon->lock); VIR_FREE(mon); return NULL; @@ -774,9 +774,9 @@ qemuAgentOpen(virDomainObjPtr vm, break; default: - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unable to handle monitor type: %s"), - virDomainChrTypeToString(config->type)); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unable to handle monitor type: %s"), + virDomainChrTypeToString(config->type)); goto cleanup; } @@ -792,8 +792,8 @@ qemuAgentOpen(virDomainObjPtr vm, 0), qemuAgentIO, mon, qemuAgentUnwatch)) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("unable to register monitor events")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("unable to register monitor events")); goto cleanup; } qemuAgentRef(mon); @@ -886,12 +886,12 @@ static int qemuAgentSend(qemuAgentPtr mon, if ((timeout && virCondWaitUntil(&mon->notify, &mon->lock, then) < 0) || (!timeout && virCondWait(&mon->notify, &mon->lock) < 0)) { if (errno == ETIMEDOUT) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Guest agent not available for now")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Guest agent not available for now")); ret = -2; } else { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Unable to wait on monitor condition")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to wait on monitor condition")); } goto cleanup; } @@ -959,23 +959,23 @@ qemuAgentGuestSync(qemuAgentPtr mon) } if (!sync_msg.rxObject) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Missing monitor reply object")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Missing monitor reply object")); goto cleanup; } if (virJSONValueObjectGetNumberUlong(sync_msg.rxObject, "return", &id_ret) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Malformed return value")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Malformed return value")); goto cleanup; } VIR_DEBUG("Guest returned ID: %llu", id_ret); if (id_ret != id) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Guest agent returned ID: %llu instead of %llu"), - id_ret, id); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Guest agent returned ID: %llu instead of %llu"), + id_ret, id); goto cleanup; } ret = 0; @@ -1029,8 +1029,8 @@ qemuAgentCommand(qemuAgentPtr mon, if (await_event) { VIR_DEBUG("Woken up by event %d", await_event); } else { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Missing monitor reply object")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Missing monitor reply object")); ret = -1; } } else { @@ -1128,14 +1128,14 @@ qemuAgentCheckError(virJSONValuePtr cmd, /* Only send the user the command name + friendly error */ if (!error) - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unable to execute QEMU command '%s'"), - qemuAgentCommandName(cmd)); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unable to execute QEMU command '%s'"), + qemuAgentCommandName(cmd)); else - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unable to execute QEMU command '%s': %s"), - qemuAgentCommandName(cmd), - qemuAgentStringifyError(error)); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unable to execute QEMU command '%s': %s"), + qemuAgentCommandName(cmd), + qemuAgentStringifyError(error)); VIR_FREE(cmdstr); VIR_FREE(replystr); @@ -1146,9 +1146,9 @@ qemuAgentCheckError(virJSONValuePtr cmd, VIR_DEBUG("Neither 'return' nor 'error' is set in the JSON reply %s: %s", cmdstr, replystr); - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unable to execute QEMU command '%s'"), - qemuAgentCommandName(cmd)); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unable to execute QEMU command '%s'"), + qemuAgentCommandName(cmd)); VIR_FREE(cmdstr); VIR_FREE(replystr); return -1; @@ -1178,9 +1178,9 @@ qemuAgentMakeCommand(const char *cmdname, char type; if (strlen(key) < 3) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("argument key '%s' is too short, missing type prefix"), - key); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("argument key '%s' is too short, missing type prefix"), + key); goto error; } @@ -1232,8 +1232,8 @@ qemuAgentMakeCommand(const char *cmdname, ret = virJSONValueObjectAppendNull(jargs, key); } break; default: - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unsupported data type '%c' for arg '%s'"), type, key - 2); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unsupported data type '%c' for arg '%s'"), type, key - 2); goto error; } if (ret < 0) @@ -1332,8 +1332,8 @@ int qemuAgentFSFreeze(qemuAgentPtr mon) goto cleanup; if (virJSONValueObjectGetNumberInt(reply, "return", &ret) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("malformed return value")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("malformed return value")); } cleanup: @@ -1369,8 +1369,8 @@ int qemuAgentFSThaw(qemuAgentPtr mon) goto cleanup; if (virJSONValueObjectGetNumberInt(reply, "return", &ret) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("malformed return value")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("malformed return value")); } cleanup: diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index f93f2aa..7861bee 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1226,9 +1226,9 @@ qemuCapsComputeCmdFlags(const char *help, if (version >= 15000 || (version >= 12000 && strstr(help, "libvirt"))) { if (check_yajl) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("this qemu binary requires libvirt to be " - "compiled with yajl")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("this qemu binary requires libvirt to be " + "compiled with yajl")); return -1; } qemuCapsSet(flags, QEMU_CAPS_NETDEV); @@ -1363,9 +1363,9 @@ fail: if (!p) p = strchr(help, '\0'); - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot parse %s version number in '%.*s'"), - qemu, (int) (p - help), help); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot parse %s version number in '%.*s'"), + qemu, (int) (p - help), help); cleanup: return -1; @@ -1589,8 +1589,8 @@ int qemuCapsExtractVersion(virCapsPtr caps, "hvm", ut.machine, "qemu")) == NULL) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Cannot find suitable emulator for %s"), ut.machine); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Cannot find suitable emulator for %s"), ut.machine); return -1; } diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c index e39f5e1..cedbc95 100644 --- a/src/qemu/qemu_cgroup.c +++ b/src/qemu/qemu_cgroup.c @@ -310,8 +310,8 @@ int qemuSetupCgroup(struct qemud_driver *driver, goto cleanup; } } else { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Block I/O tuning is not available on this host")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Block I/O tuning is not available on this host")); goto cleanup; } } @@ -333,8 +333,8 @@ int qemuSetupCgroup(struct qemud_driver *driver, } } } else { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Block I/O tuning is not available on this host")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Block I/O tuning is not available on this host")); goto cleanup; } } @@ -372,8 +372,8 @@ int qemuSetupCgroup(struct qemud_driver *driver, } } } else { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Memory cgroup is not available on this host")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Memory cgroup is not available on this host")); } } @@ -387,8 +387,8 @@ int qemuSetupCgroup(struct qemud_driver *driver, goto cleanup; } } else { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("CPU tuning is not available on this host")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("CPU tuning is not available on this host")); } } @@ -405,8 +405,8 @@ int qemuSetupCgroup(struct qemud_driver *driver, mask = virDomainCpuSetFormat(vm->def->numatune.memory.nodemask, VIR_DOMAIN_CPUMASK_LEN); if (!mask) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("failed to convert memory nodemask")); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("failed to convert memory nodemask")); goto cleanup; } @@ -585,9 +585,9 @@ int qemuRemoveCgroup(struct qemud_driver *driver, rc = virCgroupForDomain(driver->cgroup, vm->def->name, &cgroup, 0); if (rc != 0) { if (!quiet) - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to find cgroup for %s"), - vm->def->name); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Unable to find cgroup for %s"), + vm->def->name); return rc; } diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 09215af..447e0e5 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -202,9 +202,9 @@ qemuNetworkIfaceConnect(virDomainDefPtr def, fail = 1; if (active == 0) - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Network '%s' is not active."), - net->data.network.name); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Network '%s' is not active."), + net->data.network.name); } if (!fail) { @@ -228,9 +228,9 @@ qemuNetworkIfaceConnect(virDomainDefPtr def, return -1; } } else { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Network type %d is not supported"), - virDomainNetGetActualType(net)); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Network type %d is not supported"), + virDomainNetGetActualType(net)); return -1; } @@ -273,9 +273,9 @@ qemuNetworkIfaceConnect(virDomainDefPtr def, if (tapfd >= 0 && virNetDevBandwidthSet(net->ifname, virDomainNetGetActualBandwidth(net)) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot set bandwidth limits on %s"), - net->ifname); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot set bandwidth limits on %s"), + net->ifname); VIR_FORCE_CLOSE(tapfd); goto cleanup; } @@ -314,9 +314,9 @@ qemuOpenVhostNet(virDomainDefPtr def, qemuCapsGet(qemuCaps, QEMU_CAPS_NETDEV) && qemuCapsGet(qemuCaps, QEMU_CAPS_DEVICE))) { if (net->driver.virtio.name == VIR_DOMAIN_NET_BACKEND_TYPE_VHOST) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", _("vhost-net is not supported with " - "this QEMU binary")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + "%s", _("vhost-net is not supported with " + "this QEMU binary")); return -1; } return 0; @@ -325,9 +325,9 @@ qemuOpenVhostNet(virDomainDefPtr def, /* If the nic model isn't virtio, don't try to open. */ if (!(net->model && STREQ(net->model, "virtio"))) { if (net->driver.virtio.name == VIR_DOMAIN_NET_BACKEND_TYPE_VHOST) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", _("vhost-net is only supported for " - "virtio network interfaces")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + "%s", _("vhost-net is only supported for " + "virtio network interfaces")); return -1; } return 0; @@ -341,9 +341,9 @@ qemuOpenVhostNet(virDomainDefPtr def, */ if ((*vhostfd < 0) && (net->driver.virtio.name == VIR_DOMAIN_NET_BACKEND_TYPE_VHOST)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", _("vhost-net was requested for an interface, " - "but is unavailable")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + "%s", _("vhost-net was requested for an interface, " + "but is unavailable")); return -1; } return 0; @@ -422,9 +422,9 @@ static int qemuAssignDeviceDiskAliasFixed(virDomainDiskDefPtr disk) char *dev_name; if (virDiskNameToBusDeviceIndex(disk, &busid, &devid) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot convert disk '%s' to bus/device index"), - disk->dst); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot convert disk '%s' to bus/device index"), + disk->dst); return -1; } @@ -451,9 +451,9 @@ static int qemuAssignDeviceDiskAliasFixed(virDomainDiskDefPtr disk) ret = virAsprintf(&dev_name, "xenblk%d", devid); break; default: - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Unsupported disk name mapping for bus '%s'"), - virDomainDiskBusTypeToString(disk->bus)); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Unsupported disk name mapping for bus '%s'"), + virDomainDiskBusTypeToString(disk->bus)); return -1; } @@ -555,8 +555,8 @@ qemuAssignDeviceNetAlias(virDomainDefPtr def, virDomainNetDefPtr net, int idx) continue; } if ((thisidx = qemuDomainDeviceAliasIndex(&def->nets[i]->info, "net")) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Unable to determine device index for network device")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to determine device index for network device")); return -1; } if (thisidx >= idx) @@ -582,8 +582,8 @@ qemuAssignDeviceHostdevAlias(virDomainDefPtr def, virDomainHostdevDefPtr hostdev for (i = 0 ; i < def->nhostdevs ; i++) { int thisidx; if ((thisidx = qemuDomainDeviceAliasIndex(def->hostdevs[i]->info, "hostdev")) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Unable to determine device index for hostdev device")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to determine device index for hostdev device")); return -1; } if (thisidx >= idx) @@ -609,8 +609,8 @@ qemuAssignDeviceRedirdevAlias(virDomainDefPtr def, virDomainRedirdevDefPtr redir for (i = 0 ; i < def->nredirdevs ; i++) { int thisidx; if ((thisidx = qemuDomainDeviceAliasIndex(&def->redirdevs[i]->info, "redir")) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Unable to determine device index for redirected device")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to determine device index for redirected device")); return -1; } if (thisidx >= idx) @@ -835,9 +835,9 @@ qemuAssignSpaprVIOAddress(virDomainDefPtr def, virDomainDeviceInfoPtr info, rc = virDomainDeviceInfoIterate(def, qemuSpaprVIOFindByReg, info); while (rc != 0) { if (user_reg) { - qemuReportError(VIR_ERR_XML_ERROR, - _("spapr-vio address %#llx already in use"), - info->addr.spaprvio.reg); + virReportError(VIR_ERR_XML_ERROR, + _("spapr-vio address %#llx already in use"), + info->addr.spaprvio.reg); return -EEXIST; } @@ -911,8 +911,8 @@ static char *qemuPCIAddressAsString(virDomainDeviceInfoPtr dev) if (dev->addr.pci.domain != 0 || dev->addr.pci.bus != 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Only PCI domain 0 and bus 0 are available")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Only PCI domain 0 and bus 0 are available")); return NULL; } @@ -953,13 +953,13 @@ static int qemuCollectPCIAddress(virDomainDefPtr def ATTRIBUTE_UNUSED, if (virHashLookup(addrs->used, addr)) { if (info->addr.pci.function != 0) { - qemuReportError(VIR_ERR_XML_ERROR, - _("Attempted double use of PCI Address '%s' " - "(may need \"multifunction='on'\" for device on function 0)"), - addr); + virReportError(VIR_ERR_XML_ERROR, + _("Attempted double use of PCI Address '%s' " + "(may need \"multifunction='on'\" for device on function 0)"), + addr); } else { - qemuReportError(VIR_ERR_XML_ERROR, - _("Attempted double use of PCI Address '%s'"), addr); + virReportError(VIR_ERR_XML_ERROR, + _("Attempted double use of PCI Address '%s'"), addr); } goto cleanup; } @@ -982,10 +982,10 @@ static int qemuCollectPCIAddress(virDomainDefPtr def ATTRIBUTE_UNUSED, goto cleanup; if (virHashLookup(addrs->used, addr)) { - qemuReportError(VIR_ERR_XML_ERROR, - _("Attempted double use of PCI Address '%s'" - "(need \"multifunction='off'\" for device on function 0)"), - addr); + virReportError(VIR_ERR_XML_ERROR, + _("Attempted double use of PCI Address '%s'" + "(need \"multifunction='off'\" for device on function 0)"), + addr); goto cleanup; } @@ -1138,8 +1138,8 @@ int qemuDomainPCIAddressReserveAddr(qemuDomainPCIAddressSetPtr addrs, VIR_DEBUG("Reserving PCI addr %s", addr); if (virHashLookup(addrs->used, addr)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unable to reserve PCI address %s"), addr); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unable to reserve PCI address %s"), addr); VIR_FREE(addr); return -1; } @@ -1199,9 +1199,9 @@ int qemuDomainPCIAddressEnsureAddr(qemuDomainPCIAddressSetPtr addrs, * reserve the whole slot. The function of the PCI device must be 0. */ if (dev->addr.pci.function != 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Only PCI device addresses with function=0" - " are supported")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Only PCI device addresses with function=0" + " are supported")); return -1; } @@ -1316,8 +1316,8 @@ static int qemuDomainPCIAddressGetNextSlot(qemuDomainPCIAddressSetPtr addrs) return i; } - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("No more available PCI addresses")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("No more available PCI addresses")); return -1; } @@ -1407,8 +1407,8 @@ qemuAssignDevicePCISlots(virDomainDefPtr def, qemuDomainPCIAddressSetPtr addrs) def->controllers[i]->info.addr.pci.bus != 0 || def->controllers[i]->info.addr.pci.slot != 1 || def->controllers[i]->info.addr.pci.function != 1) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Primary IDE controller must have PCI address 0:0:1.1")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Primary IDE controller must have PCI address 0:0:1.1")); goto error; } /* If TYPE==PCI, then qemuCollectPCIAddress() function @@ -1430,8 +1430,8 @@ qemuAssignDevicePCISlots(virDomainDefPtr def, qemuDomainPCIAddressSetPtr addrs) def->controllers[i]->info.addr.pci.bus != 0 || def->controllers[i]->info.addr.pci.slot != 1 || def->controllers[i]->info.addr.pci.function != 2) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("PIIX3 USB controller must have PCI address 0:0:1.2")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("PIIX3 USB controller must have PCI address 0:0:1.2")); goto error; } reservedUSB = true; @@ -1465,8 +1465,8 @@ qemuAssignDevicePCISlots(virDomainDefPtr def, qemuDomainPCIAddressSetPtr addrs) def->videos[0]->info.addr.pci.bus != 0 || def->videos[0]->info.addr.pci.slot != 2 || def->videos[0]->info.addr.pci.function != 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Primary video card must have PCI address 0:0:2.0")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Primary video card must have PCI address 0:0:2.0")); goto error; } /* If TYPE==PCI, then qemuCollectPCIAddress() function @@ -1616,8 +1616,8 @@ qemuAssignDevicePCISlots(virDomainDefPtr def, qemuDomainPCIAddressSetPtr addrs) continue; if (def->disks[i]->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("virtio only support device address type 'PCI'")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("virtio only support device address type 'PCI'")); goto error; } @@ -1698,33 +1698,33 @@ qemuBuildDeviceAddressStr(virBufferPtr buf, { if (info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) { if (info->addr.pci.domain != 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Only PCI device addresses with domain=0 are supported")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Only PCI device addresses with domain=0 are supported")); return -1; } if (info->addr.pci.bus != 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Only PCI device addresses with bus=0 are supported")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Only PCI device addresses with bus=0 are supported")); return -1; } if (qemuCapsGet(qemuCaps, QEMU_CAPS_PCI_MULTIFUNCTION)) { if (info->addr.pci.function > 7) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("The function of PCI device addresses must " - "less than 8")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("The function of PCI device addresses must " + "less than 8")); return -1; } } else { if (info->addr.pci.function != 0) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("Only PCI device addresses with function=0 " - "are supported with this QEMU binary")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Only PCI device addresses with function=0 " + "are supported with this QEMU binary")); return -1; } if (info->addr.pci.multi == VIR_DOMAIN_DEVICE_ADDRESS_PCI_MULTI_ON) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("'multifunction=on' is not supported with " - "this QEMU binary")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("'multifunction=on' is not supported with " + "this QEMU binary")); return -1; } } @@ -1765,13 +1765,13 @@ qemuBuildRomStr(virBufferPtr buf, { if (info->rombar || info->romfile) { if (info->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", _("rombar and romfile are supported only for PCI devices")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + "%s", _("rombar and romfile are supported only for PCI devices")); return -1; } if (!qemuCapsGet(qemuCaps, QEMU_CAPS_PCI_ROMBAR)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", _("rombar and romfile not supported in this QEMU binary")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + "%s", _("rombar and romfile not supported in this QEMU binary")); return -1; } @@ -1809,9 +1809,9 @@ static int qemuSafeSerialParamValue(const char *value) { if (strspn(value, QEMU_SERIAL_PARAM_ACCEPTED_CHARS) != strlen (value)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("driver serial '%s' contains unsafe characters"), - value); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("driver serial '%s' contains unsafe characters"), + value); return -1; } @@ -1851,9 +1851,9 @@ qemuBuildRBDString(virConnectPtr conn, secret = (char *)conn->secretDriver->getValue(sec, &secret_size, 0, VIR_SECRET_GET_VALUE_INTERNAL_CALL); if (secret == NULL) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("could not get the value of the secret for username %s"), - disk->auth.username); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("could not get the value of the secret for username %s"), + disk->auth.username); goto error; } /* qemu/librbd wants it base64 encoded */ @@ -1867,9 +1867,9 @@ qemuBuildRBDString(virConnectPtr conn, base64); VIR_FREE(base64); } else { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("rbd username '%s' specified but secret not found"), - disk->auth.username); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("rbd username '%s' specified but secret not found"), + disk->auth.username); goto error; } } else { @@ -2020,16 +2020,16 @@ qemuBuildDriveStr(virConnectPtr conn ATTRIBUTE_UNUSED, int busid = -1, unitid = -1; if (idx < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unsupported disk type '%s'"), disk->dst); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unsupported disk type '%s'"), disk->dst); goto error; } switch (disk->bus) { case VIR_DOMAIN_DISK_BUS_SCSI: if (disk->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("unexpected address type for scsi disk")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("unexpected address type for scsi disk")); goto error; } @@ -2037,8 +2037,8 @@ qemuBuildDriveStr(virConnectPtr conn ATTRIBUTE_UNUSED, * to be created. Yes this is slightly odd. It is not possible * to have > 1 bus on a SCSI controller (yet). */ if (disk->info.addr.drive.bus != 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("SCSI controller only supports 1 bus")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("SCSI controller only supports 1 bus")); goto error; } busid = disk->info.addr.drive.controller; @@ -2047,14 +2047,14 @@ qemuBuildDriveStr(virConnectPtr conn ATTRIBUTE_UNUSED, case VIR_DOMAIN_DISK_BUS_IDE: if (disk->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("unexpected address type for ide disk")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("unexpected address type for ide disk")); goto error; } /* We can only have 1 IDE controller (currently) */ if (disk->info.addr.drive.controller != 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Only 1 %s controller is supported"), bus); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Only 1 %s controller is supported"), bus); goto error; } busid = disk->info.addr.drive.bus; @@ -2063,25 +2063,25 @@ qemuBuildDriveStr(virConnectPtr conn ATTRIBUTE_UNUSED, case VIR_DOMAIN_DISK_BUS_FDC: if (disk->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("unexpected address type for fdc disk")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("unexpected address type for fdc disk")); goto error; } /* We can only have 1 FDC controller (currently) */ if (disk->info.addr.drive.controller != 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Only 1 %s controller is supported"), bus); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Only 1 %s controller is supported"), bus); goto error; } /* We can only have 1 FDC bus (currently) */ if (disk->info.addr.drive.bus != 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Only 1 %s bus is supported"), bus); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Only 1 %s bus is supported"), bus); goto error; } if (disk->info.addr.drive.target != 0) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("target must be 0 for controller fdc")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("target must be 0 for controller fdc")); goto error; } unitid = disk->info.addr.drive.unit; @@ -2092,8 +2092,8 @@ qemuBuildDriveStr(virConnectPtr conn ATTRIBUTE_UNUSED, if (qemuCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_S390) && (disk->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S390)) { /* Paranoia - leave in here for now */ - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("unexpected address type for s390-virtio disk")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("unexpected address type for s390-virtio disk")); goto error; } idx = -1; @@ -2115,14 +2115,14 @@ qemuBuildDriveStr(virConnectPtr conn ATTRIBUTE_UNUSED, /* QEMU only supports magic FAT format for now */ if (disk->driverType && STRNEQ(disk->driverType, "fat")) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unsupported disk driver type for '%s'"), - disk->driverType); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unsupported disk driver type for '%s'"), + disk->driverType); goto error; } if (!disk->readonly) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("cannot create virtual FAT disks in read-write mode")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("cannot create virtual FAT disks in read-write mode")); goto error; } if (disk->device == VIR_DOMAIN_DISK_DEVICE_FLOPPY) @@ -2134,8 +2134,8 @@ qemuBuildDriveStr(virConnectPtr conn ATTRIBUTE_UNUSED, switch (disk->protocol) { case VIR_DOMAIN_DISK_PROTOCOL_NBD: if (disk->nhosts != 1) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("NBD accepts only one host")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("NBD accepts only one host")); goto error; } virBufferAsprintf(&opt, "file=nbd:%s:%s,", @@ -2162,9 +2162,9 @@ qemuBuildDriveStr(virConnectPtr conn ATTRIBUTE_UNUSED, } else { if ((disk->type == VIR_DOMAIN_DISK_TYPE_BLOCK) && (disk->tray_status == VIR_DOMAIN_DISK_TRAY_OPEN)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("tray status 'open' is invalid for " - "block type disk")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("tray status 'open' is invalid for " + "block type disk")); goto error; } virBufferEscape(&opt, ',', ",", "file=%s,", disk->src); @@ -2210,8 +2210,8 @@ qemuBuildDriveStr(virConnectPtr conn ATTRIBUTE_UNUSED, qemuCapsGet(qemuCaps, QEMU_CAPS_DRIVE_READONLY)) virBufferAddLit(&opt, ",readonly=on"); if (disk->transient) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("transient disks not supported yet")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("transient disks not supported yet")); goto error; } if (disk->driverType && *disk->driverType != '\0' && @@ -2233,15 +2233,15 @@ qemuBuildDriveStr(virConnectPtr conn ATTRIBUTE_UNUSED, if (disk->cachemode == VIR_DOMAIN_DISK_CACHE_DIRECTSYNC && !qemuCapsGet(qemuCaps, QEMU_CAPS_DRIVE_CACHE_DIRECTSYNC)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("disk cache mode 'directsync' is not " - "supported by this QEMU")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("disk cache mode 'directsync' is not " + "supported by this QEMU")); goto error; } else if (disk->cachemode == VIR_DOMAIN_DISK_CACHE_UNSAFE && !qemuCapsGet(qemuCaps, QEMU_CAPS_DRIVE_CACHE_UNSAFE)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("disk cache mode 'unsafe' is not " - "supported by this QEMU")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("disk cache mode 'unsafe' is not " + "supported by this QEMU")); goto error; } } else { @@ -2258,8 +2258,8 @@ qemuBuildDriveStr(virConnectPtr conn ATTRIBUTE_UNUSED, virBufferAsprintf(&opt, ",copy-on-read=%s", virDomainDiskCopyOnReadTypeToString(disk->copy_on_read)); } else { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("copy_on_read is not supported by this QEMU binary")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("copy_on_read is not supported by this QEMU binary")); goto error; } } @@ -2294,9 +2294,9 @@ qemuBuildDriveStr(virConnectPtr conn ATTRIBUTE_UNUSED, virBufferAsprintf(&opt, ",aio=%s", virDomainDiskIoTypeToString(disk->iomode)); } else { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("disk aio mode not supported with this " - "QEMU binary")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("disk aio mode not supported with this " + "QEMU binary")); goto error; } } @@ -2309,9 +2309,9 @@ qemuBuildDriveStr(virConnectPtr conn ATTRIBUTE_UNUSED, disk->blkdeviotune.read_iops_sec || disk->blkdeviotune.write_iops_sec) && !qemuCapsGet(qemuCaps, QEMU_CAPS_DRIVE_IOTUNE)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("block I/O throttling not supported with this " - "QEMU binary")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("block I/O throttling not supported with this " + "QEMU binary")); goto error; } @@ -2369,8 +2369,8 @@ qemuBuildDriveDevStr(virDomainDefPtr def, int controllerModel; if (idx < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unsupported disk type '%s'"), disk->dst); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unsupported disk type '%s'"), disk->dst); goto error; } @@ -2380,20 +2380,20 @@ qemuBuildDriveDevStr(virDomainDefPtr def, */ if (disk->bus != VIR_DOMAIN_DISK_BUS_VIRTIO && disk->bus != VIR_DOMAIN_DISK_BUS_SCSI) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("disk device='lun' is not supported for bus='%s'"), - bus); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("disk device='lun' is not supported for bus='%s'"), + bus); goto error; } if (disk->type != VIR_DOMAIN_DISK_TYPE_BLOCK) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("disk device='lun' is not supported for type='%s'"), - virDomainDiskTypeToString(disk->type)); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("disk device='lun' is not supported for type='%s'"), + virDomainDiskTypeToString(disk->type)); goto error; } if (!qemuCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_BLK_SG_IO)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("disk device='lun' is not supported by this QEMU")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("disk device='lun' is not supported by this QEMU")); goto error; } } @@ -2401,8 +2401,8 @@ qemuBuildDriveDevStr(virDomainDefPtr def, switch (disk->bus) { case VIR_DOMAIN_DISK_BUS_IDE: if (disk->info.addr.drive.target != 0) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("target must be 0 for ide controller")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("target must be 0 for ide controller")); goto error; } @@ -2422,9 +2422,9 @@ qemuBuildDriveDevStr(virDomainDefPtr def, case VIR_DOMAIN_DISK_BUS_SCSI: if (disk->device == VIR_DOMAIN_DISK_DEVICE_LUN) { if (!qemuCapsGet(qemuCaps, QEMU_CAPS_SCSI_BLOCK)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("This QEMU doesn't support scsi-block for " - "lun passthrough")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("This QEMU doesn't support scsi-block for " + "lun passthrough")); goto error; } } @@ -2438,9 +2438,9 @@ qemuBuildDriveDevStr(virDomainDefPtr def, if (controllerModel == VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSILOGIC) { if (disk->info.addr.drive.target != 0) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("target must be 0 for controller " - "model 'lsilogic'")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("target must be 0 for controller " + "model 'lsilogic'")); goto error; } @@ -2464,17 +2464,17 @@ qemuBuildDriveDevStr(virDomainDefPtr def, } else { if (!qemuCapsGet(qemuCaps, QEMU_CAPS_SCSI_DISK_CHANNEL)) { if (disk->info.addr.drive.target > 7) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("This QEMU doesn't support target " - "greater than 7")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("This QEMU doesn't support target " + "greater than 7")); goto error; } if ((disk->info.addr.drive.bus != disk->info.addr.drive.unit) && (disk->info.addr.drive.bus != 0)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("This QEMU only supports both bus and " - "unit equal to 0")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("This QEMU only supports both bus and " + "unit equal to 0")); goto error; } } @@ -2501,13 +2501,13 @@ qemuBuildDriveDevStr(virDomainDefPtr def, break; case VIR_DOMAIN_DISK_BUS_SATA: if (disk->info.addr.drive.bus != 0) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("bus must be 0 for ide controller")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("bus must be 0 for ide controller")); goto error; } if (disk->info.addr.drive.target != 0) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("target must be 0 for ide controller")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("target must be 0 for ide controller")); goto error; } @@ -2552,8 +2552,8 @@ qemuBuildDriveDevStr(virDomainDefPtr def, virBufferAddLit(&opt, "usb-storage"); break; default: - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unsupported disk bus '%s' with device setup"), bus); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unsupported disk bus '%s' with device setup"), bus); goto error; } virBufferAsprintf(&opt, ",drive=%s%s", QEMU_DRIVE_HOST_PREFIX, disk->info.alias); @@ -2582,14 +2582,14 @@ char *qemuBuildFSStr(virDomainFSDefPtr fs, const char *wrpolicy = virDomainFSWrpolicyTypeToString(fs->wrpolicy); if (fs->type != VIR_DOMAIN_FS_TYPE_MOUNT) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("only supports mount filesystem type")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("only supports mount filesystem type")); goto error; } if (!driver) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("Filesystem driver type not supported")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Filesystem driver type not supported")); goto error; } virBufferAdd(&opt, driver, -1); @@ -2607,8 +2607,8 @@ char *qemuBuildFSStr(virDomainFSDefPtr fs, /* For other fs drivers, default(passthru) should always * be supported */ if (fs->accessmode != VIR_DOMAIN_FS_ACCESSMODE_PASSTHROUGH) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("only supports passthrough accessmode")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("only supports passthrough accessmode")); goto error; } } @@ -2617,7 +2617,7 @@ char *qemuBuildFSStr(virDomainFSDefPtr fs, if (qemuCapsGet(qemuCaps, QEMU_CAPS_FSDEV_WRITEOUT)) { virBufferAsprintf(&opt, ",writeout=%s", wrpolicy); } else { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("filesystem writeout not supported")); goto error; } @@ -2630,9 +2630,9 @@ char *qemuBuildFSStr(virDomainFSDefPtr fs, if (qemuCapsGet(qemuCaps, QEMU_CAPS_FSDEV_READONLY)) { virBufferAddLit(&opt, ",readonly"); } else { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("readonly filesystem is not supported by this " - "QEMU binary")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("readonly filesystem is not supported by this " + "QEMU binary")); goto error; } } @@ -2657,8 +2657,8 @@ qemuBuildFSDevStr(virDomainFSDefPtr fs, virBuffer opt = VIR_BUFFER_INITIALIZER; if (fs->type != VIR_DOMAIN_FS_TYPE_MOUNT) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("can only passthrough directories")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("can only passthrough directories")); goto error; } @@ -2732,8 +2732,8 @@ qemuBuildUSBControllerDevStr(virDomainDefPtr domainDef, caps = qemuControllerModelUSBToCaps(model); if (caps == -1 || !qemuCapsGet(qemuCaps, caps)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("%s not supported in this QEMU binary"), smodel); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("%s not supported in this QEMU binary"), smodel); return -1; } @@ -2778,9 +2778,9 @@ qemuBuildControllerDevStr(virDomainDefPtr domainDef, virBufferAddLit(&buf, "spapr-vscsi"); break; default: - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Unsupported controller model: %s"), - virDomainControllerModelSCSITypeToString(def->model)); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Unsupported controller model: %s"), + virDomainControllerModelSCSITypeToString(def->model)); } virBufferAsprintf(&buf, ",id=scsi%d", def->idx); break; @@ -2826,9 +2826,9 @@ qemuBuildControllerDevStr(virDomainDefPtr domainDef, /* We always get an IDE controller, whether we want it or not. */ case VIR_DOMAIN_CONTROLLER_TYPE_IDE: default: - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Unknown controller type: %s"), - virDomainControllerTypeToString(def->type)); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Unknown controller type: %s"), + virDomainControllerTypeToString(def->type)); goto error; } @@ -2913,13 +2913,13 @@ qemuBuildNicDevStr(virDomainNetDefPtr net, /* this should never happen, if it does, we need * to add another case to this switch. */ - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("unrecognized virtio-net-pci 'tx' option")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("unrecognized virtio-net-pci 'tx' option")); goto error; } } else { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("virtio-net-pci 'tx' option not supported in this QEMU binary")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("virtio-net-pci 'tx' option not supported in this QEMU binary")); goto error; } } @@ -2972,9 +2972,9 @@ qemuBuildHostNetStr(virDomainNetDefPtr net, enum virDomainNetType netType = virDomainNetGetActualType(net); if (net->script && netType != VIR_DOMAIN_NET_TYPE_ETHERNET) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("scripts are not supported on interfaces of type %s"), - virDomainNetTypeToString(netType)); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("scripts are not supported on interfaces of type %s"), + virDomainNetTypeToString(netType)); return NULL; } @@ -3066,8 +3066,8 @@ qemuBuildWatchdogDevStr(virDomainWatchdogDefPtr dev, const char *model = virDomainWatchdogModelTypeToString(dev->model); if (!model) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("missing watchdog model")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("missing watchdog model")); goto error; } @@ -3146,8 +3146,8 @@ qemuBuildSoundDevStr(virDomainSoundDefPtr sound, const char *model = virDomainSoundModelTypeToString(sound->model); if (!model) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("invalid sound model")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("invalid sound model")); goto error; } @@ -3204,8 +3204,8 @@ qemuBuildSoundCodecStr(virDomainSoundDefPtr sound, caps = qemuSoundCodecTypeToCaps(type); if (caps == -1 || !qemuCapsGet(qemuCaps, caps)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("%s not supported in this QEMU binary"), stype); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("%s not supported in this QEMU binary"), stype); goto error; } @@ -3227,8 +3227,8 @@ qemuBuildVideoDevStr(virDomainVideoDefPtr video, const char *model = qemuVideoTypeToString(video->type); if (!model) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("invalid video model")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("invalid video model")); goto error; } @@ -3236,9 +3236,9 @@ qemuBuildVideoDevStr(virDomainVideoDefPtr video, if (video->type == VIR_DOMAIN_VIDEO_TYPE_QXL) { if (video->vram > (UINT_MAX / 1024)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("value for 'vram' must be less than '%u'"), - UINT_MAX / 1024); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("value for 'vram' must be less than '%u'"), + UINT_MAX / 1024); goto error; } @@ -3343,16 +3343,16 @@ qemuBuildRedirdevDevStr(virDomainRedirdevDefPtr dev, virBuffer buf = VIR_BUFFER_INITIALIZER; if (dev->bus != VIR_DOMAIN_REDIRDEV_BUS_USB) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Redirection bus %s is not supported by QEMU"), - virDomainRedirdevBusTypeToString(dev->bus)); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Redirection bus %s is not supported by QEMU"), + virDomainRedirdevBusTypeToString(dev->bus)); goto error; } if (!qemuCapsGet(qemuCaps, QEMU_CAPS_USB_REDIR)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("USB redirection is not supported " - "by this version of QEMU")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("USB redirection is not supported " + "by this version of QEMU")); goto error; } @@ -3383,8 +3383,8 @@ qemuBuildUSBHostdevDevStr(virDomainHostdevDefPtr dev, if (!dev->source.subsys.u.usb.bus && !dev->source.subsys.u.usb.device) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("USB host device is missing bus/device information")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("USB host device is missing bus/device information")); return NULL; } @@ -3416,15 +3416,15 @@ qemuBuildHubDevStr(virDomainHubDefPtr dev, virBuffer buf = VIR_BUFFER_INITIALIZER; if (dev->type != VIR_DOMAIN_HUB_TYPE_USB) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("hub type %s not supported"), - virDomainHubTypeToString(dev->type)); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("hub type %s not supported"), + virDomainHubTypeToString(dev->type)); goto error; } if (!qemuCapsGet(qemuCaps, QEMU_CAPS_USB_HUB)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("usb-hub not supported by QEMU binary")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("usb-hub not supported by QEMU binary")); goto error; } @@ -3453,8 +3453,8 @@ qemuBuildUSBHostdevUsbDevStr(virDomainHostdevDefPtr dev) if (!dev->source.subsys.u.usb.bus && !dev->source.subsys.u.usb.device) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("USB host device is missing bus/device information")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("USB host device is missing bus/device information")); return NULL; } @@ -3552,8 +3552,8 @@ qemuBuildChrChardevStr(virDomainChrSourceDefPtr dev, const char *alias, case VIR_DOMAIN_CHR_TYPE_SPICEVMC: if (!qemuCapsGet(qemuCaps, QEMU_CAPS_CHARDEV_SPICEVMC)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("spicevmc not supported in this QEMU binary")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("spicevmc not supported in this QEMU binary")); goto error; } virBufferAsprintf(&buf, "spicevmc,id=char%s,name=%s", alias, @@ -3561,9 +3561,9 @@ qemuBuildChrChardevStr(virDomainChrSourceDefPtr dev, const char *alias, break; default: - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unsupported chardev '%s'"), - virDomainChrTypeToString(dev->type)); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("unsupported chardev '%s'"), + virDomainChrTypeToString(dev->type)); goto error; } @@ -3689,8 +3689,8 @@ qemuBuildVirtioSerialPortDevStr(virDomainChrDefPtr dev, } break; default: - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("Cannot use virtio serial for parallel/serial devices")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Cannot use virtio serial for parallel/serial devices")); return NULL; } @@ -3700,8 +3700,8 @@ qemuBuildVirtioSerialPortDevStr(virDomainChrDefPtr dev, if (dev->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_SERIAL) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("virtio serial device has invalid address type")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("virtio serial device has invalid address type")); goto error; } @@ -3717,9 +3717,9 @@ qemuBuildVirtioSerialPortDevStr(virDomainChrDefPtr dev, if (dev->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL && dev->source.type == VIR_DOMAIN_CHR_TYPE_SPICEVMC && STRNEQ_NULLABLE(dev->target.name, "com.redhat.spice.0")) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Unsupported spicevmc target name '%s'"), - dev->target.name); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Unsupported spicevmc target name '%s'"), + dev->target.name); goto error; } @@ -3849,9 +3849,9 @@ qemuBuildClockArgStr(virDomainClockDefPtr def) struct tm nowbits; if (def->data.variable.basis != VIR_DOMAIN_CLOCK_BASIS_UTC) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unsupported clock basis '%s'"), - virDomainClockBasisTypeToString(def->data.variable.basis)); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("unsupported clock basis '%s'"), + virDomainClockBasisTypeToString(def->data.variable.basis)); goto error; } now += def->data.variable.adjustment; @@ -3867,9 +3867,9 @@ qemuBuildClockArgStr(virDomainClockDefPtr def) } break; default: - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unsupported clock offset '%s'"), - virDomainClockOffsetTypeToString(def->offset)); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("unsupported clock offset '%s'"), + virDomainClockOffsetTypeToString(def->offset)); goto error; } @@ -3881,9 +3881,9 @@ qemuBuildClockArgStr(virDomainClockDefPtr def) case -1: /* unspecified - use hypervisor default */ break; case VIR_DOMAIN_TIMER_TRACK_BOOT: - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unsupported rtc timer track '%s'"), - virDomainTimerTrackTypeToString(def->timers[i]->track)); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("unsupported rtc timer track '%s'"), + virDomainTimerTrackTypeToString(def->timers[i]->track)); goto error; case VIR_DOMAIN_TIMER_TRACK_GUEST: virBufferAddLit(&buf, ",clock=vm"); @@ -3905,9 +3905,9 @@ qemuBuildClockArgStr(virDomainClockDefPtr def) break; case VIR_DOMAIN_TIMER_TICKPOLICY_MERGE: case VIR_DOMAIN_TIMER_TICKPOLICY_DISCARD: - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unsupported rtc timer tickpolicy '%s'"), - virDomainTimerTickpolicyTypeToString(def->timers[i]->tickpolicy)); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("unsupported rtc timer tickpolicy '%s'"), + virDomainTimerTickpolicyTypeToString(def->timers[i]->tickpolicy)); goto error; } break; /* no need to check other timers - there is only one rtc */ @@ -3969,8 +3969,8 @@ qemuBuildCpuArgStr(const struct qemud_driver *driver, goto cleanup; if (!ncpus || !host) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("CPU specification not supported by hypervisor")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("CPU specification not supported by hypervisor")); goto cleanup; } @@ -3986,12 +3986,12 @@ qemuBuildCpuArgStr(const struct qemud_driver *driver, switch (cmp) { case VIR_CPU_COMPARE_INCOMPATIBLE: if (compare_msg) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("guest and host CPU are not compatible: %s"), - compare_msg); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("guest and host CPU are not compatible: %s"), + compare_msg); } else { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("guest CPU is not compatible with host CPU")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("guest CPU is not compatible with host CPU")); } /* fall through */ case VIR_CPU_COMPARE_ERROR: @@ -4012,15 +4012,15 @@ qemuBuildCpuArgStr(const struct qemud_driver *driver, if (cpu->mode == VIR_CPU_MODE_HOST_PASSTHROUGH) { const char *mode = virCPUModeTypeToString(cpu->mode); if (!qemuCapsGet(qemuCaps, QEMU_CAPS_CPU_HOST)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("CPU mode '%s' is not supported by QEMU" - " binary"), mode); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("CPU mode '%s' is not supported by QEMU" + " binary"), mode); goto cleanup; } if (def->virtType != VIR_DOMAIN_VIRT_KVM) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("CPU mode '%s' is only supported with kvm"), - mode); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("CPU mode '%s' is only supported with kvm"), + mode); goto cleanup; } virBufferAddLit(&buf, "host"); @@ -4145,9 +4145,9 @@ qemuBuildSmpArgStr(const virDomainDefPtr def, } else if (def->vcpus != def->maxvcpus) { virBufferFreeAndReset(&buf); /* FIXME - consider hot-unplugging cpus after boot for older qemu */ - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("setting current vcpu count less than maximum is " - "not supported with this QEMU binary")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("setting current vcpu count less than maximum is " + "not supported with this QEMU binary")); return NULL; } @@ -4286,9 +4286,9 @@ qemuBuildCommandLine(virConnectPtr conn, if (qemuCapsGet(qemuCaps, QEMU_CAPS_ENABLE_KQEMU)) { enableKQEMU = 1; } else if (!qemuCapsGet(qemuCaps, QEMU_CAPS_KQEMU)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("the QEMU binary %s does not support kqemu"), - emulator); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("the QEMU binary %s does not support kqemu"), + emulator); } break; @@ -4299,9 +4299,9 @@ qemuBuildCommandLine(virConnectPtr conn, if (qemuCapsGet(qemuCaps, QEMU_CAPS_ENABLE_KVM)) { enableKVM = 1; } else if (!qemuCapsGet(qemuCaps, QEMU_CAPS_KVM)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("the QEMU binary %s does not support kvm"), - emulator); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("the QEMU binary %s does not support kvm"), + emulator); } break; @@ -4310,9 +4310,9 @@ qemuBuildCommandLine(virConnectPtr conn, break; default: - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("the QEMU binary %s does not support %s"), - emulator, virDomainVirtTypeToString(def->virtType)); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("the QEMU binary %s does not support %s"), + emulator, virDomainVirtTypeToString(def->virtType)); break; } @@ -4376,19 +4376,19 @@ qemuBuildCommandLine(virConnectPtr conn, virCommandAddArgFormat(cmd, "%llu", def->mem.max_balloon / 1024); if (def->mem.hugepage_backed) { if (!driver->hugetlbfs_mount) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("hugetlbfs filesystem is not mounted")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("hugetlbfs filesystem is not mounted")); goto error; } if (!driver->hugepage_path) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("hugepages are disabled by administrator config")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("hugepages are disabled by administrator config")); goto error; } if (!qemuCapsGet(qemuCaps, QEMU_CAPS_MEM_PATH)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("hugepage backing not supported by '%s'"), - def->emulator); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("hugepage backing not supported by '%s'"), + def->emulator); goto error; } virCommandAddArgList(cmd, "-mem-prealloc", "-mem-path", @@ -4418,9 +4418,9 @@ qemuBuildCommandLine(virConnectPtr conn, virCommandAddArg(cmd, "-xen-domid"); virCommandAddArgFormat(cmd, "%d", def->id); } else { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("qemu emulator '%s' does not support xen"), - def->emulator); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("qemu emulator '%s' does not support xen"), + def->emulator); goto error; } } @@ -4431,17 +4431,17 @@ qemuBuildCommandLine(virConnectPtr conn, bool skip_uuid = false; if (!qemuCapsGet(qemuCaps, QEMU_CAPS_SMBIOS_TYPE)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("the QEMU binary %s does not support smbios settings"), - emulator); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("the QEMU binary %s does not support smbios settings"), + emulator); goto error; } /* should we really error out or just warn in those cases ? */ if (def->os.smbios_mode == VIR_DOMAIN_SMBIOS_HOST) { if (driver->hostsysinfo == NULL) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("Host SMBIOS information is not available")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Host SMBIOS information is not available")); goto error; } source = driver->hostsysinfo; @@ -4449,8 +4449,8 @@ qemuBuildCommandLine(virConnectPtr conn, skip_uuid = true; } else if (def->os.smbios_mode == VIR_DOMAIN_SMBIOS_SYSINFO) { if (def->sysinfo == NULL) { - qemuReportError(VIR_ERR_XML_ERROR, - _("Domain '%s' sysinfo are not available"), + virReportError(VIR_ERR_XML_ERROR, + _("Domain '%s' sysinfo are not available"), def->name); goto error; } @@ -4495,18 +4495,18 @@ qemuBuildCommandLine(virConnectPtr conn, /* Serial graphics adapter */ if (def->os.bios.useserial == VIR_DOMAIN_BIOS_USESERIAL_YES) { if (!qemuCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("qemu does not support -device")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("qemu does not support -device")); goto error; } if (!qemuCapsGet(qemuCaps, QEMU_CAPS_SGA)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("qemu does not support SGA")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("qemu does not support SGA")); goto error; } if (!def->nserials) { - qemuReportError(VIR_ERR_XML_ERROR, "%s", - _("need at least one serial port to use SGA")); + virReportError(VIR_ERR_XML_ERROR, "%s", + _("need at least one serial port to use SGA")); goto error; } virCommandAddArgList(cmd, "-device", "sga", NULL); @@ -4560,9 +4560,9 @@ qemuBuildCommandLine(virConnectPtr conn, break; default: - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unsupported clock offset '%s'"), - virDomainClockOffsetTypeToString(def->clock.offset)); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("unsupported clock offset '%s'"), + virDomainClockOffsetTypeToString(def->clock.offset)); goto error; } } @@ -4576,9 +4576,9 @@ qemuBuildCommandLine(virConnectPtr conn, default: case VIR_DOMAIN_TIMER_NAME_PLATFORM: case VIR_DOMAIN_TIMER_NAME_TSC: - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unsupported timer type (name) '%s'"), - virDomainTimerNameTypeToString(def->clock.timers[i]->name)); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("unsupported timer type (name) '%s'"), + virDomainTimerNameTypeToString(def->clock.timers[i]->name)); goto error; case VIR_DOMAIN_TIMER_NAME_KVMCLOCK: @@ -4600,9 +4600,9 @@ qemuBuildCommandLine(virConnectPtr conn, break; case VIR_DOMAIN_TIMER_TICKPOLICY_MERGE: case VIR_DOMAIN_TIMER_TICKPOLICY_DISCARD: - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unsupported rtc tickpolicy '%s'"), - virDomainTimerTickpolicyTypeToString(def->clock.timers[i]->tickpolicy)); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("unsupported rtc tickpolicy '%s'"), + virDomainTimerTickpolicyTypeToString(def->clock.timers[i]->tickpolicy)); goto error; } } else if (!qemuCapsGet(qemuCaps, QEMU_CAPS_RTC) @@ -4611,9 +4611,9 @@ qemuBuildCommandLine(virConnectPtr conn, && (def->clock.timers[i]->tickpolicy != -1)) { /* a non-default rtc policy was given, but there is no way to implement it in this version of qemu */ - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unsupported rtc tickpolicy '%s'"), - virDomainTimerTickpolicyTypeToString(def->clock.timers[i]->tickpolicy)); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("unsupported rtc tickpolicy '%s'"), + virDomainTimerTickpolicyTypeToString(def->clock.timers[i]->tickpolicy)); goto error; } break; @@ -4635,18 +4635,18 @@ qemuBuildCommandLine(virConnectPtr conn, virCommandAddArg(cmd, "-tdf"); } else { /* can't catchup if we have neither pit mode */ - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unsupported pit tickpolicy '%s'"), - virDomainTimerTickpolicyTypeToString(def->clock.timers[i]->tickpolicy)); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("unsupported pit tickpolicy '%s'"), + virDomainTimerTickpolicyTypeToString(def->clock.timers[i]->tickpolicy)); goto error; } break; case VIR_DOMAIN_TIMER_TICKPOLICY_MERGE: case VIR_DOMAIN_TIMER_TICKPOLICY_DISCARD: /* no way to support these modes for pit in qemu */ - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unsupported pit tickpolicy '%s'"), - virDomainTimerTickpolicyTypeToString(def->clock.timers[i]->tickpolicy)); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("unsupported pit tickpolicy '%s'"), + virDomainTimerTickpolicyTypeToString(def->clock.timers[i]->tickpolicy)); goto error; } break; @@ -4666,8 +4666,8 @@ qemuBuildCommandLine(virConnectPtr conn, /* no hpet timer available. The only possible action is to raise an error if present="yes" */ if (def->clock.timers[i]->present == 1) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", _("pit timer is not supported")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + "%s", _("pit timer is not supported")); } } break; @@ -4701,8 +4701,8 @@ qemuBuildCommandLine(virConnectPtr conn, * configuration is used */ if (!qemuCapsGet(qemuCaps, QEMU_CAPS_BOOTINDEX)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("hypervisor lacks deviceboot feature")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("hypervisor lacks deviceboot feature")); goto error; } emitBootindex = true; @@ -4767,9 +4767,9 @@ qemuBuildCommandLine(virConnectPtr conn, if (disk->driverName != NULL && !STREQ(disk->driverName, "qemu")) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unsupported driver name '%s' for disk '%s'"), - disk->driverName, disk->src); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("unsupported driver name '%s' for disk '%s'"), + disk->driverName, disk->src); goto error; } } @@ -4788,8 +4788,8 @@ qemuBuildCommandLine(virConnectPtr conn, /* Only recent QEMU implements a SATA (AHCI) controller */ if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_SATA) { if (!qemuCapsGet(qemuCaps, QEMU_CAPS_ICH9_AHCI)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", _("SATA is not supported with this QEMU binary")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + "%s", _("SATA is not supported with this QEMU binary")); goto error; } else { char *devstr; @@ -4805,8 +4805,8 @@ qemuBuildCommandLine(virConnectPtr conn, def->controllers[i]->model == -1 && !qemuCapsGet(qemuCaps, QEMU_CAPS_PIIX3_USB_UHCI)) { if (usblegacy) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Multiple legacy USB controller not supported")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Multiple legacy USB controller not supported")); goto error; } usblegacy = true; @@ -4861,9 +4861,9 @@ qemuBuildCommandLine(virConnectPtr conn, virCommandAddArg(cmd, "-usbdevice"); virCommandAddArgFormat(cmd, "disk:%s", disk->src); } else { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unsupported usb disk type for '%s'"), - disk->src); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unsupported usb disk type for '%s'"), + disk->src); goto error; } continue; @@ -4950,9 +4950,9 @@ qemuBuildCommandLine(virConnectPtr conn, if ((disk->type == VIR_DOMAIN_DISK_TYPE_BLOCK) && (disk->tray_status == VIR_DOMAIN_DISK_TRAY_OPEN)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("tray status 'open' is invalid for " - "block type disk")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("tray status 'open' is invalid for " + "block type disk")); goto error; } @@ -4961,9 +4961,9 @@ qemuBuildCommandLine(virConnectPtr conn, virCommandAddArg(cmd, "-usbdevice"); virCommandAddArgFormat(cmd, "disk:%s", disk->src); } else { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unsupported usb disk type for '%s'"), - disk->src); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unsupported usb disk type for '%s'"), + disk->src); goto error; } continue; @@ -4981,8 +4981,8 @@ qemuBuildCommandLine(virConnectPtr conn, STRPREFIX(disk->dst, "fd")) { snprintf(dev, NAME_MAX, "-%s", disk->dst); } else { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unsupported disk type '%s'"), disk->dst); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unsupported disk type '%s'"), disk->dst); goto error; } } @@ -4991,14 +4991,14 @@ qemuBuildCommandLine(virConnectPtr conn, /* QEMU only supports magic FAT format for now */ if (disk->driverType && STRNEQ(disk->driverType, "fat")) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unsupported disk driver type for '%s'"), - disk->driverType); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unsupported disk driver type for '%s'"), + disk->driverType); goto error; } if (!disk->readonly) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("cannot create virtual FAT disks in read-write mode")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("cannot create virtual FAT disks in read-write mode")); goto error; } if (disk->device == VIR_DOMAIN_DISK_DEVICE_FLOPPY) @@ -5013,8 +5013,8 @@ qemuBuildCommandLine(virConnectPtr conn, switch (disk->protocol) { case VIR_DOMAIN_DISK_PROTOCOL_NBD: if (disk->nhosts != 1) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("NBD accepts only one host")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("NBD accepts only one host")); goto error; } if (virAsprintf(&file, "nbd:%s:%s,", disk->hosts->name, @@ -5085,8 +5085,8 @@ qemuBuildCommandLine(virConnectPtr conn, } } else { if (def->nfss) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("filesystem passthrough not supported by this QEMU")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("filesystem passthrough not supported by this QEMU")); goto error; } } @@ -5248,9 +5248,9 @@ qemuBuildCommandLine(virConnectPtr conn, smartcard->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCID || smartcard->info.addr.ccid.controller != 0 || smartcard->info.addr.ccid.slot != 0) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("this QEMU binary lacks multiple smartcard " - "support")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("this QEMU binary lacks multiple smartcard " + "support")); virBufferFreeAndReset(&opt); goto error; } @@ -5259,9 +5259,9 @@ qemuBuildCommandLine(virConnectPtr conn, case VIR_DOMAIN_SMARTCARD_TYPE_HOST: if (!qemuCapsGet(qemuCaps, QEMU_CAPS_CHARDEV) || !qemuCapsGet(qemuCaps, QEMU_CAPS_CCID_EMULATED)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("this QEMU binary lacks smartcard host " - "mode support")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("this QEMU binary lacks smartcard host " + "mode support")); goto error; } @@ -5271,9 +5271,9 @@ qemuBuildCommandLine(virConnectPtr conn, case VIR_DOMAIN_SMARTCARD_TYPE_HOST_CERTIFICATES: if (!qemuCapsGet(qemuCaps, QEMU_CAPS_CHARDEV) || !qemuCapsGet(qemuCaps, QEMU_CAPS_CCID_EMULATED)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("this QEMU binary lacks smartcard host " - "mode support")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("this QEMU binary lacks smartcard host " + "mode support")); goto error; } @@ -5281,9 +5281,9 @@ qemuBuildCommandLine(virConnectPtr conn, for (j = 0; j < VIR_DOMAIN_SMARTCARD_NUM_CERTIFICATES; j++) { if (strchr(smartcard->data.cert.file[j], ',')) { virBufferFreeAndReset(&opt); - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("invalid certificate name: %s"), - smartcard->data.cert.file[j]); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("invalid certificate name: %s"), + smartcard->data.cert.file[j]); goto error; } virBufferAsprintf(&opt, ",cert%d=%s", j + 1, @@ -5292,9 +5292,9 @@ qemuBuildCommandLine(virConnectPtr conn, if (smartcard->data.cert.database) { if (strchr(smartcard->data.cert.database, ',')) { virBufferFreeAndReset(&opt); - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("invalid database name: %s"), - smartcard->data.cert.database); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("invalid database name: %s"), + smartcard->data.cert.database); goto error; } database = smartcard->data.cert.database; @@ -5307,9 +5307,9 @@ qemuBuildCommandLine(virConnectPtr conn, case VIR_DOMAIN_SMARTCARD_TYPE_PASSTHROUGH: if (!qemuCapsGet(qemuCaps, QEMU_CAPS_CHARDEV) || !qemuCapsGet(qemuCaps, QEMU_CAPS_CCID_PASSTHRU)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("this QEMU binary lacks smartcard " - "passthrough mode support")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("this QEMU binary lacks smartcard " + "passthrough mode support")); goto error; } @@ -5328,9 +5328,9 @@ qemuBuildCommandLine(virConnectPtr conn, break; default: - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected smartcard type %d"), - smartcard->type); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unexpected smartcard type %d"), + smartcard->type); virBufferFreeAndReset(&opt); goto error; } @@ -5420,8 +5420,8 @@ qemuBuildCommandLine(virConnectPtr conn, case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_GUESTFWD: if (!qemuCapsGet(qemuCaps, QEMU_CAPS_CHARDEV) || !qemuCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", _("guestfwd requires QEMU to support -chardev & -device")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + "%s", _("guestfwd requires QEMU to support -chardev & -device")); goto error; } @@ -5448,8 +5448,8 @@ qemuBuildCommandLine(virConnectPtr conn, case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO: if (!qemuCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("virtio channel requires QEMU to support -device")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("virtio channel requires QEMU to support -device")); goto error; } @@ -5487,8 +5487,8 @@ qemuBuildCommandLine(virConnectPtr conn, switch(console->targetType) { case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO: if (!qemuCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("virtio channel requires QEMU to support -device")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("virtio channel requires QEMU to support -device")); goto error; } @@ -5512,9 +5512,9 @@ qemuBuildCommandLine(virConnectPtr conn, break; default: - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unsupported console target type %s"), - NULLSTR(virDomainChrConsoleTargetTypeToString(console->targetType))); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("unsupported console target type %s"), + NULLSTR(virDomainChrConsoleTargetTypeToString(console->targetType))); goto error; } } @@ -5553,8 +5553,8 @@ qemuBuildCommandLine(virConnectPtr conn, } if (def->ngraphics > 1) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("only 1 graphics device is supported")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("only 1 graphics device is supported")); goto error; } @@ -5592,15 +5592,15 @@ qemuBuildCommandLine(virConnectPtr conn, break; ret = networkGetNetworkAddress(listenNetwork, &netAddr); if (ret <= -2) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", _("network-based listen not possible, " - "network driver not present")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + "%s", _("network-based listen not possible, " + "network driver not present")); goto error; } if (ret < 0) { - qemuReportError(VIR_ERR_XML_ERROR, - _("listen network '%s' had no usable address"), - listenNetwork); + virReportError(VIR_ERR_XML_ERROR, + _("listen network '%s' had no usable address"), + listenNetwork); goto error; } listenAddr = netAddr; @@ -5676,9 +5676,9 @@ qemuBuildCommandLine(virConnectPtr conn, def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_SDL) { if (qemuCapsGet(qemuCaps, QEMU_CAPS_0_10) && !qemuCapsGet(qemuCaps, QEMU_CAPS_SDL)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("sdl not supported by '%s'"), - def->emulator); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("sdl not supported by '%s'"), + def->emulator); goto error; } @@ -5714,8 +5714,8 @@ qemuBuildCommandLine(virConnectPtr conn, int defaultMode = def->graphics[0]->data.spice.defaultMode; if (!qemuCapsGet(qemuCaps, QEMU_CAPS_SPICE)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("spice graphics are not supported with this QEMU")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("spice graphics are not supported with this QEMU")); goto error; } @@ -5723,9 +5723,9 @@ qemuBuildCommandLine(virConnectPtr conn, if (def->graphics[0]->data.spice.tlsPort > 0) { if (!driver->spiceTLS) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("spice TLS port set in XML configuration," - " but TLS is disabled in qemu.conf")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("spice TLS port set in XML configuration," + " but TLS is disabled in qemu.conf")); goto error; } virBufferAsprintf(&opt, ",tls-port=%u", @@ -5743,15 +5743,15 @@ qemuBuildCommandLine(virConnectPtr conn, break; ret = networkGetNetworkAddress(listenNetwork, &netAddr); if (ret <= -2) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", _("network-based listen not possible, " - "network driver not present")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + "%s", _("network-based listen not possible, " + "network driver not present")); goto error; } if (ret < 0) { - qemuReportError(VIR_ERR_XML_ERROR, - _("listen network '%s' had no usable address"), - listenNetwork); + virReportError(VIR_ERR_XML_ERROR, + _("listen network '%s' had no usable address"), + listenNetwork); goto error; } listenAddr = netAddr; @@ -5812,8 +5812,8 @@ qemuBuildCommandLine(virConnectPtr conn, switch (mode) { case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_SECURE: if (!driver->spiceTLS) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("spice secure channels set in XML configuration, but TLS is disabled in qemu.conf")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("spice secure channels set in XML configuration, but TLS is disabled in qemu.conf")); goto error; } virBufferAsprintf(&opt, ",tls-channel=%s", @@ -5854,9 +5854,9 @@ qemuBuildCommandLine(virConnectPtr conn, virCommandAddEnvString(cmd, "QEMU_AUDIO_DRV=spice"); } else if ((def->ngraphics == 1)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unsupported graphics type '%s'"), - virDomainGraphicsTypeToString(def->graphics[0]->type)); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("unsupported graphics type '%s'"), + virDomainGraphicsTypeToString(def->graphics[0]->type)); goto error; } @@ -5867,16 +5867,16 @@ qemuBuildCommandLine(virConnectPtr conn, } else { if ((def->videos[0]->type == VIR_DOMAIN_VIDEO_TYPE_QXL) && !qemuCapsGet(qemuCaps, QEMU_CAPS_VGA_QXL)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("This QEMU does not support QXL graphics adapters")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("This QEMU does not support QXL graphics adapters")); goto error; } const char *vgastr = qemuVideoTypeToString(def->videos[0]->type); if (!vgastr || STREQ(vgastr, "")) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("video type %s is not supported with QEMU"), - virDomainVideoTypeToString(def->videos[0]->type)); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("video type %s is not supported with QEMU"), + virDomainVideoTypeToString(def->videos[0]->type)); goto error; } @@ -5886,9 +5886,9 @@ qemuBuildCommandLine(virConnectPtr conn, if (def->videos[0]->vram && qemuCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) { if (def->videos[0]->vram > (UINT_MAX / 1024)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("value for 'vram' must be less than '%u'"), - UINT_MAX / 1024); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("value for 'vram' must be less than '%u'"), + UINT_MAX / 1024); goto error; } @@ -5920,9 +5920,9 @@ qemuBuildCommandLine(virConnectPtr conn, break; default: - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("video type %s is not supported with this QEMU"), - virDomainVideoTypeToString(def->videos[0]->type)); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("video type %s is not supported with this QEMU"), + virDomainVideoTypeToString(def->videos[0]->type)); goto error; } } @@ -5932,9 +5932,9 @@ qemuBuildCommandLine(virConnectPtr conn, for (i = 1 ; i < def->nvideos ; i++) { char *str; if (def->videos[i]->type != VIR_DOMAIN_VIDEO_TYPE_QXL) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("video type %s is only valid as primary video card"), - virDomainVideoTypeToString(def->videos[0]->type)); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("video type %s is only valid as primary video card"), + virDomainVideoTypeToString(def->videos[0]->type)); goto error; } @@ -5947,8 +5947,8 @@ qemuBuildCommandLine(virConnectPtr conn, VIR_FREE(str); } } else { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", _("only one video card is currently supported")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + "%s", _("only one video card is currently supported")); goto error; } } @@ -6022,15 +6022,15 @@ qemuBuildCommandLine(virConnectPtr conn, const char *model = virDomainSoundModelTypeToString(sound->model); if (!model) { VIR_FREE(modstr); - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("invalid sound model")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("invalid sound model")); goto error; } if (sound->model == VIR_DOMAIN_SOUND_MODEL_ICH6) { VIR_FREE(modstr); - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("this QEMU binary lacks hda support")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("this QEMU binary lacks hda support")); goto error; } @@ -6060,8 +6060,8 @@ qemuBuildCommandLine(virConnectPtr conn, const char *model = virDomainWatchdogModelTypeToString(watchdog->model); if (!model) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("missing watchdog model")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("missing watchdog model")); goto error; } @@ -6076,8 +6076,8 @@ qemuBuildCommandLine(virConnectPtr conn, act = VIR_DOMAIN_WATCHDOG_ACTION_PAUSE; const char *action = virDomainWatchdogActionTypeToString(act); if (!action) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("invalid watchdog action")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("invalid watchdog action")); goto error; } virCommandAddArgList(cmd, "-watchdog-action", action, NULL); @@ -6117,14 +6117,14 @@ qemuBuildCommandLine(virConnectPtr conn, if (hostdev->info->bootIndex) { if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS || hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("booting from assigned devices is only" - " supported for PCI devices")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("booting from assigned devices is only" + " supported for PCI devices")); goto error; } else if (!qemuCapsGet(qemuCaps, QEMU_CAPS_PCI_BOOTINDEX)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("booting from assigned PCI devices is not" - " supported with this version of qemu")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("booting from assigned PCI devices is not" + " supported with this version of qemu")); goto error; } } @@ -6179,8 +6179,8 @@ qemuBuildCommandLine(virConnectPtr conn, virCommandAddArg(cmd, devstr); VIR_FREE(devstr); } else { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("PCI device assignment is not supported by this version of qemu")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("PCI device assignment is not supported by this version of qemu")); goto error; } } @@ -6193,9 +6193,9 @@ qemuBuildCommandLine(virConnectPtr conn, virCommandAddArg(cmd, "-incoming"); if (STRPREFIX(migrateFrom, "tcp")) { if (!qemuCapsGet(qemuCaps, QEMU_CAPS_MIGRATE_QEMU_TCP)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", _("TCP migration is not supported with " - "this QEMU binary")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + "%s", _("TCP migration is not supported with " + "this QEMU binary")); goto error; } virCommandAddArg(cmd, migrateFrom); @@ -6210,39 +6210,39 @@ qemuBuildCommandLine(virConnectPtr conn, virCommandAddArg(cmd, migrateFrom); virCommandSetInputFD(cmd, migrateFd); } else { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", _("STDIO migration is not supported " - "with this QEMU binary")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + "%s", _("STDIO migration is not supported " + "with this QEMU binary")); goto error; } } else if (STRPREFIX(migrateFrom, "exec")) { if (!qemuCapsGet(qemuCaps, QEMU_CAPS_MIGRATE_QEMU_EXEC)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", _("EXEC migration is not supported " - "with this QEMU binary")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + "%s", _("EXEC migration is not supported " + "with this QEMU binary")); goto error; } virCommandAddArg(cmd, migrateFrom); } else if (STRPREFIX(migrateFrom, "fd")) { if (!qemuCapsGet(qemuCaps, QEMU_CAPS_MIGRATE_QEMU_FD)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", _("FD migration is not supported " - "with this QEMU binary")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + "%s", _("FD migration is not supported " + "with this QEMU binary")); goto error; } virCommandAddArg(cmd, migrateFrom); virCommandPreserveFD(cmd, migrateFd); } else if (STRPREFIX(migrateFrom, "unix")) { if (!qemuCapsGet(qemuCaps, QEMU_CAPS_MIGRATE_QEMU_UNIX)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", _("UNIX migration is not supported " - "with this QEMU binary")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + "%s", _("UNIX migration is not supported " + "with this QEMU binary")); goto error; } virCommandAddArg(cmd, migrateFrom); } else { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("unknown migration protocol")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("unknown migration protocol")); goto error; } } @@ -6256,9 +6256,9 @@ qemuBuildCommandLine(virConnectPtr conn, if ((def->memballoon) && (def->memballoon->model != VIR_DOMAIN_MEMBALLOON_MODEL_NONE)) { if (def->memballoon->model != VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Memory balloon device type '%s' is not supported by this version of qemu"), - virDomainMemballoonModelTypeToString(def->memballoon->model)); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Memory balloon device type '%s' is not supported by this version of qemu"), + virDomainMemballoonModelTypeToString(def->memballoon->model)); goto error; } if (qemuCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) { @@ -6516,8 +6516,8 @@ qemuParseKeywords(const char *str, if (separator >= endmark) { if (!allowEmptyValue) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("malformed keyword arguments in '%s'"), str); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("malformed keyword arguments in '%s'"), str); goto error; } separator = endmark; @@ -6629,9 +6629,9 @@ qemuParseCommandLineDisk(virCapsPtr caps, host = def->src + strlen("nbd:"); port = strchr(host, ':'); if (!port) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot parse nbd filename '%s'"), - def->src); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot parse nbd filename '%s'"), + def->src); def = NULL; goto cleanup; } @@ -6688,8 +6688,8 @@ qemuParseCommandLineDisk(virCapsPtr caps, vdi = strchr(port, ':'); if (!vdi) { def = NULL; - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot parse sheepdog filename '%s'"), p); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot parse sheepdog filename '%s'"), p); goto cleanup; } *vdi++ = '\0'; @@ -6775,24 +6775,24 @@ qemuParseCommandLineDisk(virCapsPtr caps, if (virStrToLong_i(values[i], NULL, 10, &idx) < 0) { virDomainDiskDefFree(def); def = NULL; - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot parse drive index '%s'"), val); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot parse drive index '%s'"), val); goto cleanup; } } else if (STREQ(keywords[i], "bus")) { if (virStrToLong_i(values[i], NULL, 10, &busid) < 0) { virDomainDiskDefFree(def); def = NULL; - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot parse drive bus '%s'"), val); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot parse drive bus '%s'"), val); goto cleanup; } } else if (STREQ(keywords[i], "unit")) { if (virStrToLong_i(values[i], NULL, 10, &unitid) < 0) { virDomainDiskDefFree(def); def = NULL; - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot parse drive unit '%s'"), val); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot parse drive unit '%s'"), val); goto cleanup; } } else if (STREQ(keywords[i], "readonly")) { @@ -6800,8 +6800,8 @@ qemuParseCommandLineDisk(virCapsPtr caps, def->readonly = 1; } else if (STREQ(keywords[i], "aio")) { if ((def->iomode = virDomainDiskIoTypeFromString(values[i])) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot parse io mode '%s'"), values[i]); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot parse io mode '%s'"), values[i]); } } } @@ -6812,8 +6812,8 @@ qemuParseCommandLineDisk(virCapsPtr caps, if (!def->src && def->device == VIR_DOMAIN_DISK_DEVICE_DISK && def->type != VIR_DOMAIN_DISK_TYPE_NETWORK) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("missing file parameter in drive '%s'"), val); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("missing file parameter in drive '%s'"), val); virDomainDiskDefFree(def); def = NULL; goto cleanup; @@ -6825,8 +6825,8 @@ qemuParseCommandLineDisk(virCapsPtr caps, if (idx == -1 && unitid == -1 && busid == -1) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("missing index/unit/bus parameter in drive '%s'"), val); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("missing index/unit/bus parameter in drive '%s'"), val); virDomainDiskDefFree(def); def = NULL; goto cleanup; @@ -6874,8 +6874,8 @@ qemuParseCommandLineDisk(virCapsPtr caps, def->dst[2] = 'a' + idx; if (virDomainDiskDefAssignAddress(caps, def) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("invalid device name '%s'"), def->dst); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("invalid device name '%s'"), def->dst); virDomainDiskDefFree(def); def = NULL; /* fall through to "cleanup" */ @@ -6910,8 +6910,8 @@ qemuFindNICForVLAN(int nnics, tmp += strlen("vlan="); if (virStrToLong_i(tmp, &end, 10, &gotvlan) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot parse NIC vlan in '%s'"), nics[i]); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot parse NIC vlan in '%s'"), nics[i]); return NULL; } @@ -6922,8 +6922,8 @@ qemuFindNICForVLAN(int nnics, if (wantvlan == 0 && nnics > 0) return nics[0]; - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot find NIC definition for vlan %d"), wantvlan); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot find NIC definition for vlan %d"), wantvlan); return NULL; } @@ -6979,8 +6979,8 @@ qemuParseCommandLineNet(virCapsPtr caps, for (i = 0 ; i < nkeywords ; i++) { if (STREQ(keywords[i], "vlan")) { if (virStrToLong_i(values[i], NULL, 10, &wantvlan) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot parse vlan in '%s'"), val); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot parse vlan in '%s'"), val); virDomainNetDefFree(def); def = NULL; goto cleanup; @@ -7009,8 +7009,8 @@ qemuParseCommandLineNet(virCapsPtr caps, } if (!STRPREFIX(nic, "nic")) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot parse NIC definition '%s'"), nic); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot parse NIC definition '%s'"), nic); virDomainNetDefFree(def); def = NULL; goto cleanup; @@ -7039,9 +7039,9 @@ qemuParseCommandLineNet(virCapsPtr caps, if (STREQ(keywords[i], "macaddr")) { genmac = 0; if (virMacAddrParse(values[i], &def->mac) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unable to parse mac address '%s'"), - values[i]); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unable to parse mac address '%s'"), + values[i]); virDomainNetDefFree(def); def = NULL; goto cleanup; @@ -7057,8 +7057,8 @@ qemuParseCommandLineNet(virCapsPtr caps, } } else if (STREQ(keywords[i], "sndbuf") && values[i]) { if (virStrToLong_ul(values[i], NULL, 10, &def->tune.sndbuf) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot parse sndbuf size in '%s'"), val); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot parse sndbuf size in '%s'"), val); virDomainNetDefFree(def); def = NULL; goto cleanup; @@ -7096,27 +7096,27 @@ qemuParseCommandLinePCI(const char *val) goto error; if (!STRPREFIX(val, "host=")) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unknown PCI device syntax '%s'"), val); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unknown PCI device syntax '%s'"), val); goto error; } start = val + strlen("host="); if (virStrToLong_i(start, &end, 16, &bus) < 0 || *end != ':') { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot extract PCI device bus '%s'"), val); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot extract PCI device bus '%s'"), val); goto error; } start = end + 1; if (virStrToLong_i(start, &end, 16, &slot) < 0 || *end != '.') { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot extract PCI device slot '%s'"), val); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot extract PCI device slot '%s'"), val); goto error; } start = end + 1; if (virStrToLong_i(start, NULL, 16, &func) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot extract PCI device function '%s'"), val); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot extract PCI device function '%s'"), val); goto error; } @@ -7149,34 +7149,34 @@ qemuParseCommandLineUSB(const char *val) goto error; if (!STRPREFIX(val, "host:")) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unknown USB device syntax '%s'"), val); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unknown USB device syntax '%s'"), val); goto error; } start = val + strlen("host:"); if (strchr(start, ':')) { if (virStrToLong_i(start, &end, 16, &first) < 0 || *end != ':') { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot extract USB device vendor '%s'"), val); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot extract USB device vendor '%s'"), val); goto error; } start = end + 1; if (virStrToLong_i(start, NULL, 16, &second) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot extract USB device product '%s'"), val); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot extract USB device product '%s'"), val); goto error; } } else { if (virStrToLong_i(start, &end, 10, &first) < 0 || *end != '.') { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot extract USB device bus '%s'"), val); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot extract USB device bus '%s'"), val); goto error; } start = end + 1; if (virStrToLong_i(start, NULL, 10, &second) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot extract USB device address '%s'"), val); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot extract USB device address '%s'"), val); goto error; } } @@ -7280,8 +7280,8 @@ qemuParseCommandLineChr(virDomainChrSourceDefPtr source, } svc = strchr(val, ':'); if (!svc) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot find port number in character device %s"), val); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot find port number in character device %s"), val); goto error; } opt = strchr(svc, ','); @@ -7320,8 +7320,8 @@ qemuParseCommandLineChr(virDomainChrSourceDefPtr source, if (!source->data.file.path) goto no_memory; } else { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unknown character device syntax %s"), val); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unknown character device syntax %s"), val); goto error; } @@ -7432,8 +7432,8 @@ qemuParseCommandLineCPU(virDomainDefPtr dom, if (dom->clock.timers[i]->present != -1 && dom->clock.timers[i]->present != present) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("conflicting occurrences of kvmclock feature")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("conflicting occurrences of kvmclock feature")); goto error; } dom->clock.timers[i]->present = present; @@ -7482,8 +7482,8 @@ qemuParseCommandLineCPU(virDomainDefPtr dom, return 0; syntax: - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unknown CPU syntax '%s'"), val); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unknown CPU syntax '%s'"), val); goto error; no_memory: @@ -7561,8 +7561,8 @@ cleanup: return ret; syntax: - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot parse CPU topology '%s'"), val); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot parse CPU topology '%s'"), val); error: ret = -1; goto cleanup; @@ -7602,8 +7602,8 @@ virDomainDefPtr qemuParseCommandLine(virCapsPtr caps, *monJSON = false; if (!progargv[0]) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("no emulator path found")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("no emulator path found")); return NULL; } @@ -7615,8 +7615,8 @@ virDomainDefPtr qemuParseCommandLine(virCapsPtr caps, goto no_memory; if (virUUIDGenerate(def->uuid) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("failed to generate uuid")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("failed to generate uuid")); goto error; } @@ -7668,8 +7668,8 @@ virDomainDefPtr qemuParseCommandLine(virCapsPtr caps, #define WANT_VALUE() \ const char *val = progargv[++i]; \ if (!val) { \ - qemuReportError(VIR_ERR_INTERNAL_ERROR, \ - _("missing value for %s argument"), arg); \ + virReportError(VIR_ERR_INTERNAL_ERROR, \ + _("missing value for %s argument"), arg); \ goto error; \ } @@ -7728,15 +7728,15 @@ virDomainDefPtr qemuParseCommandLine(virCapsPtr caps, tmp = strstr(val, sep); if (!tmp) { virDomainGraphicsDefFree(vnc); - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("missing VNC port number in '%s'"), val); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("missing VNC port number in '%s'"), val); goto error; } if (virStrToLong_i(tmp+strlen(sep), &opts, 10, &vnc->data.vnc.port) < 0) { virDomainGraphicsDefFree(vnc); - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot parse VNC port '%s'"), tmp+1); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot parse VNC port '%s'"), tmp+1); goto error; } if (val[0] == '[') @@ -7762,8 +7762,8 @@ virDomainDefPtr qemuParseCommandLine(virCapsPtr caps, int mem; WANT_VALUE(); if (virStrToLong_i(val, NULL, 10, &mem) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, \ - _("cannot parse memory level '%s'"), val); + virReportError(VIR_ERR_INTERNAL_ERROR, \ + _("cannot parse memory level '%s'"), val); goto error; } def->mem.cur_balloon = def->mem.max_balloon = mem * 1024; @@ -7774,8 +7774,8 @@ virDomainDefPtr qemuParseCommandLine(virCapsPtr caps, } else if (STREQ(arg, "-uuid")) { WANT_VALUE(); if (virUUIDParse(val, def->uuid) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, \ - _("cannot parse UUID '%s'"), val); + virReportError(VIR_ERR_INTERNAL_ERROR, \ + _("cannot parse UUID '%s'"), val); goto error; } } else if (STRPREFIX(arg, "-hd") || @@ -7835,8 +7835,8 @@ virDomainDefPtr qemuParseCommandLine(virCapsPtr caps, host = disk->src; port = strchr(host, ':'); if (!port) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot parse nbd filename '%s'"), disk->src); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot parse nbd filename '%s'"), disk->src); goto error; } *port++ = '\0'; @@ -7864,8 +7864,8 @@ virDomainDefPtr qemuParseCommandLine(virCapsPtr caps, *port++ = '\0'; vdi = strchr(port, ':'); if (!vdi) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot parse sheepdog filename '%s'"), val); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot parse sheepdog filename '%s'"), val); goto error; } *vdi++ = '\0'; @@ -8144,8 +8144,8 @@ virDomainDefPtr qemuParseCommandLine(virCapsPtr caps, if (STRNEQ(val, "none")) { video = qemuVideoTypeFromString(val); if (video < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unknown video adapter type '%s'"), val); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unknown video adapter type '%s'"), val); goto error; } } @@ -8217,15 +8217,15 @@ virDomainDefPtr qemuParseCommandLine(virCapsPtr caps, } if (!first_rbd_disk) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("CEPH_ARGS was set without an rbd disk")); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("CEPH_ARGS was set without an rbd disk")); goto error; } /* CEPH_ARGS should be: -m host1[:port1][,host2[:port2]]... */ if (!STRPREFIX(ceph_args, "-m ")) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("could not parse CEPH_ARGS '%s'"), ceph_args); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("could not parse CEPH_ARGS '%s'"), ceph_args); goto error; } hosts = strdup(strchr(ceph_args, ' ') + 1); @@ -8259,8 +8259,8 @@ virDomainDefPtr qemuParseCommandLine(virCapsPtr caps, VIR_FREE(hosts); if (first_rbd_disk->nhosts == 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("found no rbd hosts in CEPH_ARGS '%s'"), ceph_args); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("found no rbd hosts in CEPH_ARGS '%s'"), ceph_args); goto error; } } diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 88a04bc..7735ffe 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -140,9 +140,9 @@ int qemudLoadDriverConfig(struct qemud_driver *driver, #define CHECK_TYPE(name,typ) if (p && p->type != (typ)) { \ - qemuReportError(VIR_ERR_INTERNAL_ERROR, \ - "%s: %s: expected type " #typ, \ - filename, (name)); \ + virReportError(VIR_ERR_INTERNAL_ERROR, \ + "%s: %s: expected type " #typ, \ + filename, (name)); \ virConfFree(conf); \ return -1; \ } @@ -535,16 +535,16 @@ qemuDriverCloseCallbackSet(struct qemud_driver *driver, closeDef = virHashLookup(driver->closeCallbacks, uuidstr); if (closeDef) { if (closeDef->conn != conn) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Close callback for domain %s already registered" - " with another connection %p"), - vm->def->name, closeDef->conn); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Close callback for domain %s already registered" + " with another connection %p"), + vm->def->name, closeDef->conn); return -1; } if (closeDef->cb && closeDef->cb != cb) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Another close callback is already defined for" - " domain %s"), vm->def->name); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Another close callback is already defined for" + " domain %s"), vm->def->name); return -1; } @@ -582,9 +582,9 @@ qemuDriverCloseCallbackUnset(struct qemud_driver *driver, return -1; if (closeDef->cb && closeDef->cb != cb) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Trying to remove mismatching close callback for" - " domain %s"), vm->def->name); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Trying to remove mismatching close callback for" + " domain %s"), vm->def->name); return -1; } diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h index 482e6d3..4234807 100644 --- a/src/qemu/qemu_conf.h +++ b/src/qemu/qemu_conf.h @@ -167,10 +167,6 @@ struct _qemuDomainCmdlineDef { # define QEMUD_MIGRATION_FIRST_PORT 49152 # define QEMUD_MIGRATION_NUM_PORTS 64 -# define qemuReportError(code, ...) \ - virReportErrorHelper(VIR_FROM_QEMU, code, __FILE__, \ - __FUNCTION__, __LINE__, __VA_ARGS__) - void qemuDriverLock(struct qemud_driver *driver); void qemuDriverUnlock(struct qemud_driver *driver); diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 201ec03..42875b4 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -344,8 +344,8 @@ static int qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, void *data) if (!(monitorpath = virXPathString("string(./monitor[1]/@path)", ctxt))) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("no monitor path")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("no monitor path")); goto error; } @@ -371,9 +371,9 @@ static int qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, void *data) break; default: VIR_FREE(monitorpath); - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unsupported monitor type '%s'"), - virDomainChrTypeToString(priv->monConfig->type)); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unsupported monitor type '%s'"), + virDomainChrTypeToString(priv->monConfig->type)); goto error; } @@ -402,8 +402,8 @@ static int qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, void *data) } if ((n = virXPathNodeSet("./qemuCaps/flag", ctxt, &nodes)) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("failed to parse qemu capabilities flags")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("failed to parse qemu capabilities flags")); goto error; } if (n > 0) { @@ -415,8 +415,8 @@ static int qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, void *data) if (str) { int flag = qemuCapsTypeFromString(str); if (flag < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Unknown qemu capabilities flag %s"), str); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Unknown qemu capabilities flag %s"), str); VIR_FREE(str); goto error; } @@ -435,8 +435,8 @@ static int qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, void *data) int type; if ((type = qemuDomainJobTypeFromString(tmp)) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Unknown job type %s"), tmp); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Unknown job type %s"), tmp); VIR_FREE(tmp); goto error; } @@ -448,8 +448,8 @@ static int qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, void *data) int async; if ((async = qemuDomainAsyncJobTypeFromString(tmp)) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Unknown async job type %s"), tmp); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Unknown async job type %s"), tmp); VIR_FREE(tmp); goto error; } @@ -459,8 +459,8 @@ static int qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, void *data) if ((tmp = virXPathString("string(./job[1]/@phase)", ctxt))) { priv->job.phase = qemuDomainAsyncJobPhaseFromString(async, tmp); if (priv->job.phase < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Unknown job phase %s"), tmp); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Unknown job phase %s"), tmp); VIR_FREE(tmp); goto error; } @@ -514,9 +514,9 @@ qemuDomainDefNamespaceParse(xmlDocPtr xml ATTRIBUTE_UNUSED, int n, i; if (xmlXPathRegisterNs(ctxt, BAD_CAST "qemu", BAD_CAST QEMU_NAMESPACE_HREF) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to register xml namespace '%s'"), - QEMU_NAMESPACE_HREF); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Failed to register xml namespace '%s'"), + QEMU_NAMESPACE_HREF); return -1; } @@ -537,8 +537,8 @@ qemuDomainDefNamespaceParse(xmlDocPtr xml ATTRIBUTE_UNUSED, for (i = 0; i < n; i++) { cmd->args[cmd->num_args] = virXMLPropString(nodes[i], "value"); if (cmd->args[cmd->num_args] == NULL) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("No qemu command-line argument specified")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("No qemu command-line argument specified")); goto error; } cmd->num_args++; @@ -563,23 +563,23 @@ qemuDomainDefNamespaceParse(xmlDocPtr xml ATTRIBUTE_UNUSED, tmp = virXMLPropString(nodes[i], "name"); if (tmp == NULL) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("No qemu environment name specified")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("No qemu environment name specified")); goto error; } if (tmp[0] == '\0') { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("Empty qemu environment name specified")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("Empty qemu environment name specified")); goto error; } if (!c_isalpha(tmp[0]) && tmp[0] != '_') { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("Invalid environment name, it must begin with a letter or underscore")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("Invalid environment name, it must begin with a letter or underscore")); goto error; } if (strspn(tmp, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_") != strlen(tmp)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("Invalid environment name, it must contain only alphanumerics and underscore")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("Invalid environment name, it must contain only alphanumerics and underscore")); goto error; } @@ -838,13 +838,13 @@ error: priv->job.owner, priv->job.asyncOwner); if (errno == ETIMEDOUT) - qemuReportError(VIR_ERR_OPERATION_TIMEOUT, - "%s", _("cannot acquire state change lock")); + virReportError(VIR_ERR_OPERATION_TIMEOUT, + "%s", _("cannot acquire state change lock")); else if (driver->max_queued && priv->jobs_queued > driver->max_queued) - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("cannot acquire state change lock " - "due to max_queued limit")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("cannot acquire state change lock " + "due to max_queued limit")); else virReportSystemError(errno, "%s", _("cannot acquire job mutex")); @@ -899,8 +899,8 @@ int qemuDomainObjBeginJobWithDriver(struct qemud_driver *driver, enum qemuDomainJob job) { if (job <= QEMU_JOB_NONE || job >= QEMU_JOB_ASYNC) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Attempt to start invalid job")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Attempt to start invalid job")); return -1; } @@ -971,8 +971,8 @@ qemuDomainObjEnterMonitorInternal(struct qemud_driver *driver, if (asyncJob != QEMU_ASYNC_JOB_NONE) { if (asyncJob != priv->job.asyncJob) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected async job %d"), asyncJob); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unexpected async job %d"), asyncJob); return -1; } if (priv->job.asyncOwner != virThreadSelfID()) @@ -983,8 +983,8 @@ qemuDomainObjEnterMonitorInternal(struct qemud_driver *driver, QEMU_ASYNC_JOB_NONE) < 0) return -1; if (!virDomainObjIsActive(obj)) { - qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", - _("domain is no longer running")); + virReportError(VIR_ERR_OPERATION_FAILED, "%s", + _("domain is no longer running")); /* Still referenced by the containing async job. */ ignore_value(qemuDomainObjEndJob(driver, obj)); return -1; @@ -1241,8 +1241,8 @@ qemuDomainDefFormatBuf(struct qemud_driver *driver, def_cpu && (def_cpu->mode != VIR_CPU_MODE_CUSTOM || def_cpu->model)) { if (!driver->caps || !driver->caps->host.cpu) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("cannot get host CPU capabilities")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("cannot get host CPU capabilities")); goto cleanup; } @@ -1575,8 +1575,8 @@ qemuFindQemuImgBinary(struct qemud_driver *driver) if (!driver->qemuImgBinary) driver->qemuImgBinary = virFindFileInPath("qemu-img"); if (!driver->qemuImgBinary) - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("unable to find kvm-img or qemu-img")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("unable to find kvm-img or qemu-img")); } return driver->qemuImgBinary; @@ -1672,10 +1672,10 @@ qemuDomainSnapshotForEachQcow2Raw(struct qemud_driver *driver, qemuDomainSnapshotForEachQcow2Raw(driver, def, name, "-d", false, i); } - qemuReportError(VIR_ERR_OPERATION_INVALID, - _("Disk device '%s' does not support" - " snapshotting"), - def->disks[i]->dst); + virReportError(VIR_ERR_OPERATION_INVALID, + _("Disk device '%s' does not support" + " snapshotting"), + def->disks[i]->dst); return -1; } diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index d3988b8..e65f694 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -283,8 +283,8 @@ qemuCreateCapabilities(virCapsPtr oldcaps, qemuDomainSetNamespaceHooks(caps); if (virGetHostUUID(caps->host.host_uuid)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("cannot get the host uuid")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("cannot get the host uuid")); goto err_exit; } @@ -930,33 +930,33 @@ static virDrvOpenStatus qemudOpen(virConnectPtr conn, return VIR_DRV_OPEN_DECLINED; if (qemu_driver == NULL) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("qemu state driver is not active")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("qemu state driver is not active")); return VIR_DRV_OPEN_ERROR; } if (conn->uri->path == NULL) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("no QEMU URI path given, try %s"), - qemu_driver->privileged - ? "qemu:///system" - : "qemu:///session"); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("no QEMU URI path given, try %s"), + qemu_driver->privileged + ? "qemu:///system" + : "qemu:///session"); return VIR_DRV_OPEN_ERROR; } if (qemu_driver->privileged) { if (STRNEQ (conn->uri->path, "/system") && STRNEQ (conn->uri->path, "/session")) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected QEMU URI path '%s', try qemu:///system"), - conn->uri->path); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unexpected QEMU URI path '%s', try qemu:///system"), + conn->uri->path); return VIR_DRV_OPEN_ERROR; } } else { if (STRNEQ (conn->uri->path, "/session")) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected QEMU URI path '%s', try qemu:///session"), - conn->uri->path); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unexpected QEMU URI path '%s', try qemu:///session"), + conn->uri->path); return VIR_DRV_OPEN_ERROR; } } @@ -1048,8 +1048,8 @@ qemuGetSysinfo(virConnectPtr conn, unsigned int flags) virCheckFlags(0, NULL); if (!driver->hostsysinfo) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("Host SMBIOS information is not available")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Host SMBIOS information is not available")); return NULL; } @@ -1075,8 +1075,8 @@ static int qemudGetMaxVCPUs(virConnectPtr conn ATTRIBUTE_UNUSED, const char *typ if (STRCASEEQ(type, "kqemu")) return 1; - qemuReportError(VIR_ERR_INVALID_ARG, - _("unknown type '%s'"), type); + virReportError(VIR_ERR_INVALID_ARG, + _("unknown type '%s'"), type); return -1; } @@ -1194,8 +1194,8 @@ static virDomainPtr qemudDomainLookupByID(virConnectPtr conn, qemuDriverUnlock(driver); if (!vm) { - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching id %d"), id); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching id %d"), id); goto cleanup; } @@ -1221,8 +1221,8 @@ static virDomainPtr qemudDomainLookupByUUID(virConnectPtr conn, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -1246,8 +1246,8 @@ static virDomainPtr qemudDomainLookupByName(virConnectPtr conn, qemuDriverUnlock(driver); if (!vm) { - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching name '%s'"), name); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching name '%s'"), name); goto cleanup; } @@ -1273,8 +1273,8 @@ static int qemuDomainIsActive(virDomainPtr dom) if (!obj) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } ret = virDomainObjIsActive(obj); @@ -1297,8 +1297,8 @@ static int qemuDomainIsPersistent(virDomainPtr dom) if (!obj) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } ret = obj->persistent; @@ -1321,8 +1321,8 @@ static int qemuDomainIsUpdated(virDomainPtr dom) if (!obj) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } ret = obj->updated; @@ -1478,13 +1478,13 @@ static int qemudDomainSuspend(virDomainPtr dom) { if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); goto cleanup; } @@ -1502,8 +1502,8 @@ static int qemudDomainSuspend(virDomainPtr dom) { goto cleanup; if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); goto endjob; } if (virDomainObjGetState(vm, NULL) != VIR_DOMAIN_PAUSED) { @@ -1545,8 +1545,8 @@ static int qemudDomainResume(virDomainPtr dom) { if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -1554,8 +1554,8 @@ static int qemudDomainResume(virDomainPtr dom) { goto cleanup; if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); goto endjob; } if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_PAUSED) { @@ -1563,8 +1563,8 @@ static int qemudDomainResume(virDomainPtr dom) { VIR_DOMAIN_RUNNING_UNPAUSED, QEMU_ASYNC_JOB_NONE) < 0) { if (virGetLastError() == NULL) - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("resume operation failed")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("resume operation failed")); goto endjob; } event = virDomainEventNewFromObj(vm, @@ -1605,8 +1605,8 @@ static int qemuDomainShutdownFlags(virDomainPtr dom, unsigned int flags) { if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -1619,13 +1619,13 @@ static int qemuDomainShutdownFlags(virDomainPtr dom, unsigned int flags) { if (useAgent) { if (priv->agentError) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("QEMU guest agent is not available due to an error")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("QEMU guest agent is not available due to an error")); goto cleanup; } if (!priv->agent) { - qemuReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", - _("QEMU guest agent is not configured")); + virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", + _("QEMU guest agent is not configured")); goto cleanup; } } @@ -1634,8 +1634,8 @@ static int qemuDomainShutdownFlags(virDomainPtr dom, unsigned int flags) { goto cleanup; if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); goto endjob; } @@ -1686,8 +1686,8 @@ qemuDomainReboot(virDomainPtr dom, unsigned int flags) if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -1700,27 +1700,27 @@ qemuDomainReboot(virDomainPtr dom, unsigned int flags) if (useAgent) { if (priv->agentError) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("QEMU guest agent is not available due to an error")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("QEMU guest agent is not available due to an error")); goto cleanup; } if (!priv->agent) { - qemuReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", - _("QEMU guest agent is not configured")); + virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", + _("QEMU guest agent is not configured")); goto cleanup; } } else { #if HAVE_YAJL if (qemuCapsGet(priv->qemuCaps, QEMU_CAPS_MONITOR_JSON)) { if (!qemuCapsGet(priv->qemuCaps, QEMU_CAPS_NO_SHUTDOWN)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("Reboot is not supported with this QEMU binary")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Reboot is not supported with this QEMU binary")); goto cleanup; } } else { #endif - qemuReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("Reboot is not supported without the JSON monitor")); + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("Reboot is not supported without the JSON monitor")); goto cleanup; #if HAVE_YAJL } @@ -1731,8 +1731,8 @@ qemuDomainReboot(virDomainPtr dom, unsigned int flags) goto cleanup; if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); goto endjob; } @@ -1777,8 +1777,8 @@ qemuDomainReset(virDomainPtr dom, unsigned int flags) if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -1786,8 +1786,8 @@ qemuDomainReset(virDomainPtr dom, unsigned int flags) goto cleanup; if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); goto endjob; } @@ -1839,8 +1839,8 @@ qemuDomainDestroyFlags(virDomainPtr dom, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -1855,8 +1855,8 @@ qemuDomainDestroyFlags(virDomainPtr dom, */ if (flags & VIR_DOMAIN_DESTROY_GRACEFUL) { if (qemuProcessKill(driver, vm, 0) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", - _("failed to kill qemu process with SIGTERM")); + virReportError(VIR_ERR_OPERATION_FAILED, "%s", + _("failed to kill qemu process with SIGTERM")); goto cleanup; } } else { @@ -1874,8 +1874,8 @@ qemuDomainDestroyFlags(virDomainPtr dom, priv->beingDestroyed = false; if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); goto endjob; } @@ -1923,8 +1923,8 @@ static char *qemudDomainGetOSType(virDomainPtr dom) { if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -1952,8 +1952,8 @@ qemuDomainGetMaxMemory(virDomainPtr dom) if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -1983,8 +1983,8 @@ static int qemudDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -1999,9 +1999,9 @@ static int qemudDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem, /* resize the maximum memory */ if (flags & VIR_DOMAIN_AFFECT_LIVE) { - qemuReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("cannot resize the maximum memory on an " - "active domain")); + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("cannot resize the maximum memory on an " + "active domain")); goto endjob; } @@ -2019,8 +2019,8 @@ static int qemudDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem, /* resize the current memory */ if (newmem > vm->def->mem.max_balloon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("cannot set memory higher than max memory")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("cannot set memory higher than max memory")); goto endjob; } @@ -2036,9 +2036,9 @@ static int qemudDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem, /* Lack of balloon support is a fatal error */ if (r == 0) { - qemuReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("Unable to change memory of active domain without " - "the balloon device and guest OS balloon driver")); + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("Unable to change memory of active domain without " + "the balloon device and guest OS balloon driver")); goto endjob; } } @@ -2086,14 +2086,14 @@ static int qemuDomainInjectNMI(virDomainPtr domain, unsigned int flags) if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(domain->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); goto cleanup; } @@ -2103,8 +2103,8 @@ static int qemuDomainInjectNMI(virDomainPtr domain, unsigned int flags) goto cleanup; if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); goto endjob; } @@ -2148,10 +2148,10 @@ static int qemuDomainSendKey(virDomainPtr domain, keycode = virKeycodeValueTranslate(codeset, VIR_KEYCODE_SET_RFB, keycodes[i]); if (keycode < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot translate keycode %u of %s codeset to rfb keycode"), - keycodes[i], - virKeycodeSetTypeToString(codeset)); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot translate keycode %u of %s codeset to rfb keycode"), + keycodes[i], + virKeycodeSetTypeToString(codeset)); return -1; } keycodes[i] = keycode; @@ -2163,8 +2163,8 @@ static int qemuDomainSendKey(virDomainPtr domain, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(domain->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -2174,8 +2174,8 @@ static int qemuDomainSendKey(virDomainPtr domain, goto cleanup; if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); goto endjob; } @@ -2209,8 +2209,8 @@ static int qemudDomainGetInfo(virDomainPtr dom, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -2220,8 +2220,8 @@ static int qemudDomainGetInfo(virDomainPtr dom, info->cpuTime = 0; } else { if (qemudGetProcessInfo(&(info->cpuTime), NULL, NULL, vm->pid, 0) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", - _("cannot read cputime for domain")); + virReportError(VIR_ERR_OPERATION_FAILED, "%s", + _("cannot read cputime for domain")); goto cleanup; } } @@ -2298,8 +2298,8 @@ qemuDomainGetState(virDomainPtr dom, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -2331,14 +2331,14 @@ qemuDomainGetControlInfo(virDomainPtr dom, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); goto cleanup; } @@ -2431,16 +2431,16 @@ qemuDomainSaveHeader(int fd, const char *path, char *xml, if (safewrite(fd, header, sizeof(*header)) != sizeof(*header)) { ret = -errno; - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("failed to write header to domain save file '%s'"), - path); + virReportError(VIR_ERR_OPERATION_FAILED, + _("failed to write header to domain save file '%s'"), + path); goto endjob; } if (safewrite(fd, xml, header->xml_len) != header->xml_len) { ret = -errno; - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("failed to write xml to '%s'"), path); + virReportError(VIR_ERR_OPERATION_FAILED, + _("failed to write xml to '%s'"), path); goto endjob; } endjob: @@ -2599,8 +2599,8 @@ qemuDomainSaveInternal(struct qemud_driver *driver, virDomainPtr dom, unsigned int wrapperFlags = VIR_FILE_WRAPPER_NON_BLOCKING; if (qemuProcessAutoDestroyActive(driver, vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is marked for auto destroy")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is marked for auto destroy")); goto cleanup; } @@ -2627,8 +2627,8 @@ qemuDomainSaveInternal(struct qemud_driver *driver, virDomainPtr dom, goto endjob; if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("guest unexpectedly quit")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("guest unexpectedly quit")); goto endjob; } } @@ -2659,8 +2659,8 @@ qemuDomainSaveInternal(struct qemud_driver *driver, virDomainPtr dom, xml = qemuDomainDefFormatLive(driver, vm->def, true, true); } if (!xml) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("failed to get domain xml")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("failed to get domain xml")); goto endjob; } len = strlen(xml) + 1; @@ -2689,8 +2689,8 @@ qemuDomainSaveInternal(struct qemud_driver *driver, virDomainPtr dom, wrapperFlags |= VIR_FILE_WRAPPER_BYPASS_CACHE; directFlag = virFileDirectFdFlag(); if (directFlag < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", - _("bypass cache unsupported by this system")); + virReportError(VIR_ERR_OPERATION_FAILED, "%s", + _("bypass cache unsupported by this system")); goto cleanup; } } @@ -2818,15 +2818,15 @@ qemuDomainSaveFlags(virDomainPtr dom, const char *path, const char *dxml, else { compressed = qemudSaveCompressionTypeFromString(driver->saveImageFormat); if (compressed < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("Invalid save image format specified " - "in configuration file")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("Invalid save image format specified " + "in configuration file")); goto cleanup; } if (!qemudCompressProgramAvailable(compressed)) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("Compression program for image format " - "in configuration file isn't available")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("Compression program for image format " + "in configuration file isn't available")); goto cleanup; } } @@ -2835,14 +2835,14 @@ qemuDomainSaveFlags(virDomainPtr dom, const char *path, const char *dxml, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); goto cleanup; } @@ -2894,19 +2894,19 @@ qemuDomainManagedSave(virDomainPtr dom, unsigned int flags) if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); goto cleanup; } if (!vm->persistent) { - qemuReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("cannot do managed save for transient domain")); + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("cannot do managed save for transient domain")); goto cleanup; } @@ -2967,8 +2967,8 @@ qemuDomainHasManagedSaveImage(virDomainPtr dom, unsigned int flags) if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -2996,8 +2996,8 @@ qemuDomainManagedSaveRemove(virDomainPtr dom, unsigned int flags) if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -3023,8 +3023,8 @@ static int qemuDumpToFd(struct qemud_driver *driver, virDomainObjPtr vm, int ret = -1; if (!qemuCapsGet(priv->qemuCaps, QEMU_CAPS_DUMP_GUEST_MEMORY)) { - qemuReportError(VIR_ERR_NO_SUPPORT, "%s", - _("dump-guest-memory is not supported")); + virReportError(VIR_ERR_NO_SUPPORT, "%s", + _("dump-guest-memory is not supported")); return -1; } @@ -3061,8 +3061,8 @@ doCoreDump(struct qemud_driver *driver, flags |= VIR_FILE_WRAPPER_BYPASS_CACHE; directFlag = virFileDirectFdFlag(); if (directFlag < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", - _("bypass cache unsupported by this system")); + virReportError(VIR_ERR_OPERATION_FAILED, "%s", + _("bypass cache unsupported by this system")); goto cleanup; } } @@ -3157,8 +3157,8 @@ static int qemudDomainCoreDump(virDomainPtr dom, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -3167,8 +3167,8 @@ static int qemudDomainCoreDump(virDomainPtr dom, goto cleanup; if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); goto endjob; } @@ -3185,8 +3185,8 @@ static int qemudDomainCoreDump(virDomainPtr dom, paused = 1; if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("guest unexpectedly quit")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("guest unexpectedly quit")); goto endjob; } } @@ -3222,8 +3222,8 @@ endjob: VIR_DOMAIN_RUNNING_UNPAUSED, QEMU_ASYNC_JOB_DUMP) < 0) { if (virGetLastError() == NULL) - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("resuming after dump failed")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("resuming after dump failed")); } } @@ -3266,8 +3266,8 @@ qemuDomainScreenshot(virDomainPtr dom, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain matching uuid '%s'"), uuidstr); goto cleanup; } @@ -3277,17 +3277,17 @@ qemuDomainScreenshot(virDomainPtr dom, goto cleanup; if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); goto endjob; } /* Well, even if qemu allows multiple graphic cards, heads, whatever, * screenshot command does not */ if (screen) { - qemuReportError(VIR_ERR_INVALID_ARG, - "%s", _("currently is supported only taking " - "screenshots of screen ID 0")); + virReportError(VIR_ERR_INVALID_ARG, + "%s", _("currently is supported only taking " + "screenshots of screen ID 0")); goto endjob; } @@ -3317,8 +3317,8 @@ qemuDomainScreenshot(virDomainPtr dom, } if (virFDStreamOpenFile(st, tmp, 0, 0, O_RDONLY) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", - _("unable to open stream")); + virReportError(VIR_ERR_OPERATION_FAILED, "%s", + _("unable to open stream")); goto endjob; } @@ -3369,8 +3369,8 @@ static void processWatchdogEvent(void *data, void *opaque) } if (!virDomainObjIsActive(wdEvent->vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); VIR_FREE(dumpfile); goto endjob; } @@ -3379,16 +3379,16 @@ static void processWatchdogEvent(void *data, void *opaque) ret = doCoreDump(driver, wdEvent->vm, dumpfile, getCompressionType(driver), flags); if (ret < 0) - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("Dump failed")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("Dump failed")); ret = qemuProcessStartCPUs(driver, wdEvent->vm, NULL, VIR_DOMAIN_RUNNING_UNPAUSED, QEMU_ASYNC_JOB_DUMP); if (ret < 0) - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("Resuming after dump failed")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("Resuming after dump failed")); VIR_FREE(dumpfile); } @@ -3466,10 +3466,10 @@ static int qemudDomainHotplugVcpus(struct qemud_driver *driver, } if (ncpupids != vcpus) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("got wrong number of vCPU pids from QEMU monitor. " - "got %d, wanted %d"), - ncpupids, vcpus); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("got wrong number of vCPU pids from QEMU monitor. " + "got %d, wanted %d"), + ncpupids, vcpus); ret = -1; goto cleanup; } @@ -3487,8 +3487,8 @@ cleanup: return ret; unsupported: - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("cannot change vcpu count of this domain")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("cannot change vcpu count of this domain")); goto cleanup; } @@ -3510,8 +3510,8 @@ qemuDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus, VIR_DOMAIN_VCPU_MAXIMUM, -1); if (!nvcpus || (unsigned short) nvcpus != nvcpus) { - qemuReportError(VIR_ERR_INVALID_ARG, - _("argument out of range: %d"), nvcpus); + virReportError(VIR_ERR_INVALID_ARG, + _("argument out of range: %d"), nvcpus); return -1; } @@ -3522,8 +3522,8 @@ qemuDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -3539,21 +3539,21 @@ qemuDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus, /* MAXIMUM cannot be mixed with LIVE. */ if (maximum && (flags & VIR_DOMAIN_AFFECT_LIVE)) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("cannot adjust maximum on running domain")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("cannot adjust maximum on running domain")); goto endjob; } if (!(type = virDomainVirtTypeToString(vm->def->virtType))) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unknown virt type in domain definition '%d'"), - vm->def->virtType); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unknown virt type in domain definition '%d'"), + vm->def->virtType); goto endjob; } if ((max = qemudGetMaxVCPUs(NULL, type)) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("could not determine max vcpus for the domain")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("could not determine max vcpus for the domain")); goto endjob; } @@ -3562,9 +3562,9 @@ qemuDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus, } if (nvcpus > max) { - qemuReportError(VIR_ERR_INVALID_ARG, - _("requested vcpus is greater than max allowable" - " vcpus for the domain: %d > %d"), nvcpus, max); + virReportError(VIR_ERR_INVALID_ARG, + _("requested vcpus is greater than max allowable" + " vcpus for the domain: %d > %d"), nvcpus, max); goto endjob; } @@ -3632,8 +3632,8 @@ qemudDomainPinVcpuFlags(virDomainPtr dom, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -3644,9 +3644,9 @@ qemudDomainPinVcpuFlags(virDomainPtr dom, priv = vm->privateData; if (vcpu > (priv->nvcpupids-1)) { - qemuReportError(VIR_ERR_INVALID_ARG, - _("vcpu number out of range %d > %d"), - vcpu, priv->nvcpupids); + virReportError(VIR_ERR_INVALID_ARG, + _("vcpu number out of range %d > %d"), + vcpu, priv->nvcpupids); goto cleanup; } @@ -3673,23 +3673,23 @@ qemudDomainPinVcpuFlags(virDomainPtr dom, cpumap, maplen, maxcpu) < 0) goto cleanup; } else { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("cpu affinity is not supported")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("cpu affinity is not supported")); goto cleanup; } if (canResetting) { if (virDomainVcpuPinDel(vm->def, vcpu) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("failed to delete vcpupin xml of " - "a running domain")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("failed to delete vcpupin xml of " + "a running domain")); goto cleanup; } } else { if (virDomainVcpuPinAdd(vm->def, cpumap, maplen, vcpu) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("failed to update or add vcpupin xml of " - "a running domain")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("failed to update or add vcpupin xml of " + "a running domain")); goto cleanup; } } @@ -3702,16 +3702,16 @@ qemudDomainPinVcpuFlags(virDomainPtr dom, if (canResetting) { if (virDomainVcpuPinDel(persistentDef, vcpu) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("failed to delete vcpupin xml of " - "a persistent domain")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("failed to delete vcpupin xml of " + "a persistent domain")); goto cleanup; } } else { if (virDomainVcpuPinAdd(persistentDef, cpumap, maplen, vcpu) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("failed to update or add vcpupin xml of " - "a persistent domain")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("failed to update or add vcpupin xml of " + "a persistent domain")); goto cleanup; } } @@ -3765,8 +3765,8 @@ qemudDomainGetVcpuPinInfo(virDomainPtr dom, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -3844,15 +3844,15 @@ qemudDomainGetVcpus(virDomainPtr dom, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", - _("cannot list vcpu pinning for an inactive domain")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", + _("cannot list vcpu pinning for an inactive domain")); goto cleanup; } @@ -3901,8 +3901,8 @@ qemudDomainGetVcpus(virDomainPtr dom, goto cleanup; } } else { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("cpu affinity is not available")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("cpu affinity is not available")); goto cleanup; } } @@ -3935,8 +3935,8 @@ qemudDomainGetVcpusFlags(virDomainPtr dom, unsigned int flags) if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -3976,15 +3976,15 @@ static int qemudDomainGetSecurityLabel(virDomainPtr dom, virSecurityLabelPtr sec if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } if (!virDomainVirtTypeToString(vm->def->virtType)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unknown virt type in domain definition '%d'"), - vm->def->virtType); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unknown virt type in domain definition '%d'"), + vm->def->virtType); goto cleanup; } @@ -4005,8 +4005,8 @@ static int qemudDomainGetSecurityLabel(virDomainPtr dom, virSecurityLabelPtr sec if (virDomainObjIsActive(vm)) { if (virSecurityManagerGetProcessLabel(driver->securityManager, vm->def, vm->pid, seclabel) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("Failed to get security label")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("Failed to get security label")); goto cleanup; } } @@ -4037,9 +4037,9 @@ static int qemudNodeGetSecurityModel(virConnectPtr conn, p = driver->caps->host.secModel.model; if (strlen(p) >= VIR_SECURITY_MODEL_BUFLEN-1) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("security model string exceeds max %d bytes"), - VIR_SECURITY_MODEL_BUFLEN-1); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("security model string exceeds max %d bytes"), + VIR_SECURITY_MODEL_BUFLEN-1); ret = -1; goto cleanup; } @@ -4047,9 +4047,9 @@ static int qemudNodeGetSecurityModel(virConnectPtr conn, p = driver->caps->host.secModel.doi; if (strlen(p) >= VIR_SECURITY_DOI_BUFLEN-1) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("security DOI string exceeds max %d bytes"), - VIR_SECURITY_DOI_BUFLEN-1); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("security DOI string exceeds max %d bytes"), + VIR_SECURITY_DOI_BUFLEN-1); ret = -1; goto cleanup; } @@ -4083,8 +4083,8 @@ qemuDomainSaveImageOpen(struct qemud_driver *driver, if (bypass_cache) { int directFlag = virFileDirectFdFlag(); if (directFlag < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", - _("bypass cache unsupported by this system")); + virReportError(VIR_ERR_OPERATION_FAILED, "%s", + _("bypass cache unsupported by this system")); goto error; } oflags |= directFlag; @@ -4107,8 +4107,8 @@ qemuDomainSaveImageOpen(struct qemud_driver *driver, } return -3; } - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("failed to read qemu header")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("failed to read qemu header")); goto error; } @@ -4128,7 +4128,7 @@ qemuDomainSaveImageOpen(struct qemud_driver *driver, return -3; } } - qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", msg); + virReportError(VIR_ERR_OPERATION_FAILED, "%s", msg); goto error; } @@ -4138,15 +4138,15 @@ qemuDomainSaveImageOpen(struct qemud_driver *driver, } if (header.version > QEMUD_SAVE_VERSION) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("image version is not supported (%d > %d)"), - header.version, QEMUD_SAVE_VERSION); + virReportError(VIR_ERR_OPERATION_FAILED, + _("image version is not supported (%d > %d)"), + header.version, QEMUD_SAVE_VERSION); goto error; } if (header.xml_len <= 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("invalid XML length: %d"), header.xml_len); + virReportError(VIR_ERR_OPERATION_FAILED, + _("invalid XML length: %d"), header.xml_len); goto error; } @@ -4156,8 +4156,8 @@ qemuDomainSaveImageOpen(struct qemud_driver *driver, } if (saferead(fd, xml, header.xml_len) != header.xml_len) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("failed to read XML")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("failed to read XML")); goto error; } @@ -4225,9 +4225,9 @@ qemuDomainSaveImageStartVM(virConnectPtr conn, if (header->version == 2) { const char *prog = qemudSaveCompressionTypeToString(header->compressed); if (prog == NULL) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("Invalid compressed save format %d"), - header->compressed); + virReportError(VIR_ERR_OPERATION_FAILED, + _("Invalid compressed save format %d"), + header->compressed); goto out; } @@ -4240,9 +4240,9 @@ qemuDomainSaveImageStartVM(virConnectPtr conn, virCommandSetOutputFD(cmd, fd); if (virCommandRunAsync(cmd, NULL) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to start decompression binary %s"), - prog); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Failed to start decompression binary %s"), + prog); *fd = intermediatefd; goto out; } @@ -4293,8 +4293,8 @@ qemuDomainSaveImageStartVM(virConnectPtr conn, VIR_DOMAIN_RUNNING_RESTORED, QEMU_ASYNC_JOB_NONE) < 0) { if (virGetLastError() == NULL) - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("failed to resume domain")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("failed to resume domain")); goto out; } if (virDomainSaveStatus(driver->caps, driver->stateDir, vm) < 0) { @@ -4469,8 +4469,8 @@ qemuDomainSaveImageDefineXML(virConnectPtr conn, const char *path, len = strlen(xml) + 1; if (len > header.xml_len) { - qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", - _("new xml too large to fit in file")); + virReportError(VIR_ERR_OPERATION_FAILED, "%s", + _("new xml too large to fit in file")); goto cleanup; } if (VIR_EXPAND_N(xml, len, header.xml_len - len) < 0) { @@ -4530,11 +4530,11 @@ qemuDomainObjRestore(virConnectPtr conn, char def_uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(vm->def->uuid, vm_uuidstr); virUUIDFormat(def->uuid, def_uuidstr); - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("cannot restore domain '%s' uuid %s from a file" - " which belongs to domain '%s' uuid %s"), - vm->def->name, vm_uuidstr, - def->name, def_uuidstr); + virReportError(VIR_ERR_OPERATION_FAILED, + _("cannot restore domain '%s' uuid %s from a file" + " which belongs to domain '%s' uuid %s"), + vm->def->name, vm_uuidstr, + def->name, def_uuidstr); goto cleanup; } @@ -4572,8 +4572,8 @@ static char *qemuDomainGetXMLDesc(virDomainPtr dom, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -4591,8 +4591,8 @@ static char *qemuDomainGetXMLDesc(virDomainPtr dom, goto cleanup; if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); goto endjob; } @@ -4635,8 +4635,8 @@ static char *qemuDomainXMLFromNative(virConnectPtr conn, virCheckFlags(0, NULL); if (STRNEQ(format, QEMU_CONFIG_FORMAT_ARGV)) { - qemuReportError(VIR_ERR_INVALID_ARG, - _("unsupported config type %s"), format); + virReportError(VIR_ERR_INVALID_ARG, + _("unsupported config type %s"), format); goto cleanup; } @@ -4679,8 +4679,8 @@ static char *qemuDomainXMLToNative(virConnectPtr conn, qemuDriverLock(driver); if (STRNEQ(format, QEMU_CONFIG_FORMAT_ARGV)) { - qemuReportError(VIR_ERR_INVALID_ARG, - _("unsupported config type %s"), format); + virReportError(VIR_ERR_INVALID_ARG, + _("unsupported config type %s"), format); goto cleanup; } @@ -4910,8 +4910,8 @@ qemuDomainStartWithFlags(virDomainPtr dom, unsigned int flags) if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -4919,8 +4919,8 @@ qemuDomainStartWithFlags(virDomainPtr dom, unsigned int flags) goto cleanup; if (virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is already running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is already running")); goto endjob; } @@ -5135,24 +5135,24 @@ qemuDomainUndefineFlags(virDomainPtr dom, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } if (!vm->persistent) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("cannot undefine transient domain")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("cannot undefine transient domain")); goto cleanup; } if (!virDomainObjIsActive(vm) && (nsnapshots = virDomainSnapshotObjListNum(&vm->snapshots, NULL, 0))) { if (!(flags & VIR_DOMAIN_UNDEFINE_SNAPSHOTS_METADATA)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - _("cannot delete inactive domain with %d " - "snapshots"), - nsnapshots); + virReportError(VIR_ERR_OPERATION_INVALID, + _("cannot delete inactive domain with %d " + "snapshots"), + nsnapshots); goto cleanup; } if (qemuDomainSnapshotDiscardAllMetadata(driver, vm) < 0) @@ -5166,15 +5166,15 @@ qemuDomainUndefineFlags(virDomainPtr dom, if (virFileExists(name)) { if (flags & VIR_DOMAIN_UNDEFINE_MANAGED_SAVE) { if (unlink(name) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Failed to remove domain managed " - "save image")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Failed to remove domain managed " + "save image")); goto cleanup; } } else { - qemuReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("Refusing to undefine while domain managed " - "save image exists")); + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("Refusing to undefine while domain managed " + "save image exists")); goto cleanup; } } @@ -5228,17 +5228,17 @@ qemuDomainAttachDeviceDiskLive(virConnectPtr conn, int ret = -1; if (disk->driverName != NULL && !STREQ(disk->driverName, "qemu")) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unsupported driver name '%s' for disk '%s'"), - disk->driverName, disk->src); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("unsupported driver name '%s' for disk '%s'"), + disk->driverName, disk->src); goto end; } if (qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_DEVICES)) { if (virCgroupForDomain(driver->cgroup, vm->def->name, &cgroup, 0)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to find cgroup for %s"), - vm->def->name); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Unable to find cgroup for %s"), + vm->def->name); goto end; } if (qemuSetupDiskCgroup(driver, vm, cgroup, disk) < 0) @@ -5253,8 +5253,8 @@ qemuDomainAttachDeviceDiskLive(virConnectPtr conn, case VIR_DOMAIN_DISK_DEVICE_LUN: if (disk->bus == VIR_DOMAIN_DISK_BUS_USB) { if (disk->device == VIR_DOMAIN_DISK_DEVICE_LUN) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("disk device='lun' is not supported for usb bus")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("disk device='lun' is not supported for usb bus")); break; } ret = qemuDomainAttachUsbMassstorageDevice(conn, driver, vm, @@ -5264,15 +5264,15 @@ qemuDomainAttachDeviceDiskLive(virConnectPtr conn, } else if (disk->bus == VIR_DOMAIN_DISK_BUS_SCSI) { ret = qemuDomainAttachSCSIDisk(conn, driver, vm, disk); } else { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("disk bus '%s' cannot be hotplugged."), - virDomainDiskBusTypeToString(disk->bus)); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("disk bus '%s' cannot be hotplugged."), + virDomainDiskBusTypeToString(disk->bus)); } break; default: - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("disk device type '%s' cannot be hotplugged"), - virDomainDiskDeviceTypeToString(disk->device)); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("disk device type '%s' cannot be hotplugged"), + virDomainDiskDeviceTypeToString(disk->device)); break; } @@ -5300,9 +5300,9 @@ qemuDomainAttachDeviceControllerLive(struct qemud_driver *driver, ret = qemuDomainAttachPciControllerDevice(driver, vm, cont); break; default: - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("disk controller bus '%s' cannot be hotplugged."), - virDomainControllerTypeToString(cont->type)); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("disk controller bus '%s' cannot be hotplugged."), + virDomainControllerTypeToString(cont->type)); break; } return ret; @@ -5360,9 +5360,9 @@ qemuDomainAttachDeviceLive(virDomainObjPtr vm, break; default: - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("device type '%s' cannot be attached"), - virDomainDeviceTypeToString(dev->type)); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("device type '%s' cannot be attached"), + virDomainDeviceTypeToString(dev->type)); break; } @@ -5387,13 +5387,13 @@ qemuDomainDetachDeviceDiskLive(struct qemud_driver *driver, else if (dev->data.disk->bus == VIR_DOMAIN_DISK_BUS_USB) ret = qemuDomainDetachDiskDevice(driver, vm, dev); else - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("This type of disk cannot be hot unplugged")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("This type of disk cannot be hot unplugged")); break; default: - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("disk device type '%s' cannot be detached"), - virDomainDiskDeviceTypeToString(disk->type)); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("disk device type '%s' cannot be detached"), + virDomainDiskDeviceTypeToString(disk->type)); break; } return ret; @@ -5412,9 +5412,9 @@ qemuDomainDetachDeviceControllerLive(struct qemud_driver *driver, ret = qemuDomainDetachPciControllerDevice(driver, vm, dev); break; default : - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("disk controller bus '%s' cannot be hotunplugged."), - virDomainControllerTypeToString(cont->type)); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("disk controller bus '%s' cannot be hotunplugged."), + virDomainControllerTypeToString(cont->type)); } return ret; } @@ -5444,8 +5444,8 @@ qemuDomainDetachDeviceLive(virDomainObjPtr vm, ret = qemuDomainDetachHostDevice(driver, vm, dev); break; default: - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", _("This type of device cannot be hot unplugged")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + "%s", _("This type of device cannot be hot unplugged")); break; } @@ -5465,9 +5465,9 @@ qemuDomainChangeDiskMediaLive(virDomainObjPtr vm, if (qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_DEVICES)) { if (virCgroupForDomain(driver->cgroup, vm->def->name, &cgroup, 0) != 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to find cgroup for %s"), - vm->def->name); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Unable to find cgroup for %s"), + vm->def->name); goto end; } if (qemuSetupDiskCgroup(driver, vm, cgroup, disk) < 0) @@ -5482,9 +5482,9 @@ qemuDomainChangeDiskMediaLive(virDomainObjPtr vm, dev->data.disk = NULL; break; default: - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("disk bus '%s' cannot be updated."), - virDomainDiskBusTypeToString(disk->bus)); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("disk bus '%s' cannot be updated."), + virDomainDiskBusTypeToString(disk->bus)); break; } @@ -5519,9 +5519,9 @@ qemuDomainUpdateDeviceLive(virDomainObjPtr vm, ret = qemuDomainChangeNet(driver, vm, dom, dev->data.net); break; default: - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("device type '%s' cannot be updated"), - virDomainDeviceTypeToString(dev->type)); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("device type '%s' cannot be updated"), + virDomainDeviceTypeToString(dev->type)); break; } @@ -5541,8 +5541,8 @@ qemuDomainAttachDeviceConfig(virDomainDefPtr vmdef, case VIR_DOMAIN_DEVICE_DISK: disk = dev->data.disk; if (virDomainDiskIndexByName(vmdef, disk->dst, true) >= 0) { - qemuReportError(VIR_ERR_INVALID_ARG, - _("target %s already exists."), disk->dst); + virReportError(VIR_ERR_INVALID_ARG, + _("target %s already exists."), disk->dst); return -1; } if (virDomainDiskInsert(vmdef, disk)) { @@ -5564,8 +5564,8 @@ qemuDomainAttachDeviceConfig(virDomainDefPtr vmdef, char macbuf[VIR_MAC_STRING_BUFLEN]; virMacAddrFormat(&net->mac, macbuf); - qemuReportError(VIR_ERR_INVALID_ARG, - _("mac %s already exists"), macbuf); + virReportError(VIR_ERR_INVALID_ARG, + _("mac %s already exists"), macbuf); return -1; } if (virDomainNetInsert(vmdef, net)) { @@ -5580,8 +5580,8 @@ qemuDomainAttachDeviceConfig(virDomainDefPtr vmdef, case VIR_DOMAIN_DEVICE_HOSTDEV: hostdev = dev->data.hostdev; if (virDomainHostdevFind(vmdef, hostdev, NULL) >= 0) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("device is already in the domain configuration")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("device is already in the domain configuration")); return -1; } if (virDomainHostdevInsert(vmdef, hostdev)) { @@ -5596,9 +5596,9 @@ qemuDomainAttachDeviceConfig(virDomainDefPtr vmdef, case VIR_DOMAIN_DEVICE_LEASE: lease = dev->data.lease; if (virDomainLeaseIndex(vmdef, lease) >= 0) { - qemuReportError(VIR_ERR_INVALID_ARG, - _("Lease %s in lockspace %s already exists"), - lease->key, NULLSTR(lease->lockspace)); + virReportError(VIR_ERR_INVALID_ARG, + _("Lease %s in lockspace %s already exists"), + lease->key, NULLSTR(lease->lockspace)); return -1; } if (virDomainLeaseInsert(vmdef, lease) < 0) @@ -5609,8 +5609,8 @@ qemuDomainAttachDeviceConfig(virDomainDefPtr vmdef, break; default: - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("persistent attach of device is not supported")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("persistent attach of device is not supported")); return -1; } return 0; @@ -5630,8 +5630,8 @@ qemuDomainDetachDeviceConfig(virDomainDefPtr vmdef, case VIR_DOMAIN_DEVICE_DISK: disk = dev->data.disk; if (!(det_disk = virDomainDiskRemoveByName(vmdef, disk->dst))) { - qemuReportError(VIR_ERR_INVALID_ARG, - _("no target device %s"), disk->dst); + virReportError(VIR_ERR_INVALID_ARG, + _("no target device %s"), disk->dst); return -1; } virDomainDiskDefFree(det_disk); @@ -5643,8 +5643,8 @@ qemuDomainDetachDeviceConfig(virDomainDefPtr vmdef, char macbuf[VIR_MAC_STRING_BUFLEN]; virMacAddrFormat(&net->mac, macbuf); - qemuReportError(VIR_ERR_INVALID_ARG, - _("no nic of mac %s"), macbuf); + virReportError(VIR_ERR_INVALID_ARG, + _("no nic of mac %s"), macbuf); return -1; } virDomainNetDefFree(det_net); @@ -5655,8 +5655,8 @@ qemuDomainDetachDeviceConfig(virDomainDefPtr vmdef, hostdev = dev->data.hostdev; if ((idx = virDomainHostdevFind(vmdef, hostdev, &det_hostdev)) < 0) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("device not present in domain configuration")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("device not present in domain configuration")); return -1; } virDomainHostdevRemove(vmdef, idx); @@ -5667,17 +5667,17 @@ qemuDomainDetachDeviceConfig(virDomainDefPtr vmdef, case VIR_DOMAIN_DEVICE_LEASE: lease = dev->data.lease; if (!(det_lease = virDomainLeaseRemove(vmdef, lease))) { - qemuReportError(VIR_ERR_INVALID_ARG, - _("Lease %s in lockspace %s does not exist"), - lease->key, NULLSTR(lease->lockspace)); + virReportError(VIR_ERR_INVALID_ARG, + _("Lease %s in lockspace %s does not exist"), + lease->key, NULLSTR(lease->lockspace)); return -1; } virDomainLeaseDefFree(det_lease); break; default: - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("persistent detach of device is not supported")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("persistent detach of device is not supported")); return -1; } return 0; @@ -5696,15 +5696,15 @@ qemuDomainUpdateDeviceConfig(virDomainDefPtr vmdef, disk = dev->data.disk; pos = virDomainDiskIndexByName(vmdef, disk->dst, false); if (pos < 0) { - qemuReportError(VIR_ERR_INVALID_ARG, - _("target %s doesn't exist."), disk->dst); + virReportError(VIR_ERR_INVALID_ARG, + _("target %s doesn't exist."), disk->dst); return -1; } orig = vmdef->disks[pos]; if (!(orig->device == VIR_DOMAIN_DISK_DEVICE_CDROM) && !(orig->device == VIR_DOMAIN_DISK_DEVICE_FLOPPY)) { - qemuReportError(VIR_ERR_INVALID_ARG, - _("this disk doesn't support update")); + virReportError(VIR_ERR_INVALID_ARG, + _("this disk doesn't support update")); return -1; } /* @@ -5734,8 +5734,8 @@ qemuDomainUpdateDeviceConfig(virDomainDefPtr vmdef, char macbuf[VIR_MAC_STRING_BUFLEN]; virMacAddrFormat(&net->mac, macbuf); - qemuReportError(VIR_ERR_INVALID_ARG, - _("mac %s doesn't exist"), macbuf); + virReportError(VIR_ERR_INVALID_ARG, + _("mac %s doesn't exist"), macbuf); return -1; } @@ -5749,8 +5749,8 @@ qemuDomainUpdateDeviceConfig(virDomainDefPtr vmdef, break; default: - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("persistent update of device is not supported")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("persistent update of device is not supported")); return -1; } return 0; @@ -5788,8 +5788,8 @@ qemuDomainModifyDeviceFlags(virDomainPtr dom, const char *xml, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -5804,17 +5804,17 @@ qemuDomainModifyDeviceFlags(virDomainPtr dom, const char *xml, flags |= VIR_DOMAIN_AFFECT_CONFIG; /* check consistency between flags and the vm state */ if (flags & VIR_DOMAIN_AFFECT_LIVE) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", - _("cannot do live update a device on " - "inactive domain")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", + _("cannot do live update a device on " + "inactive domain")); goto endjob; } } if ((flags & VIR_DOMAIN_AFFECT_CONFIG) && !vm->persistent) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("cannot modify device on transient domain")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("cannot modify device on transient domain")); goto endjob; } @@ -5850,8 +5850,8 @@ qemuDomainModifyDeviceFlags(virDomainPtr dom, const char *xml, ret = qemuDomainUpdateDeviceConfig(vmdef, dev); break; default: - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unknown domain modify action %d"), action); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unknown domain modify action %d"), action); break; } @@ -5871,8 +5871,8 @@ qemuDomainModifyDeviceFlags(virDomainPtr dom, const char *xml, ret = qemuDomainUpdateDeviceLive(vm, dev_copy, dom, force); break; default: - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unknown domain modify action %d"), action); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unknown domain modify action %d"), action); ret = -1; break; } @@ -5959,8 +5959,8 @@ static int qemudDomainGetAutostart(virDomainPtr dom, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -5986,14 +5986,14 @@ static int qemudDomainSetAutostart(virDomainPtr dom, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } if (!vm->persistent) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("cannot set autostart for transient domain")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("cannot set autostart for transient domain")); goto cleanup; } @@ -6084,8 +6084,8 @@ static char *qemuGetSchedulerType(virDomainPtr dom, qemuDriverLock(driver); if (!qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_CPU)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("cgroup CPU controller is not mounted")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("cgroup CPU controller is not mounted")); goto cleanup; } @@ -6188,8 +6188,8 @@ qemuDomainParseDeviceWeightStr(char *deviceWeightStr, return 0; error: - qemuReportError(VIR_ERR_INVALID_ARG, - _("unable to parse device weight '%s'"), deviceWeightStr); + virReportError(VIR_ERR_INVALID_ARG, + _("unable to parse device weight '%s'"), deviceWeightStr); cleanup: virBlkioDeviceWeightArrayClear(result, ndevices); VIR_FREE(result); @@ -6263,8 +6263,8 @@ qemuDomainSetBlkioParameters(virDomainPtr dom, vm = virDomainFindByUUID(&driver->domains, dom->uuid); if (vm == NULL) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("No such domain %s"), dom->uuid); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("No such domain %s"), dom->uuid); goto cleanup; } @@ -6274,15 +6274,15 @@ qemuDomainSetBlkioParameters(virDomainPtr dom, if (flags & VIR_DOMAIN_AFFECT_LIVE) { if (!qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_BLKIO)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - _("blkio cgroup isn't mounted")); + virReportError(VIR_ERR_OPERATION_INVALID, + _("blkio cgroup isn't mounted")); goto cleanup; } if (virCgroupForDomain(driver->cgroup, vm->def->name, &group, 0) != 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot find cgroup for domain %s"), - vm->def->name); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot find cgroup for domain %s"), + vm->def->name); goto cleanup; } } @@ -6295,8 +6295,8 @@ qemuDomainSetBlkioParameters(virDomainPtr dom, if (STREQ(param->field, VIR_DOMAIN_BLKIO_WEIGHT)) { if (params[i].value.ui > 1000 || params[i].value.ui < 100) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("out of blkio weight range.")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("out of blkio weight range.")); ret = -1; continue; } @@ -6351,8 +6351,8 @@ qemuDomainSetBlkioParameters(virDomainPtr dom, if (STREQ(param->field, VIR_DOMAIN_BLKIO_WEIGHT)) { if (params[i].value.ui > 1000 || params[i].value.ui < 100) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("out of blkio weight range.")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("out of blkio weight range.")); ret = -1; continue; } @@ -6417,8 +6417,8 @@ qemuDomainGetBlkioParameters(virDomainPtr dom, vm = virDomainFindByUUID(&driver->domains, dom->uuid); if (vm == NULL) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("No such domain %s"), dom->uuid); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("No such domain %s"), dom->uuid); goto cleanup; } @@ -6435,13 +6435,13 @@ qemuDomainGetBlkioParameters(virDomainPtr dom, if (flags & VIR_DOMAIN_AFFECT_LIVE) { if (!qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_BLKIO)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, _("blkio cgroup isn't mounted")); + virReportError(VIR_ERR_OPERATION_INVALID, _("blkio cgroup isn't mounted")); goto cleanup; } if (virCgroupForDomain(driver->cgroup, vm->def->name, &group, 0) != 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot find cgroup for domain %s"), vm->def->name); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot find cgroup for domain %s"), vm->def->name); goto cleanup; } } @@ -6507,9 +6507,9 @@ qemuDomainGetBlkioParameters(virDomainPtr dom, switch (i) { case 0: /* fill blkio weight here */ if (virStrcpyStatic(param->field, VIR_DOMAIN_BLKIO_WEIGHT) == NULL) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Field name '%s' too long"), - VIR_DOMAIN_BLKIO_WEIGHT); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Field name '%s' too long"), + VIR_DOMAIN_BLKIO_WEIGHT); goto cleanup; } param->value.ui = persistentDef->blkio.weight; @@ -6547,9 +6547,9 @@ qemuDomainGetBlkioParameters(virDomainPtr dom, param->type = VIR_TYPED_PARAM_STRING; if (virStrcpyStatic(param->field, VIR_DOMAIN_BLKIO_DEVICE_WEIGHT) == NULL) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Field name '%s' too long"), - VIR_DOMAIN_BLKIO_DEVICE_WEIGHT); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Field name '%s' too long"), + VIR_DOMAIN_BLKIO_DEVICE_WEIGHT); goto cleanup; } break; @@ -6605,8 +6605,8 @@ qemuDomainSetMemoryParameters(virDomainPtr dom, vm = virDomainFindByUUID(&driver->domains, dom->uuid); if (vm == NULL) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("No such domain %s"), dom->uuid); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("No such domain %s"), dom->uuid); goto cleanup; } @@ -6616,14 +6616,14 @@ qemuDomainSetMemoryParameters(virDomainPtr dom, if (flags & VIR_DOMAIN_AFFECT_LIVE) { if (!qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_MEMORY)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("cgroup memory controller is not mounted")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("cgroup memory controller is not mounted")); goto cleanup; } if (virCgroupForDomain(driver->cgroup, vm->def->name, &group, 0) != 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot find cgroup for domain %s"), vm->def->name); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot find cgroup for domain %s"), vm->def->name); goto cleanup; } } @@ -6712,8 +6712,8 @@ qemuDomainGetMemoryParameters(virDomainPtr dom, vm = virDomainFindByUUID(&driver->domains, dom->uuid); if (vm == NULL) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("No such domain %s"), dom->uuid); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("No such domain %s"), dom->uuid); goto cleanup; } @@ -6723,14 +6723,14 @@ qemuDomainGetMemoryParameters(virDomainPtr dom, if (flags & VIR_DOMAIN_AFFECT_LIVE) { if (!qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_MEMORY)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("cgroup memory controller is not mounted")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("cgroup memory controller is not mounted")); goto cleanup; } if (virCgroupForDomain(driver->cgroup, vm->def->name, &group, 0) != 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot find cgroup for domain %s"), vm->def->name); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot find cgroup for domain %s"), vm->def->name); goto cleanup; } } @@ -6874,8 +6874,8 @@ qemuDomainSetNumaParameters(virDomainPtr dom, vm = virDomainFindByUUID(&driver->domains, dom->uuid); if (vm == NULL) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("No such domain %s"), dom->uuid); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("No such domain %s"), dom->uuid); goto cleanup; } @@ -6885,15 +6885,15 @@ qemuDomainSetNumaParameters(virDomainPtr dom, if (flags & VIR_DOMAIN_AFFECT_LIVE) { if (!qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_CPUSET)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("cgroup cpuset controller is not mounted")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("cgroup cpuset controller is not mounted")); goto cleanup; } if (virCgroupForDomain(driver->cgroup, vm->def->name, &group, 0) != 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot find cgroup for domain %s"), - vm->def->name); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot find cgroup for domain %s"), + vm->def->name); goto cleanup; } } @@ -6905,8 +6905,8 @@ qemuDomainSetNumaParameters(virDomainPtr dom, if (STREQ(param->field, VIR_DOMAIN_NUMA_MODE)) { if ((flags & VIR_DOMAIN_AFFECT_LIVE) && vm->def->numatune.memory.mode != params[i].value.i) { - qemuReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("can't change numa mode for running domain")); + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("can't change numa mode for running domain")); ret = -1; goto cleanup; } @@ -6922,9 +6922,9 @@ qemuDomainSetNumaParameters(virDomainPtr dom, if (flags & VIR_DOMAIN_AFFECT_LIVE) { if (vm->def->numatune.memory.mode != VIR_DOMAIN_NUMATUNE_MEM_STRICT) { - qemuReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("change of nodeset for running domain " - "requires strict numa mode")); + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("change of nodeset for running domain " + "requires strict numa mode")); ret = -1; continue; } @@ -7037,8 +7037,8 @@ qemuDomainGetNumaParameters(virDomainPtr dom, vm = virDomainFindByUUID(&driver->domains, dom->uuid); if (vm == NULL) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("No such domain %s"), dom->uuid); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("No such domain %s"), dom->uuid); goto cleanup; } @@ -7054,15 +7054,15 @@ qemuDomainGetNumaParameters(virDomainPtr dom, if (flags & VIR_DOMAIN_AFFECT_LIVE) { if (!qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_MEMORY)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("cgroup memory controller is not mounted")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("cgroup memory controller is not mounted")); goto cleanup; } if (virCgroupForDomain(driver->cgroup, vm->def->name, &group, 0) != 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot find cgroup for domain %s"), - vm->def->name); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot find cgroup for domain %s"), + vm->def->name); goto cleanup; } } @@ -7261,8 +7261,8 @@ qemuSetSchedulerParametersFlags(virDomainPtr dom, vm = virDomainFindByUUID(&driver->domains, dom->uuid); if (vm == NULL) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("No such domain %s"), dom->uuid); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("No such domain %s"), dom->uuid); goto cleanup; } @@ -7279,14 +7279,14 @@ qemuSetSchedulerParametersFlags(virDomainPtr dom, if (flags & VIR_DOMAIN_AFFECT_LIVE) { if (!qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_CPU)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("cgroup CPU controller is not mounted")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("cgroup CPU controller is not mounted")); goto cleanup; } if (virCgroupForDomain(driver->cgroup, vm->def->name, &group, 0) != 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot find cgroup for domain %s"), - vm->def->name); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot find cgroup for domain %s"), + vm->def->name); goto cleanup; } } @@ -7475,8 +7475,8 @@ qemuGetSchedulerParametersFlags(virDomainPtr dom, vm = virDomainFindByUUID(&driver->domains, dom->uuid); if (vm == NULL) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("No such domain %s"), dom->uuid); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("No such domain %s"), dom->uuid); goto cleanup; } @@ -7494,14 +7494,14 @@ qemuGetSchedulerParametersFlags(virDomainPtr dom, } if (!qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_CPU)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("cgroup CPU controller is not mounted")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("cgroup CPU controller is not mounted")); goto cleanup; } if (virCgroupForDomain(driver->cgroup, vm->def->name, &group, 0) != 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot find cgroup for domain %s"), vm->def->name); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot find cgroup for domain %s"), vm->def->name); goto cleanup; } @@ -7584,17 +7584,17 @@ qemuDomainBlockResize(virDomainPtr dom, virCheckFlags(VIR_DOMAIN_BLOCK_RESIZE_BYTES, -1); if (path[0] == '\0') { - qemuReportError(VIR_ERR_INVALID_ARG, - "%s", _("empty path")); + virReportError(VIR_ERR_INVALID_ARG, + "%s", _("empty path")); return -1; } /* We prefer operating on bytes. */ if ((flags & VIR_DOMAIN_BLOCK_RESIZE_BYTES) == 0) { if (size > ULLONG_MAX / 1024) { - qemuReportError(VIR_ERR_OVERFLOW, - _("size must be less than %llu"), - ULLONG_MAX / 1024); + virReportError(VIR_ERR_OVERFLOW, + _("size must be less than %llu"), + ULLONG_MAX / 1024); return -1; } size *= 1024; @@ -7607,8 +7607,8 @@ qemuDomainBlockResize(virDomainPtr dom, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain matching uuid '%s'"), uuidstr); goto cleanup; } @@ -7618,14 +7618,14 @@ qemuDomainBlockResize(virDomainPtr dom, goto cleanup; if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); goto endjob; } if ((i = virDomainDiskIndexByName(vm->def, path, false)) < 0) { - qemuReportError(VIR_ERR_INVALID_ARG, - _("invalid path: %s"), path); + virReportError(VIR_ERR_INVALID_ARG, + _("invalid path: %s"), path); goto endjob; } disk = vm->def->disks[i]; @@ -7677,27 +7677,27 @@ qemuDomainBlockStats(virDomainPtr dom, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); goto cleanup; } if ((i = virDomainDiskIndexByName(vm->def, path, false)) < 0) { - qemuReportError(VIR_ERR_INVALID_ARG, - _("invalid path: %s"), path); + virReportError(VIR_ERR_INVALID_ARG, + _("invalid path: %s"), path); goto cleanup; } disk = vm->def->disks[i]; if (!disk->info.alias) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("missing disk device alias name for %s"), disk->dst); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("missing disk device alias name for %s"), disk->dst); goto cleanup; } @@ -7706,8 +7706,8 @@ qemuDomainBlockStats(virDomainPtr dom, goto cleanup; if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); goto endjob; } @@ -7762,29 +7762,29 @@ qemuDomainBlockStatsFlags(virDomainPtr dom, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); goto cleanup; } if (*nparams != 0) { if ((i = virDomainDiskIndexByName(vm->def, path, false)) < 0) { - qemuReportError(VIR_ERR_INVALID_ARG, - _("invalid path: %s"), path); + virReportError(VIR_ERR_INVALID_ARG, + _("invalid path: %s"), path); goto cleanup; } disk = vm->def->disks[i]; if (!disk->info.alias) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("missing disk device alias name for %s"), - disk->dst); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("missing disk device alias name for %s"), + disk->dst); goto cleanup; } } @@ -7796,8 +7796,8 @@ qemuDomainBlockStatsFlags(virDomainPtr dom, goto cleanup; if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); goto endjob; } @@ -7931,14 +7931,14 @@ qemudDomainInterfaceStats (virDomainPtr dom, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); goto cleanup; } @@ -7954,8 +7954,8 @@ qemudDomainInterfaceStats (virDomainPtr dom, if (ret == 0) ret = linuxDomainInterfaceStats(path, stats); else - qemuReportError(VIR_ERR_INVALID_ARG, - _("invalid path, '%s' is not a known interface"), path); + virReportError(VIR_ERR_INVALID_ARG, + _("invalid path, '%s' is not a known interface"), path); cleanup: if (vm) @@ -7968,8 +7968,8 @@ qemudDomainInterfaceStats (virDomainPtr dom, const char *path ATTRIBUTE_UNUSED, struct _virDomainInterfaceStats *stats ATTRIBUTE_UNUSED) { - qemuReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("interface stats not implemented on this platform")); + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("interface stats not implemented on this platform")); return -1; } #endif @@ -8012,8 +8012,8 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom, vm = virDomainFindByUUID(&driver->domains, dom->uuid); if (vm == NULL) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("No such domain %s"), dom->uuid); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("No such domain %s"), dom->uuid); goto cleanup; } @@ -8024,16 +8024,16 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom, if (flags & VIR_DOMAIN_AFFECT_LIVE) { net = virDomainNetFind(vm->def, device); if (!net) { - qemuReportError(VIR_ERR_INVALID_ARG, - _("Can't find device %s"), device); + virReportError(VIR_ERR_INVALID_ARG, + _("Can't find device %s"), device); goto cleanup; } } if (flags & VIR_DOMAIN_AFFECT_CONFIG) { persistentNet = virDomainNetFind(persistentDef, device); if (!persistentNet) { - qemuReportError(VIR_ERR_INVALID_ARG, - _("Can't find device %s"), device); + virReportError(VIR_ERR_INVALID_ARG, + _("Can't find device %s"), device); goto cleanup; } } @@ -8106,9 +8106,9 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom, } if (virNetDevBandwidthSet(net->ifname, newBandwidth) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot set bandwidth limits on %s"), - device); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot set bandwidth limits on %s"), + device); goto cleanup; } @@ -8175,8 +8175,8 @@ qemuDomainGetInterfaceParameters(virDomainPtr dom, vm = virDomainFindByUUID(&driver->domains, dom->uuid); if (vm == NULL) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("No such domain %s"), dom->uuid); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("No such domain %s"), dom->uuid); goto cleanup; } @@ -8196,8 +8196,8 @@ qemuDomainGetInterfaceParameters(virDomainPtr dom, net = virDomainNetFind(def, device); if (!net) { - qemuReportError(VIR_ERR_INVALID_ARG, - _("Can't find device %s"), device); + virReportError(VIR_ERR_INVALID_ARG, + _("Can't find device %s"), device); goto cleanup; } @@ -8289,8 +8289,8 @@ qemudDomainMemoryStats (virDomainPtr dom, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -8298,8 +8298,8 @@ qemudDomainMemoryStats (virDomainPtr dom, goto cleanup; if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); } else { qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjEnterMonitor(driver, vm); @@ -8309,8 +8309,8 @@ qemudDomainMemoryStats (virDomainPtr dom, if (ret >= 0 && ret < nr_stats) { long rss; if (qemudGetProcessInfo(NULL, NULL, &rss, vm->pid, 0) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", - _("cannot get RSS for domain")); + virReportError(VIR_ERR_OPERATION_FAILED, "%s", + _("cannot get RSS for domain")); } else { stats[ret].tag = VIR_DOMAIN_MEMORY_STAT_RSS; stats[ret].val = rss; @@ -8350,21 +8350,21 @@ qemudDomainBlockPeek (virDomainPtr dom, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } if (!path || path[0] == '\0') { - qemuReportError(VIR_ERR_INVALID_ARG, - "%s", _("NULL or empty path")); + virReportError(VIR_ERR_INVALID_ARG, + "%s", _("NULL or empty path")); goto cleanup; } /* Check the path belongs to this domain. */ if (!(actual = virDomainDiskPathByName(vm->def, path))) { - qemuReportError(VIR_ERR_INVALID_ARG, - _("invalid path '%s'"), path); + virReportError(VIR_ERR_INVALID_ARG, + _("invalid path '%s'"), path); goto cleanup; } path = actual; @@ -8418,14 +8418,14 @@ qemudDomainMemoryPeek (virDomainPtr dom, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } if (flags != VIR_MEMORY_VIRTUAL && flags != VIR_MEMORY_PHYSICAL) { - qemuReportError(VIR_ERR_INVALID_ARG, - "%s", _("flags parameter must be VIR_MEMORY_VIRTUAL or VIR_MEMORY_PHYSICAL")); + virReportError(VIR_ERR_INVALID_ARG, + "%s", _("flags parameter must be VIR_MEMORY_VIRTUAL or VIR_MEMORY_PHYSICAL")); goto cleanup; } @@ -8433,8 +8433,8 @@ qemudDomainMemoryPeek (virDomainPtr dom, goto cleanup; if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); goto endjob; } @@ -8515,28 +8515,28 @@ static int qemuDomainGetBlockInfo(virDomainPtr dom, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } if (!path || path[0] == '\0') { - qemuReportError(VIR_ERR_INVALID_ARG, - "%s", _("NULL or empty path")); + virReportError(VIR_ERR_INVALID_ARG, + "%s", _("NULL or empty path")); goto cleanup; } /* Check the path belongs to this domain. */ if ((i = virDomainDiskIndexByName(vm->def, path, false)) < 0) { - qemuReportError(VIR_ERR_INVALID_ARG, - _("invalid path %s not assigned to domain"), path); + virReportError(VIR_ERR_INVALID_ARG, + _("invalid path %s not assigned to domain"), path); goto cleanup; } disk = vm->def->disks[i]; if (!disk->src) { - qemuReportError(VIR_ERR_INVALID_ARG, - _("disk %s does not currently have a source assigned"), - path); + virReportError(VIR_ERR_INVALID_ARG, + _("disk %s does not currently have a source assigned"), + path); goto cleanup; } path = disk->src; @@ -8552,9 +8552,9 @@ static int qemuDomainGetBlockInfo(virDomainPtr dom, /* Probe for magic formats */ if (disk->driverType) { if ((format = virStorageFileFormatTypeFromString(disk->driverType)) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unknown disk format %s for %s"), - disk->driverType, disk->src); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unknown disk format %s for %s"), + disk->driverType, disk->src); goto cleanup; } } else { @@ -8562,9 +8562,9 @@ static int qemuDomainGetBlockInfo(virDomainPtr dom, if ((format = virStorageFileProbeFormat(disk->src)) < 0) goto cleanup; } else { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("no disk format for %s and probing is disabled"), - disk->src); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("no disk format for %s and probing is disabled"), + disk->src); goto cleanup; } } @@ -8757,25 +8757,25 @@ qemudDomainMigratePrepareTunnel(virConnectPtr dconn, qemuDriverLock(driver); if (!dom_xml) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("no domain XML passed")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("no domain XML passed")); goto cleanup; } if (!(flags & VIR_MIGRATE_TUNNELLED)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("PrepareTunnel called but no TUNNELLED flag set")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("PrepareTunnel called but no TUNNELLED flag set")); goto cleanup; } if (st == NULL) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("tunnelled migration requested but NULL stream passed")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("tunnelled migration requested but NULL stream passed")); goto cleanup; } if (virLockManagerPluginUsesState(driver->lockManager)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Cannot use migrate v2 protocol with lock manager %s"), - virLockManagerPluginGetName(driver->lockManager)); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Cannot use migrate v2 protocol with lock manager %s"), + virLockManagerPluginGetName(driver->lockManager)); goto cleanup; } @@ -8813,9 +8813,9 @@ qemudDomainMigratePrepare2 (virConnectPtr dconn, qemuDriverLock(driver); if (virLockManagerPluginUsesState(driver->lockManager)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Cannot use migrate v2 protocol with lock manager %s"), - virLockManagerPluginGetName(driver->lockManager)); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Cannot use migrate v2 protocol with lock manager %s"), + virLockManagerPluginGetName(driver->lockManager)); goto cleanup; } @@ -8823,14 +8823,14 @@ qemudDomainMigratePrepare2 (virConnectPtr dconn, /* this is a logical error; we never should have gotten here with * VIR_MIGRATE_TUNNELLED set */ - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("Tunnelled migration requested but invalid RPC method called")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("Tunnelled migration requested but invalid RPC method called")); goto cleanup; } if (!dom_xml) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("no domain XML passed")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("no domain XML passed")); goto cleanup; } @@ -8868,9 +8868,9 @@ qemudDomainMigratePerform (virDomainPtr dom, qemuDriverLock(driver); if (virLockManagerPluginUsesState(driver->lockManager)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Cannot use migrate v2 protocol with lock manager %s"), - virLockManagerPluginGetName(driver->lockManager)); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Cannot use migrate v2 protocol with lock manager %s"), + virLockManagerPluginGetName(driver->lockManager)); goto cleanup; } @@ -8878,8 +8878,8 @@ qemudDomainMigratePerform (virDomainPtr dom, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -8924,8 +8924,8 @@ qemudDomainMigrateFinish2 (virConnectPtr dconn, qemuDriverLock(driver); vm = virDomainFindByName(&driver->domains, dname); if (!vm) { - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching name '%s'"), dname); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching name '%s'"), dname); goto cleanup; } @@ -8968,8 +8968,8 @@ qemuDomainMigrateBegin3(virDomainPtr domain, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(domain->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -8984,8 +8984,8 @@ qemuDomainMigrateBegin3(virDomainPtr domain, } if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); goto endjob; } @@ -9011,8 +9011,8 @@ qemuDomainMigrateBegin3(virDomainPtr domain, goto endjob; if (qemuMigrationJobContinue(vm) == 0) { vm = NULL; - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("domain disappeared")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("domain disappeared")); VIR_FREE(xml); if (cookieout) VIR_FREE(*cookieout); @@ -9063,14 +9063,14 @@ qemuDomainMigratePrepare3(virConnectPtr dconn, /* this is a logical error; we never should have gotten here with * VIR_MIGRATE_TUNNELLED set */ - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("Tunnelled migration requested but invalid RPC method called")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("Tunnelled migration requested but invalid RPC method called")); goto cleanup; } if (!dom_xml) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("no domain XML passed")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("no domain XML passed")); goto cleanup; } @@ -9104,18 +9104,18 @@ qemuDomainMigratePrepareTunnel3(virConnectPtr dconn, virCheckFlags(QEMU_MIGRATION_FLAGS, -1); if (!dom_xml) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("no domain XML passed")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("no domain XML passed")); goto cleanup; } if (!(flags & VIR_MIGRATE_TUNNELLED)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("PrepareTunnel called but no TUNNELLED flag set")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("PrepareTunnel called but no TUNNELLED flag set")); goto cleanup; } if (st == NULL) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("tunnelled migration requested but NULL stream passed")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("tunnelled migration requested but NULL stream passed")); goto cleanup; } @@ -9155,8 +9155,8 @@ qemuDomainMigratePerform3(virDomainPtr dom, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -9192,8 +9192,8 @@ qemuDomainMigrateFinish3(virConnectPtr dconn, qemuDriverLock(driver); vm = virDomainFindByName(&driver->domains, dname); if (!vm) { - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching name '%s'"), dname); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching name '%s'"), dname); goto cleanup; } @@ -9226,8 +9226,8 @@ qemuDomainMigrateConfirm3(virDomainPtr domain, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(domain->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -9298,8 +9298,8 @@ qemudNodeDeviceGetPciInfo (virNodeDevicePtr dev, } if (!cap) { - qemuReportError(VIR_ERR_INVALID_ARG, - _("device %s is not a PCI device"), dev->name); + virReportError(VIR_ERR_INVALID_ARG, + _("device %s is not a PCI device"), dev->name); goto out; } @@ -9362,13 +9362,13 @@ qemudNodeDeviceReAttach (virNodeDevicePtr dev) const char *other_name = pciDeviceGetUsedBy(other); if (other_name) - qemuReportError(VIR_ERR_OPERATION_INVALID, - _("PCI device %s is still in use by domain %s"), - pciDeviceGetName(pci), other_name); + virReportError(VIR_ERR_OPERATION_INVALID, + _("PCI device %s is still in use by domain %s"), + pciDeviceGetName(pci), other_name); else - qemuReportError(VIR_ERR_OPERATION_INVALID, - _("PCI device %s is still in use"), - pciDeviceGetName(pci)); + virReportError(VIR_ERR_OPERATION_INVALID, + _("PCI device %s is still in use"), + pciDeviceGetName(pci)); } pciDeviceReAttachInit(pci); @@ -9426,8 +9426,8 @@ qemuCPUCompare(virConnectPtr conn, qemuDriverLock(driver); if (!driver->caps) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("cannot get host capabilities")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("cannot get host capabilities")); } else if (!driver->caps->host.cpu) { VIR_WARN("cannot get host CPU capabilities"); ret = VIR_CPU_COMPARE_INCOMPATIBLE; @@ -9470,8 +9470,8 @@ static int qemuDomainGetJobInfo(virDomainPtr dom, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -9494,8 +9494,8 @@ static int qemuDomainGetJobInfo(virDomainPtr dom, info->type = VIR_DOMAIN_JOB_NONE; } } else { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); goto cleanup; } @@ -9520,8 +9520,8 @@ static int qemuDomainAbortJob(virDomainPtr dom) { if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -9529,21 +9529,21 @@ static int qemuDomainAbortJob(virDomainPtr dom) { goto cleanup; if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); goto endjob; } priv = vm->privateData; if (!priv->job.asyncJob || priv->job.dump_memory_only) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("no job is active on the domain")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("no job is active on the domain")); goto endjob; } else if (priv->job.asyncJob == QEMU_ASYNC_JOB_MIGRATION_IN) { - qemuReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("cannot abort incoming migration;" - " use virDomainDestroy instead")); + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("cannot abort incoming migration;" + " use virDomainDestroy instead")); goto endjob; } @@ -9582,8 +9582,8 @@ qemuDomainMigrateSetMaxDowntime(virDomainPtr dom, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); return -1; } @@ -9591,16 +9591,16 @@ qemuDomainMigrateSetMaxDowntime(virDomainPtr dom, goto cleanup; if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); goto endjob; } priv = vm->privateData; if (priv->job.asyncJob != QEMU_ASYNC_JOB_MIGRATION_OUT) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not being migrated")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not being migrated")); goto endjob; } @@ -9638,8 +9638,8 @@ qemuDomainMigrateSetMaxSpeed(virDomainPtr dom, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); return -1; } @@ -9649,8 +9649,8 @@ qemuDomainMigrateSetMaxSpeed(virDomainPtr dom, goto cleanup; if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); goto endjob; } @@ -9695,8 +9695,8 @@ qemuDomainMigrateGetMaxSpeed(virDomainPtr dom, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -9729,9 +9729,9 @@ qemuDomainSnapshotIsAllowed(virDomainObjPtr vm) if ((disk->device == VIR_DOMAIN_DISK_DEVICE_LUN) || (disk->device == VIR_DOMAIN_DISK_DEVICE_DISK && STRNEQ_NULLABLE(disk->driverType, "qcow2"))) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - _("Disk '%s' does not support snapshotting"), - disk->src); + virReportError(VIR_ERR_OPERATION_INVALID, + _("Disk '%s' does not support snapshotting"), + disk->src); return false; } } @@ -9746,14 +9746,14 @@ qemuDomainSnapshotFSFreeze(struct qemud_driver *driver, int freezed; if (priv->agentError) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("QEMU guest agent is not " - "available due to an error")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("QEMU guest agent is not " + "available due to an error")); return -1; } if (!priv->agent) { - qemuReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", - _("QEMU guest agent is not configured")); + virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", + _("QEMU guest agent is not configured")); return -1; } @@ -9774,15 +9774,15 @@ qemuDomainSnapshotFSThaw(struct qemud_driver *driver, if (priv->agentError) { if (report) - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("QEMU guest agent is not " - "available due to an error")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("QEMU guest agent is not " + "available due to an error")); return -1; } if (!priv->agent) { if (report) - qemuReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", - _("QEMU guest agent is not configured")); + virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", + _("QEMU guest agent is not configured")); return -1; } @@ -9824,8 +9824,8 @@ qemuDomainSnapshotCreateActive(virConnectPtr conn, return -1; if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); goto endjob; } @@ -9840,8 +9840,8 @@ qemuDomainSnapshotCreateActive(virConnectPtr conn, resume = true; if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("guest unexpectedly quit")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("guest unexpectedly quit")); goto cleanup; } } @@ -9874,8 +9874,8 @@ cleanup: VIR_DOMAIN_RUNNING_UNPAUSED, QEMU_ASYNC_JOB_NONE) < 0 && virGetLastError() == NULL) { - qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", - _("resuming after snapshot failed")); + virReportError(VIR_ERR_OPERATION_FAILED, "%s", + _("resuming after snapshot failed")); } endjob: @@ -9904,8 +9904,8 @@ qemuDomainSnapshotDiskPrepare(virDomainObjPtr vm, virDomainSnapshotDefPtr def, qemuDomainObjPrivatePtr priv = vm->privateData; if (allow_reuse && !qemuCapsGet(priv->qemuCaps, QEMU_CAPS_TRANSACTION)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("reuse is not supported with this QEMU binary")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("reuse is not supported with this QEMU binary")); goto cleanup; } @@ -9915,19 +9915,19 @@ qemuDomainSnapshotDiskPrepare(virDomainObjPtr vm, virDomainSnapshotDefPtr def, switch (disk->snapshot) { case VIR_DOMAIN_DISK_SNAPSHOT_INTERNAL: if (active) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("active qemu domains require external disk " - "snapshots; disk %s requested internal"), - disk->name); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("active qemu domains require external disk " + "snapshots; disk %s requested internal"), + disk->name); goto cleanup; } if (!vm->def->disks[i]->driverType || STRNEQ(vm->def->disks[i]->driverType, "qcow2")) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("internal snapshot for disk %s unsupported " - "for storage type %s"), - disk->name, - NULLSTR(vm->def->disks[i]->driverType)); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("internal snapshot for disk %s unsupported " + "for storage type %s"), + disk->name, + NULLSTR(vm->def->disks[i]->driverType)); goto cleanup; } found = true; @@ -9941,10 +9941,10 @@ qemuDomainSnapshotDiskPrepare(virDomainObjPtr vm, virDomainSnapshotDefPtr def, } } else if (STRNEQ(disk->driverType, "qcow2") && STRNEQ(disk->driverType, "qed")) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("external snapshot format for disk %s " - "is unsupported: %s"), - disk->name, disk->driverType); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("external snapshot format for disk %s " + "is unsupported: %s"), + disk->name, disk->driverType); goto cleanup; } if (stat(disk->file, &st) < 0) { @@ -9955,10 +9955,10 @@ qemuDomainSnapshotDiskPrepare(virDomainObjPtr vm, virDomainSnapshotDefPtr def, goto cleanup; } } else if (!(S_ISBLK(st.st_mode) || !st.st_size || allow_reuse)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("external snapshot file for disk %s already " - "exists and is not a block device: %s"), - disk->name, disk->file); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("external snapshot file for disk %s already " + "exists and is not a block device: %s"), + disk->name, disk->file); goto cleanup; } found = true; @@ -9970,16 +9970,16 @@ qemuDomainSnapshotDiskPrepare(virDomainObjPtr vm, virDomainSnapshotDefPtr def, case VIR_DOMAIN_DISK_SNAPSHOT_DEFAULT: default: - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("unexpected code path")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("unexpected code path")); goto cleanup; } } if (!found) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("disk snapshots require at least one disk to be " - "selected for snapshot")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("disk snapshots require at least one disk to be " + "selected for snapshot")); goto cleanup; } if (active) { @@ -9987,9 +9987,9 @@ qemuDomainSnapshotDiskPrepare(virDomainObjPtr vm, virDomainSnapshotDefPtr def, qemuCapsGet(priv->qemuCaps, QEMU_CAPS_TRANSACTION)) { *flags |= VIR_DOMAIN_SNAPSHOT_CREATE_ATOMIC; } else if (atomic && external > 1) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("atomic live snapshot of multiple disks " - "is unsupported")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("atomic live snapshot of multiple disks " + "is unsupported")); goto cleanup; } } @@ -10024,8 +10024,8 @@ qemuDomainSnapshotCreateSingleDiskActive(struct qemud_driver *driver, bool need_unlink = false; if (snap->snapshot != VIR_DOMAIN_DISK_SNAPSHOT_EXTERNAL) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("unexpected code path")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("unexpected code path")); return -1; } @@ -10210,16 +10210,16 @@ qemuDomainSnapshotCreateDiskActive(virConnectPtr conn, return -1; if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); goto endjob; } if (qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_DEVICES) && virCgroupForDomain(driver->cgroup, vm->def->name, &cgroup, 0)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to find cgroup for %s"), - vm->def->name); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Unable to find cgroup for %s"), + vm->def->name); goto endjob; } /* 'cgroup' is still NULL if cgroups are disabled. */ @@ -10252,8 +10252,8 @@ qemuDomainSnapshotCreateDiskActive(virConnectPtr conn, resume = true; if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("guest unexpectedly quit")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("guest unexpectedly quit")); goto cleanup; } } @@ -10349,8 +10349,8 @@ cleanup: VIR_DOMAIN_RUNNING_UNPAUSED, QEMU_ASYNC_JOB_NONE) < 0 && virGetLastError() == NULL) { - qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", - _("resuming after snapshot failed")); + virReportError(VIR_ERR_OPERATION_FAILED, "%s", + _("resuming after snapshot failed")); goto endjob; } } @@ -10409,8 +10409,8 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain, if ((flags & VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE) && !(flags & VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("quiesce requires disk-only")); + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("quiesce requires disk-only")); return NULL; } @@ -10427,19 +10427,19 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain, virUUIDFormat(domain->uuid, uuidstr); vm = virDomainFindByUUID(&driver->domains, domain->uuid); if (!vm) { - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } if (qemuProcessAutoDestroyActive(driver, vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is marked for auto destroy")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is marked for auto destroy")); goto cleanup; } if (!vm->persistent && (flags & VIR_DOMAIN_SNAPSHOT_CREATE_HALT)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("cannot halt after transient domain snapshot")); + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("cannot halt after transient domain snapshot")); goto cleanup; } @@ -10452,23 +10452,23 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain, /* Prevent circular chains */ if (def->parent) { if (STREQ(def->name, def->parent)) { - qemuReportError(VIR_ERR_INVALID_ARG, - _("cannot set snapshot %s as its own parent"), - def->name); + virReportError(VIR_ERR_INVALID_ARG, + _("cannot set snapshot %s as its own parent"), + def->name); goto cleanup; } other = virDomainSnapshotFindByName(&vm->snapshots, def->parent); if (!other) { - qemuReportError(VIR_ERR_INVALID_ARG, - _("parent %s for snapshot %s not found"), - def->parent, def->name); + virReportError(VIR_ERR_INVALID_ARG, + _("parent %s for snapshot %s not found"), + def->parent, def->name); goto cleanup; } while (other->def->parent) { if (STREQ(other->def->parent, def->name)) { - qemuReportError(VIR_ERR_INVALID_ARG, - _("parent %s would create cycle to %s"), - other->def->name, def->name); + virReportError(VIR_ERR_INVALID_ARG, + _("parent %s would create cycle to %s"), + other->def->name, def->name); goto cleanup; } other = virDomainSnapshotFindByName(&vm->snapshots, @@ -10484,9 +10484,9 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain, /* Check that any replacement is compatible */ if (def->dom && memcmp(def->dom->uuid, domain->uuid, VIR_UUID_BUFLEN)) { - qemuReportError(VIR_ERR_INVALID_ARG, - _("definition for snapshot %s must use uuid %s"), - def->name, uuidstr); + virReportError(VIR_ERR_INVALID_ARG, + _("definition for snapshot %s must use uuid %s"), + def->name, uuidstr); goto cleanup; } other = virDomainSnapshotFindByName(&vm->snapshots, def->name); @@ -10495,18 +10495,18 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain, other->def->state == VIR_DOMAIN_PAUSED) != (def->state == VIR_DOMAIN_RUNNING || def->state == VIR_DOMAIN_PAUSED)) { - qemuReportError(VIR_ERR_INVALID_ARG, - _("cannot change between online and offline " - "snapshot state in snapshot %s"), - def->name); + virReportError(VIR_ERR_INVALID_ARG, + _("cannot change between online and offline " + "snapshot state in snapshot %s"), + def->name); goto cleanup; } if ((other->def->state == VIR_DOMAIN_DISK_SNAPSHOT) != (def->state == VIR_DOMAIN_DISK_SNAPSHOT)) { - qemuReportError(VIR_ERR_INVALID_ARG, - _("cannot change between disk snapshot and " - "system checkpoint in snapshot %s"), - def->name); + virReportError(VIR_ERR_INVALID_ARG, + _("cannot change between disk snapshot and " + "system checkpoint in snapshot %s"), + def->name); goto cleanup; } if (other->def->dom) { @@ -10548,9 +10548,9 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain, if (flags & VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY) { if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("disk snapshots of inactive domains not " - "implemented yet")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("disk snapshots of inactive domains not " + "implemented yet")); goto cleanup; } if (virDomainSnapshotAlignDisks(def, @@ -10669,8 +10669,8 @@ static int qemuDomainSnapshotListNames(virDomainPtr domain, char **names, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(domain->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -10699,8 +10699,8 @@ static int qemuDomainSnapshotNum(virDomainPtr domain, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(domain->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -10729,8 +10729,8 @@ qemuDomainListAllSnapshots(virDomainPtr domain, virDomainSnapshotPtr **snaps, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(domain->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -10762,16 +10762,16 @@ qemuDomainSnapshotListChildrenNames(virDomainSnapshotPtr snapshot, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(snapshot->domain->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } snap = virDomainSnapshotFindByName(&vm->snapshots, snapshot->name); if (!snap) { - qemuReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT, - _("no domain snapshot with matching name '%s'"), - snapshot->name); + virReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT, + _("no domain snapshot with matching name '%s'"), + snapshot->name); goto cleanup; } @@ -10802,16 +10802,16 @@ qemuDomainSnapshotNumChildren(virDomainSnapshotPtr snapshot, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(snapshot->domain->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } snap = virDomainSnapshotFindByName(&vm->snapshots, snapshot->name); if (!snap) { - qemuReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT, - _("no domain snapshot with matching name '%s'"), - snapshot->name); + virReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT, + _("no domain snapshot with matching name '%s'"), + snapshot->name); goto cleanup; } @@ -10842,16 +10842,16 @@ qemuDomainSnapshotListAllChildren(virDomainSnapshotPtr snapshot, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(snapshot->domain->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } snap = virDomainSnapshotFindByName(&vm->snapshots, snapshot->name); if (!snap) { - qemuReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT, - _("no domain snapshot with matching name '%s'"), - snapshot->name); + virReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT, + _("no domain snapshot with matching name '%s'"), + snapshot->name); goto cleanup; } @@ -10881,15 +10881,15 @@ static virDomainSnapshotPtr qemuDomainSnapshotLookupByName(virDomainPtr domain, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(domain->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } snap = virDomainSnapshotFindByName(&vm->snapshots, name); if (!snap) { - qemuReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT, - _("no snapshot with matching name '%s'"), name); + virReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT, + _("no snapshot with matching name '%s'"), name); goto cleanup; } @@ -10916,8 +10916,8 @@ static int qemuDomainHasCurrentSnapshot(virDomainPtr domain, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(domain->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -10946,23 +10946,23 @@ qemuDomainSnapshotGetParent(virDomainSnapshotPtr snapshot, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(snapshot->domain->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } snap = virDomainSnapshotFindByName(&vm->snapshots, snapshot->name); if (!snap) { - qemuReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT, - _("no domain snapshot with matching name '%s'"), - snapshot->name); + virReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT, + _("no domain snapshot with matching name '%s'"), + snapshot->name); goto cleanup; } if (!snap->def->parent) { - qemuReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT, - _("snapshot '%s' does not have a parent"), - snap->def->name); + virReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT, + _("snapshot '%s' does not have a parent"), + snap->def->name); goto cleanup; } @@ -10989,14 +10989,14 @@ static virDomainSnapshotPtr qemuDomainSnapshotCurrent(virDomainPtr domain, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(domain->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } if (!vm->current_snapshot) { - qemuReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT, "%s", - _("the domain does not have a current snapshot")); + virReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT, "%s", + _("the domain does not have a current snapshot")); goto cleanup; } @@ -11024,16 +11024,16 @@ static char *qemuDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot, virUUIDFormat(snapshot->domain->uuid, uuidstr); vm = virDomainFindByUUID(&driver->domains, snapshot->domain->uuid); if (!vm) { - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } snap = virDomainSnapshotFindByName(&vm->snapshots, snapshot->name); if (!snap) { - qemuReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT, - _("no domain snapshot with matching name '%s'"), - snapshot->name); + virReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT, + _("no domain snapshot with matching name '%s'"), + snapshot->name); goto cleanup; } @@ -11062,15 +11062,15 @@ qemuDomainSnapshotIsCurrent(virDomainSnapshotPtr snapshot, virUUIDFormat(snapshot->domain->uuid, uuidstr); vm = virDomainFindByUUID(&driver->domains, snapshot->domain->uuid); if (!vm) { - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } snap = virDomainSnapshotFindByName(&vm->snapshots, snapshot->name); if (!snap) { - qemuReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT, - _("no domain snapshot with matching name '%s'"), + virReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT, + _("no domain snapshot with matching name '%s'"), snapshot->name); goto cleanup; } @@ -11102,16 +11102,16 @@ qemuDomainSnapshotHasMetadata(virDomainSnapshotPtr snapshot, virUUIDFormat(snapshot->domain->uuid, uuidstr); vm = virDomainFindByUUID(&driver->domains, snapshot->domain->uuid); if (!vm) { - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } snap = virDomainSnapshotFindByName(&vm->snapshots, snapshot->name); if (!snap) { - qemuReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT, - _("no domain snapshot with matching name '%s'"), - snapshot->name); + virReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT, + _("no domain snapshot with matching name '%s'"), + snapshot->name); goto cleanup; } @@ -11175,16 +11175,16 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, virUUIDFormat(snapshot->domain->uuid, uuidstr); vm = virDomainFindByUUID(&driver->domains, snapshot->domain->uuid); if (!vm) { - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } snap = virDomainSnapshotFindByName(&vm->snapshots, snapshot->name); if (!snap) { - qemuReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT, - _("no domain snapshot with matching name '%s'"), - snapshot->name); + virReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT, + _("no domain snapshot with matching name '%s'"), + snapshot->name); goto cleanup; } @@ -11193,22 +11193,22 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, snap->def->state != VIR_DOMAIN_PAUSED && (flags & (VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING | VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED)) == 0) { - qemuReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("transient domain needs to request run or pause " - "to revert to inactive snapshot")); + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("transient domain needs to request run or pause " + "to revert to inactive snapshot")); goto cleanup; } if (snap->def->state == VIR_DOMAIN_DISK_SNAPSHOT) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("revert to external disk snapshot not supported " - "yet")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("revert to external disk snapshot not supported " + "yet")); goto cleanup; } if (!(flags & VIR_DOMAIN_SNAPSHOT_REVERT_FORCE)) { if (!snap->def->dom) { - qemuReportError(VIR_ERR_SNAPSHOT_REVERT_RISKY, - _("snapshot '%s' lacks domain '%s' rollback info"), - snap->def->name, vm->def->name); + virReportError(VIR_ERR_SNAPSHOT_REVERT_RISKY, + _("snapshot '%s' lacks domain '%s' rollback info"), + snap->def->name, vm->def->name); goto cleanup; } if (virDomainObjIsActive(vm) && @@ -11216,8 +11216,8 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, || snap->def->state == VIR_DOMAIN_PAUSED) && (flags & (VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING | VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED))) { - qemuReportError(VIR_ERR_SNAPSHOT_REVERT_RISKY, - _("must respawn qemu to start inactive snapshot")); + virReportError(VIR_ERR_SNAPSHOT_REVERT_RISKY, + _("must respawn qemu to start inactive snapshot")); goto cleanup; } } @@ -11278,8 +11278,8 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, if (!(flags & VIR_DOMAIN_SNAPSHOT_REVERT_FORCE)) { /* Re-spawn error using correct category. */ if (err->code == VIR_ERR_CONFIG_UNSUPPORTED) - qemuReportError(VIR_ERR_SNAPSHOT_REVERT_RISKY, "%s", - err->str2); + virReportError(VIR_ERR_SNAPSHOT_REVERT_RISKY, "%s", + err->str2); goto endjob; } virResetError(err); @@ -11311,8 +11311,8 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, VIR_DOMAIN_EVENT_SUSPENDED, detail); if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("guest unexpectedly quit")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("guest unexpectedly quit")); goto endjob; } } @@ -11363,8 +11363,8 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, } else { /* Transitions 2, 5, 8 */ if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("guest unexpectedly quit")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("guest unexpectedly quit")); goto endjob; } rc = qemuProcessStartCPUs(driver, vm, snapshot->domain->conn, @@ -11543,16 +11543,16 @@ static int qemuDomainSnapshotDelete(virDomainSnapshotPtr snapshot, virUUIDFormat(snapshot->domain->uuid, uuidstr); vm = virDomainFindByUUID(&driver->domains, snapshot->domain->uuid); if (!vm) { - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } snap = virDomainSnapshotFindByName(&vm->snapshots, snapshot->name); if (!snap) { - qemuReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT, - _("no domain snapshot with matching name '%s'"), - snapshot->name); + virReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT, + _("no domain snapshot with matching name '%s'"), + snapshot->name); goto cleanup; } @@ -11565,9 +11565,9 @@ static int qemuDomainSnapshotDelete(virDomainSnapshotPtr snapshot, qemuDomainSnapshotCountExternal, &external); if (external) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("deletion of %d external disk snapshots not " - "supported yet"), external); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("deletion of %d external disk snapshots not " + "supported yet"), external); goto cleanup; } } @@ -11592,9 +11592,9 @@ static int qemuDomainSnapshotDelete(virDomainSnapshotPtr snapshot, snap->def->current = true; if (qemuDomainSnapshotWriteMetadata(vm, snap, driver->snapshotDir) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("failed to set snapshot '%s' as current"), - snap->def->name); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("failed to set snapshot '%s' as current"), + snap->def->name); snap->def->current = false; goto endjob; } @@ -11654,14 +11654,14 @@ static int qemuDomainMonitorCommand(virDomainPtr domain, const char *cmd, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(domain->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); goto cleanup; } @@ -11669,8 +11669,8 @@ static int qemuDomainMonitorCommand(virDomainPtr domain, const char *cmd, goto cleanup; if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("domain is not running")); goto endjob; } @@ -11719,16 +11719,16 @@ static virDomainPtr qemuDomainAttach(virConnectPtr conn, goto cleanup; if (!monConfig) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("No monitor connection for pid %u"), pid_value); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("No monitor connection for pid %u"), pid_value); goto cleanup; } if (monConfig->type != VIR_DOMAIN_CHR_TYPE_UNIX) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Cannot connect to monitor connection of type '%s' " - "for pid %u"), - virDomainChrTypeToString(monConfig->type), - pid_value); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Cannot connect to monitor connection of type '%s' " + "for pid %u"), + virDomainChrTypeToString(monConfig->type), + pid_value); goto cleanup; } @@ -11807,14 +11807,14 @@ qemuDomainOpenConsole(virDomainPtr dom, vm = virDomainFindByUUID(&driver->domains, dom->uuid); qemuDriverUnlock(driver); if (!vm) { - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); goto cleanup; } @@ -11842,16 +11842,16 @@ qemuDomainOpenConsole(virDomainPtr dom, } if (!chr) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot find character device %s"), - NULLSTR(dev_name)); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot find character device %s"), + NULLSTR(dev_name)); goto cleanup; } if (chr->source.type != VIR_DOMAIN_CHR_TYPE_PTY) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("character device %s is not using a PTY"), - NULLSTR(dev_name)); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("character device %s is not using a PTY"), + NULLSTR(dev_name)); goto cleanup; } @@ -11862,8 +11862,8 @@ qemuDomainOpenConsole(virDomainPtr dom, (flags & VIR_DOMAIN_CONSOLE_FORCE) != 0); if (ret == 1) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("Active console session exists for this domain")); + virReportError(VIR_ERR_OPERATION_FAILED, + _("Active console session exists for this domain")); ret = -1; } @@ -11901,8 +11901,8 @@ qemuDiskPathToAlias(virDomainObjPtr vm, const char *path, int *idx) cleanup: if (!ret) { - qemuReportError(VIR_ERR_INVALID_ARG, - "%s", _("No device found for specified path")); + virReportError(VIR_ERR_INVALID_ARG, + "%s", _("No device found for specified path")); } return ret; } @@ -11927,13 +11927,13 @@ qemuDomainBlockJobImpl(virDomainPtr dom, const char *path, const char *base, virUUIDFormat(dom->uuid, uuidstr); vm = virDomainFindByUUID(&driver->domains, dom->uuid); if (!vm) { - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("domain is not running")); goto cleanup; } @@ -11941,18 +11941,18 @@ qemuDomainBlockJobImpl(virDomainPtr dom, const char *path, const char *base, if (qemuCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKJOB_ASYNC)) { async = true; } else if (!qemuCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKJOB_SYNC)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("block jobs not supported with this QEMU binary")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("block jobs not supported with this QEMU binary")); goto cleanup; } else if (base) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("partial block pull not supported with this " - "QEMU binary")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("partial block pull not supported with this " + "QEMU binary")); goto cleanup; } else if (mode == BLOCK_JOB_PULL && bandwidth) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("setting bandwidth at start of block pull not " - "supported with this QEMU binary")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("setting bandwidth at start of block pull not " + "supported with this QEMU binary")); goto cleanup; } @@ -11965,8 +11965,8 @@ qemuDomainBlockJobImpl(virDomainPtr dom, const char *path, const char *base, goto cleanup; if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("domain is not running")); goto endjob; } @@ -12016,8 +12016,8 @@ qemuDomainBlockJobImpl(virDomainPtr dom, const char *path, const char *base, virDomainObjLock(vm); if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("domain is not running")); ret = -1; break; } @@ -12102,22 +12102,22 @@ qemuDomainOpenGraphics(virDomainPtr dom, virUUIDFormat(dom->uuid, uuidstr); vm = virDomainFindByUUID(&driver->domains, dom->uuid); if (!vm) { - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); goto cleanup; } priv = vm->privateData; if (idx >= vm->def->ngraphics) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("No graphics backend with index %d"), idx); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("No graphics backend with index %d"), idx); goto cleanup; } switch (vm->def->graphics[idx]->type) { @@ -12128,9 +12128,9 @@ qemuDomainOpenGraphics(virDomainPtr dom, protocol = "spice"; break; default: - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Can only open VNC or SPICE graphics backends, not %s"), - virDomainGraphicsTypeToString(vm->def->graphics[idx]->type)); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Can only open VNC or SPICE graphics backends, not %s"), + virDomainGraphicsTypeToString(vm->def->graphics[idx]->type)); goto cleanup; } @@ -12197,15 +12197,15 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, virUUIDFormat(dom->uuid, uuidstr); vm = virDomainFindByUUID(&driver->domains, dom->uuid); if (!vm) { - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } priv = vm->privateData; if (!qemuCapsGet(priv->qemuCaps, QEMU_CAPS_DRIVE_IOTUNE)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("block I/O throttling not supported with this " - "QEMU binary")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("block I/O throttling not supported with this " + "QEMU binary")); goto cleanup; } @@ -12252,15 +12252,15 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, if ((info.total_bytes_sec && info.read_bytes_sec) || (info.total_bytes_sec && info.write_bytes_sec)) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("total and read/write of bytes_sec cannot be set at the same time")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("total and read/write of bytes_sec cannot be set at the same time")); goto endjob; } if ((info.total_iops_sec && info.read_iops_sec) || (info.total_iops_sec && info.write_iops_sec)) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("total and read/write of iops_sec cannot be set at the same time")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("total and read/write of iops_sec cannot be set at the same time")); goto endjob; } @@ -12306,7 +12306,7 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, persistentDef->disks[idx]->blkdeviotune = info; ret = virDomainSaveConfig(driver->configDir, persistentDef); if (ret < 0) { - qemuReportError(VIR_ERR_OPERATION_INVALID, "%s", + virReportError(VIR_ERR_OPERATION_INVALID, "%s", _("Write to config file failed")); goto endjob; } @@ -12352,8 +12352,8 @@ qemuDomainGetBlockIoTune(virDomainPtr dom, virUUIDFormat(dom->uuid, uuidstr); vm = virDomainFindByUUID(&driver->domains, dom->uuid); if (!vm) { - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -12483,8 +12483,8 @@ qemuDomainGetDiskErrors(virDomainPtr dom, qemuDriverUnlock(driver); if (!vm) { - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -12494,8 +12494,8 @@ qemuDomainGetDiskErrors(virDomainPtr dom, goto cleanup; if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); goto endjob; } @@ -12568,8 +12568,8 @@ qemuDomainSetMetadata(virDomainPtr dom, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -12592,14 +12592,14 @@ qemuDomainSetMetadata(virDomainPtr dom, goto no_memory; break; case VIR_DOMAIN_METADATA_ELEMENT: - qemuReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", - _("QEmu driver does not support modifying" - "<metadata> element")); + virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", + _("QEmu driver does not support modifying" + "<metadata> element")); goto cleanup; break; default: - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("unknown metadata type")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("unknown metadata type")); goto cleanup; break; } @@ -12620,13 +12620,13 @@ qemuDomainSetMetadata(virDomainPtr dom, goto no_memory; break; case VIR_DOMAIN_METADATA_ELEMENT: - qemuReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", - _("QEMU driver does not support" - "<metadata> element")); + virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", + _("QEMU driver does not support" + "<metadata> element")); goto cleanup; default: - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("unknown metadata type")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("unknown metadata type")); goto cleanup; break; } @@ -12668,8 +12668,8 @@ qemuDomainGetMetadata(virDomainPtr dom, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -12688,21 +12688,21 @@ qemuDomainGetMetadata(virDomainPtr dom, field = def->title; break; case VIR_DOMAIN_METADATA_ELEMENT: - qemuReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", - _("QEMU driver does not support" - "<metadata> element")); + virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", + _("QEMU driver does not support" + "<metadata> element")); goto cleanup; break; default: - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("unknown metadata type")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("unknown metadata type")); goto cleanup; break; } if (!field) { - qemuReportError(VIR_ERR_NO_DOMAIN_METADATA, "%s", - _("Requested metadata element is not present")); + virReportError(VIR_ERR_NO_DOMAIN_METADATA, "%s", + _("Requested metadata element is not present")); goto cleanup; } @@ -12797,8 +12797,8 @@ getSumVcpuPercpuStats(virCgroupPtr group, int j; if (virCgroupForVcpu(group, i, &group_vcpu, 0) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("error accessing cgroup cpuacct for vcpu")); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("error accessing cgroup cpuacct for vcpu")); goto cleanup; } @@ -12808,8 +12808,8 @@ getSumVcpuPercpuStats(virCgroupPtr group, pos = buf; for (j = 0; j < num; j++) { if (virStrToLong_ull(pos, &pos, 10, &tmp) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cpuacct parse error")); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cpuacct parse error")); goto cleanup; } sum_cpu_time[j] += tmp; @@ -12864,9 +12864,9 @@ qemuDomainGetPercpuStats(virDomainPtr domain, } if (start_cpu > max_id) { - qemuReportError(VIR_ERR_INVALID_ARG, - _("start_cpu %d larger than maximum of %d"), - start_cpu, max_id); + virReportError(VIR_ERR_INVALID_ARG, + _("start_cpu %d larger than maximum of %d"), + start_cpu, max_id); goto cleanup; } @@ -12886,8 +12886,8 @@ qemuDomainGetPercpuStats(virDomainPtr domain, if (!map[i]) { cpu_time = 0; } else if (virStrToLong_ull(pos, &pos, 10, &cpu_time) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cpuacct parse error")); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cpuacct parse error")); goto cleanup; } else { n++; @@ -12916,8 +12916,8 @@ qemuDomainGetPercpuStats(virDomainPtr domain, /* Check that the mapping of online cpus didn't change mid-parse. */ map2 = nodeGetCPUmap(domain->conn, &max_id, "present"); if (!map2 || memcmp(map, map2, VIR_DOMAIN_CPUMASK_LEN) != 0) { - qemuReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("the set of online cpus changed while reading")); + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("the set of online cpus changed while reading")); goto cleanup; } @@ -12967,27 +12967,27 @@ qemuDomainGetCPUStats(virDomainPtr domain, vm = virDomainFindByUUID(&driver->domains, domain->uuid); if (vm == NULL) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("No such domain %s"), domain->uuid); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("No such domain %s"), domain->uuid); goto cleanup; } isActive = virDomainObjIsActive(vm); if (!isActive) { - qemuReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("domain is not running")); goto cleanup; } if (!qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_CPUACCT)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("cgroup CPUACCT controller is not mounted")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("cgroup CPUACCT controller is not mounted")); goto cleanup; } if (virCgroupForDomain(driver->cgroup, vm->def->name, &group, 0) != 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot find cgroup for domain %s"), vm->def->name); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot find cgroup for domain %s"), vm->def->name); goto cleanup; } @@ -13018,17 +13018,17 @@ qemuDomainPMSuspendForDuration(virDomainPtr dom, virCheckFlags(0, -1); if (duration) { - qemuReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", - _("Duration not supported. Use 0 for now")); + virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", + _("Duration not supported. Use 0 for now")); return -1; } if (!(target == VIR_NODE_SUSPEND_TARGET_MEM || target == VIR_NODE_SUSPEND_TARGET_DISK || target == VIR_NODE_SUSPEND_TARGET_HYBRID)) { - qemuReportError(VIR_ERR_INVALID_ARG, - _("Unknown suspend target: %u"), - target); + virReportError(VIR_ERR_INVALID_ARG, + _("Unknown suspend target: %u"), + target); return -1; } @@ -13039,37 +13039,37 @@ qemuDomainPMSuspendForDuration(virDomainPtr dom, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } priv = vm->privateData; if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); goto cleanup; } if (!qemuCapsGet(priv->qemuCaps, QEMU_CAPS_WAKEUP) && (target == VIR_NODE_SUSPEND_TARGET_MEM || target == VIR_NODE_SUSPEND_TARGET_HYBRID)) { - qemuReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", - _("Unable to suspend domain due to " - "missing system_wakeup monitor command")); + virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", + _("Unable to suspend domain due to " + "missing system_wakeup monitor command")); goto cleanup; } if (priv->agentError) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("QEMU guest agent is not available due to an error")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("QEMU guest agent is not available due to an error")); goto cleanup; } if (!priv->agent) { - qemuReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", - _("QEMU guest agent is not configured")); + virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", + _("QEMU guest agent is not configured")); goto cleanup; } @@ -13077,8 +13077,8 @@ qemuDomainPMSuspendForDuration(virDomainPtr dom, goto cleanup; if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); goto endjob; } @@ -13114,8 +13114,8 @@ qemuDomainPMWakeup(virDomainPtr dom, if (!vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(dom->uuid, uuidstr); - qemuReportError(VIR_ERR_NO_DOMAIN, - _("no domain with matching uuid '%s'"), uuidstr); + virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s'"), uuidstr); goto cleanup; } @@ -13123,17 +13123,17 @@ qemuDomainPMWakeup(virDomainPtr dom, goto cleanup; if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); goto endjob; } priv = vm->privateData; if (!qemuCapsGet(priv->qemuCaps, QEMU_CAPS_WAKEUP)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("Unable to wake up domain due to " - "missing system_wakeup monitor command")); + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("Unable to wake up domain due to " + "missing system_wakeup monitor command")); goto endjob; } diff --git a/src/qemu/qemu_hostdev.c b/src/qemu/qemu_hostdev.c index 434aa02..fb07c3c 100644 --- a/src/qemu/qemu_hostdev.c +++ b/src/qemu/qemu_hostdev.c @@ -31,6 +31,8 @@ #include "hostusb.h" #include "virnetdev.h" +#define VIR_FROM_THIS VIR_FROM_QEMU + static pciDeviceList * qemuGetPciHostDeviceList(virDomainHostdevDefPtr *hostdevs, int nhostdevs) { @@ -271,10 +273,11 @@ qemuDomainHostdevNetConfigVirtPortProfile(const char *linkdev, int vf, case VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH: case VIR_NETDEV_VPORT_PROFILE_8021QBG: case VIR_NETDEV_VPORT_PROFILE_LAST: - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("virtualport type %s is " - "currently not supported on interfaces of type " - "hostdev"), - virNetDevVPortTypeToString(virtPort->virtPortType)); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("virtualport type %s is " + "currently not supported on interfaces of type " + "hostdev"), + virNetDevVPortTypeToString(virtPort->virtPortType)); break; case VIR_NETDEV_VPORT_PROFILE_8021QBH: @@ -307,9 +310,9 @@ qemuDomainHostdevNetConfigReplace(virDomainHostdevDefPtr hostdev, isvf = qemuDomainHostdevIsVirtualFunction(hostdev); if (isvf <= 0) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Interface type hostdev is currently supported on" - " SR-IOV Virtual Functions only")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Interface type hostdev is currently supported on" + " SR-IOV Virtual Functions only")); return ret; } @@ -345,9 +348,9 @@ qemuDomainHostdevNetConfigRestore(virDomainHostdevDefPtr hostdev, isvf = qemuDomainHostdevIsVirtualFunction(hostdev); if (isvf <= 0) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Interface type hostdev is currently supported on" - " SR-IOV Virtual Functions only")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Interface type hostdev is currently supported on" + " SR-IOV Virtual Functions only")); return ret; } @@ -399,9 +402,9 @@ int qemuPrepareHostdevPCIDevices(struct qemud_driver *driver, pciDevice *other; if (!pciDeviceIsAssignable(dev, !driver->relaxedACS)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - _("PCI device %s is not assignable"), - pciDeviceGetName(dev)); + virReportError(VIR_ERR_OPERATION_INVALID, + _("PCI device %s is not assignable"), + pciDeviceGetName(dev)); goto cleanup; } /* The device is in use by other active domain if @@ -411,13 +414,13 @@ int qemuPrepareHostdevPCIDevices(struct qemud_driver *driver, const char *other_name = pciDeviceGetUsedBy(other); if (other_name) - qemuReportError(VIR_ERR_OPERATION_INVALID, - _("PCI device %s is in use by domain %s"), - pciDeviceGetName(dev), other_name); + virReportError(VIR_ERR_OPERATION_INVALID, + _("PCI device %s is in use by domain %s"), + pciDeviceGetName(dev), other_name); else - qemuReportError(VIR_ERR_OPERATION_INVALID, - _("PCI device %s is already in use"), - pciDeviceGetName(dev)); + virReportError(VIR_ERR_OPERATION_INVALID, + _("PCI device %s is already in use"), + pciDeviceGetName(dev)); goto cleanup; } } @@ -579,13 +582,13 @@ qemuPrepareHostdevUSBDevices(struct qemud_driver *driver, const char *other_name = usbDeviceGetUsedBy(tmp); if (other_name) - qemuReportError(VIR_ERR_OPERATION_INVALID, - _("USB device %s is in use by domain %s"), - usbDeviceGetName(tmp), other_name); + virReportError(VIR_ERR_OPERATION_INVALID, + _("USB device %s is in use by domain %s"), + usbDeviceGetName(tmp), other_name); else - qemuReportError(VIR_ERR_OPERATION_INVALID, - _("USB device %s is already in use"), - usbDeviceGetName(tmp)); + virReportError(VIR_ERR_OPERATION_INVALID, + _("USB device %s is already in use"), + usbDeviceGetName(tmp)); goto error; } @@ -653,9 +656,9 @@ qemuPrepareHostUSBDevices(struct qemud_driver *driver, goto cleanup; if (usbDeviceListCount(devs) > 1) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("multiple USB devices for %x:%x, " - "use <address> to specify one"), vendor, product); + virReportError(VIR_ERR_OPERATION_FAILED, + _("multiple USB devices for %x:%x, " + "use <address> to specify one"), vendor, product); usbDeviceListFree(devs); goto cleanup; } diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 09c8c97..20aefce 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -66,23 +66,23 @@ int qemuDomainChangeEjectableMedia(struct qemud_driver *driver, } if (!origdisk) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("No device with bus '%s' and target '%s'"), - virDomainDiskBusTypeToString(disk->bus), - disk->dst); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("No device with bus '%s' and target '%s'"), + virDomainDiskBusTypeToString(disk->bus), + disk->dst); return -1; } if (!origdisk->info.alias) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("missing disk device alias name for %s"), origdisk->dst); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("missing disk device alias name for %s"), origdisk->dst); return -1; } if (origdisk->device != VIR_DOMAIN_DISK_DEVICE_FLOPPY && origdisk->device != VIR_DOMAIN_DISK_DEVICE_CDROM) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Removable media not supported for %s device"), + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Removable media not supported for %s device"), virDomainDiskDeviceTypeToString(disk->device)); return -1; } @@ -210,8 +210,8 @@ int qemuDomainAttachPciDiskDevice(virConnectPtr conn, for (i = 0 ; i < vm->def->ndisks ; i++) { if (STREQ(vm->def->disks[i]->dst, disk->dst)) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("target %s already exists"), disk->dst); + virReportError(VIR_ERR_OPERATION_FAILED, + _("target %s already exists"), disk->dst); return -1; } } @@ -318,9 +318,9 @@ int qemuDomainAttachPciControllerDevice(struct qemud_driver *driver, for (i = 0 ; i < vm->def->ncontrollers ; i++) { if ((vm->def->controllers[i]->type == controller->type) && (vm->def->controllers[i]->idx == controller->idx)) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("target %s:%d already exists"), - type, controller->idx); + virReportError(VIR_ERR_OPERATION_FAILED, + _("target %s:%d already exists"), + type, controller->idx); return -1; } } @@ -335,8 +335,8 @@ int qemuDomainAttachPciControllerDevice(struct qemud_driver *driver, if (controller->type == VIR_DOMAIN_CONTROLLER_TYPE_USB && controller->model == -1 && !qemuCapsGet(priv->qemuCaps, QEMU_CAPS_PIIX3_USB_UHCI)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("USB controller hotplug unsupported in this QEMU binary")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("USB controller hotplug unsupported in this QEMU binary")); goto cleanup; } @@ -415,8 +415,8 @@ qemuDomainFindOrCreateSCSIDiskController(struct qemud_driver *driver, } if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("guest unexpectedly quit")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("guest unexpectedly quit")); /* cont doesn't need freeing here, since the reference * now held in def->controllers */ return NULL; @@ -440,8 +440,8 @@ int qemuDomainAttachSCSIDisk(virConnectPtr conn, for (i = 0 ; i < vm->def->ndisks ; i++) { if (STREQ(vm->def->disks[i]->dst, disk->dst)) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("target %s already exists"), disk->dst); + virReportError(VIR_ERR_OPERATION_FAILED, + _("target %s already exists"), disk->dst); return -1; } } @@ -458,9 +458,9 @@ int qemuDomainAttachSCSIDisk(virConnectPtr conn, /* We should have an address already, so make sure */ if (disk->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected disk address type %s"), - virDomainDeviceAddressTypeToString(disk->info.type)); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unexpected disk address type %s"), + virDomainDeviceAddressTypeToString(disk->info.type)); goto error; } @@ -486,8 +486,8 @@ int qemuDomainAttachSCSIDisk(virConnectPtr conn, sa_assert (cont); if (cont->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("SCSI controller %d was missing its PCI address"), cont->idx); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("SCSI controller %d was missing its PCI address"), cont->idx); goto error; } @@ -563,8 +563,8 @@ int qemuDomainAttachUsbMassstorageDevice(virConnectPtr conn, for (i = 0 ; i < vm->def->ndisks ; i++) { if (STREQ(vm->def->disks[i]->dst, disk->dst)) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("target %s already exists"), disk->dst); + virReportError(VIR_ERR_OPERATION_FAILED, + _("target %s already exists"), disk->dst); return -1; } } @@ -581,8 +581,8 @@ int qemuDomainAttachUsbMassstorageDevice(virConnectPtr conn, /* XXX not correct once we allow attaching a USB CDROM */ if (!disk->src) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("disk source path is missing")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("disk source path is missing")); goto error; } @@ -692,8 +692,8 @@ int qemuDomainAttachNetDevice(virConnectPtr conn, } if (!qemuCapsGet(priv->qemuCaps, QEMU_CAPS_HOST_NET_ADD)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("installed qemu version does not support host_net_add")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("installed qemu version does not support host_net_add")); goto cleanup; } @@ -734,8 +734,8 @@ int qemuDomainAttachNetDevice(virConnectPtr conn, vlan = qemuDomainNetVLAN(net); if (vlan < 0) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("Unable to attach network devices without vlan")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Unable to attach network devices without vlan")); goto cleanup; } } @@ -784,8 +784,8 @@ int qemuDomainAttachNetDevice(virConnectPtr conn, VIR_FORCE_CLOSE(vhostfd); if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("guest unexpectedly quit")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("guest unexpectedly quit")); goto cleanup; } @@ -820,8 +820,8 @@ int qemuDomainAttachNetDevice(virConnectPtr conn, /* set link state */ if (net->linkstate == VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOWN) { if (!net->info.alias) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("device alias not found: cannot set link state to down")); + virReportError(VIR_ERR_OPERATION_FAILED, + _("device alias not found: cannot set link state to down")); } else { qemuDomainObjEnterMonitorWithDriver(driver, vm); @@ -832,8 +832,8 @@ int qemuDomainAttachNetDevice(virConnectPtr conn, goto try_remove; } } else { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("setting of link state not supported: Link is up")); + virReportError(VIR_ERR_OPERATION_FAILED, + _("setting of link state not supported: Link is up")); } qemuDomainObjExitMonitorWithDriver(driver, vm); @@ -953,8 +953,8 @@ int qemuDomainAttachHostPciDevice(struct qemud_driver *driver, } if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("guest unexpectedly quit during hotplug")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("guest unexpectedly quit during hotplug")); goto error; } @@ -1077,9 +1077,9 @@ int qemuDomainAttachHostUsbDevice(struct qemud_driver *driver, qemuCgroupData data; if (virCgroupForDomain(driver->cgroup, vm->def->name, &cgroup, 0) !=0 ) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to find cgroup for %s"), - vm->def->name); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Unable to find cgroup for %s"), + vm->def->name); goto error; } @@ -1124,9 +1124,9 @@ int qemuDomainAttachHostDevice(struct qemud_driver *driver, usbDevice *usb = NULL; if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("hostdev mode '%s' not supported"), - virDomainHostdevModeTypeToString(hostdev->mode)); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("hostdev mode '%s' not supported"), + virDomainHostdevModeTypeToString(hostdev->mode)); return -1; } @@ -1148,9 +1148,9 @@ int qemuDomainAttachHostDevice(struct qemud_driver *driver, goto cleanup; if (usbDeviceListCount(devs) > 1) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("multiple USB devices for %x:%x, " - "use <address> to specify one"), vendor, product); + virReportError(VIR_ERR_OPERATION_FAILED, + _("multiple USB devices for %x:%x, " + "use <address> to specify one"), vendor, product); usbDeviceListFree(devs); goto cleanup; } @@ -1199,9 +1199,9 @@ int qemuDomainAttachHostDevice(struct qemud_driver *driver, break; default: - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("hostdev subsys type '%s' not supported"), - virDomainHostdevSubsysTypeToString(hostdev->source.subsys.type)); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("hostdev subsys type '%s' not supported"), + virDomainHostdevSubsysTypeToString(hostdev->source.subsys.type)); goto error; } @@ -1246,8 +1246,8 @@ int qemuDomainChangeNetBridge(virDomainObjPtr vm, olddev->ifname, oldbridge, newbridge); if (virNetDevExists(newbridge) != 1) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("bridge %s doesn't exist"), newbridge); + virReportError(VIR_ERR_OPERATION_FAILED, + _("bridge %s doesn't exist"), newbridge); return -1; } @@ -1268,9 +1268,9 @@ int qemuDomainChangeNetBridge(virDomainObjPtr vm, ret = virNetDevBridgeAddPort(oldbridge, olddev->ifname); virDomainAuditNet(vm, NULL, olddev, "attach", ret == 0); if (ret < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("unable to recover former state by adding port" - "to bridge %s"), oldbridge); + virReportError(VIR_ERR_OPERATION_FAILED, + _("unable to recover former state by adding port" + "to bridge %s"), oldbridge); } return -1; } @@ -1291,8 +1291,8 @@ int qemuDomainChangeNetLinkState(struct qemud_driver *driver, VIR_DEBUG("dev: %s, state: %d", dev->info.alias, linkstate); if (!dev->info.alias) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("can't change link state: device alias not found")); + virReportError(VIR_ERR_OPERATION_FAILED, + _("can't change link state: device alias not found")); return -1; } @@ -1321,14 +1321,14 @@ int qemuDomainChangeNet(struct qemud_driver *driver, int ret = 0; if (!olddev) { - qemuReportError(VIR_ERR_NO_SUPPORT, - _("cannot find existing network device to modify")); + virReportError(VIR_ERR_NO_SUPPORT, + _("cannot find existing network device to modify")); return -1; } if (olddev->type != dev->type) { - qemuReportError(VIR_ERR_NO_SUPPORT, - _("cannot change network interface type")); + virReportError(VIR_ERR_NO_SUPPORT, + _("cannot change network interface type")); return -1; } @@ -1340,8 +1340,8 @@ int qemuDomainChangeNet(struct qemud_driver *driver, if (STRNEQ_NULLABLE(olddev->data.ethernet.dev, dev->data.ethernet.dev) || STRNEQ_NULLABLE(olddev->script, dev->script) || STRNEQ_NULLABLE(olddev->data.ethernet.ipaddr, dev->data.ethernet.ipaddr)) { - qemuReportError(VIR_ERR_NO_SUPPORT, - _("cannot modify ethernet network device configuration")); + virReportError(VIR_ERR_NO_SUPPORT, + _("cannot modify ethernet network device configuration")); return -1; } break; @@ -1351,8 +1351,8 @@ int qemuDomainChangeNet(struct qemud_driver *driver, case VIR_DOMAIN_NET_TYPE_MCAST: if (STRNEQ_NULLABLE(olddev->data.socket.address, dev->data.socket.address) || olddev->data.socket.port != dev->data.socket.port) { - qemuReportError(VIR_ERR_NO_SUPPORT, - _("cannot modify network socket device configuration")); + virReportError(VIR_ERR_NO_SUPPORT, + _("cannot modify network socket device configuration")); return -1; } break; @@ -1361,8 +1361,8 @@ int qemuDomainChangeNet(struct qemud_driver *driver, if (STRNEQ_NULLABLE(olddev->data.network.name, dev->data.network.name) || STRNEQ_NULLABLE(olddev->data.network.portgroup, dev->data.network.portgroup) || !virNetDevVPortProfileEqual(olddev->data.network.virtPortProfile, dev->data.network.virtPortProfile)) { - qemuReportError(VIR_ERR_NO_SUPPORT, - _("cannot modify network device configuration")); + virReportError(VIR_ERR_NO_SUPPORT, + _("cannot modify network device configuration")); return -1; } @@ -1372,16 +1372,16 @@ int qemuDomainChangeNet(struct qemud_driver *driver, /* allow changing brname, but not portprofile */ if (!virNetDevVPortProfileEqual(olddev->data.bridge.virtPortProfile, dev->data.bridge.virtPortProfile)) { - qemuReportError(VIR_ERR_NO_SUPPORT, - _("cannot modify bridge network device configuration")); + virReportError(VIR_ERR_NO_SUPPORT, + _("cannot modify bridge network device configuration")); return -1; } break; case VIR_DOMAIN_NET_TYPE_INTERNAL: if (STRNEQ_NULLABLE(olddev->data.internal.name, dev->data.internal.name)) { - qemuReportError(VIR_ERR_NO_SUPPORT, - _("cannot modify internal network device configuration")); + virReportError(VIR_ERR_NO_SUPPORT, + _("cannot modify internal network device configuration")); return -1; } break; @@ -1390,16 +1390,16 @@ int qemuDomainChangeNet(struct qemud_driver *driver, if (STRNEQ_NULLABLE(olddev->data.direct.linkdev, dev->data.direct.linkdev) || olddev->data.direct.mode != dev->data.direct.mode || !virNetDevVPortProfileEqual(olddev->data.direct.virtPortProfile, dev->data.direct.virtPortProfile)) { - qemuReportError(VIR_ERR_NO_SUPPORT, - _("cannot modify direct network device configuration")); + virReportError(VIR_ERR_NO_SUPPORT, + _("cannot modify direct network device configuration")); return -1; } break; default: - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unable to change config on '%s' network type"), - virDomainNetTypeToString(dev->type)); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unable to change config on '%s' network type"), + virDomainNetTypeToString(dev->type)); break; } @@ -1407,16 +1407,16 @@ int qemuDomainChangeNet(struct qemud_driver *driver, /* all other unmodifiable parameters */ if (STRNEQ_NULLABLE(olddev->model, dev->model) || STRNEQ_NULLABLE(olddev->filter, dev->filter)) { - qemuReportError(VIR_ERR_NO_SUPPORT, - _("cannot modify network device configuration")); + virReportError(VIR_ERR_NO_SUPPORT, + _("cannot modify network device configuration")); return -1; } /* check if device name has been set, if no, retain the autogenerated one */ if (dev->ifname && STRNEQ_NULLABLE(olddev->ifname, dev->ifname)) { - qemuReportError(VIR_ERR_NO_SUPPORT, - _("cannot modify network device configuration")); + virReportError(VIR_ERR_NO_SUPPORT, + _("cannot modify network device configuration")); return -1; } @@ -1462,8 +1462,8 @@ qemuDomainChangeGraphics(struct qemud_driver *driver, int ret = -1; if (!olddev) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("cannot find existing graphics device to modify")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("cannot find existing graphics device to modify")); return -1; } @@ -1477,23 +1477,23 @@ qemuDomainChangeGraphics(struct qemud_driver *driver, if ((olddev->data.vnc.autoport != dev->data.vnc.autoport) || (!dev->data.vnc.autoport && (olddev->data.vnc.port != dev->data.vnc.port))) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("cannot change port settings on vnc graphics")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("cannot change port settings on vnc graphics")); return -1; } if (STRNEQ_NULLABLE(oldListenAddr,newListenAddr)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("cannot change listen address setting on vnc graphics")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("cannot change listen address setting on vnc graphics")); return -1; } if (STRNEQ_NULLABLE(oldListenNetwork,newListenNetwork)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("cannot change listen network setting on vnc graphics")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("cannot change listen network setting on vnc graphics")); return -1; } if (STRNEQ_NULLABLE(olddev->data.vnc.keymap, dev->data.vnc.keymap)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("cannot change keymap setting on vnc graphics")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("cannot change keymap setting on vnc graphics")); return -1; } @@ -1530,23 +1530,23 @@ qemuDomainChangeGraphics(struct qemud_driver *driver, (olddev->data.spice.port != dev->data.spice.port)) || (!dev->data.spice.autoport && (olddev->data.spice.tlsPort != dev->data.spice.tlsPort))) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("cannot change port settings on spice graphics")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("cannot change port settings on spice graphics")); return -1; } if (STRNEQ_NULLABLE(oldListenAddr, newListenAddr)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("cannot change listen address setting on spice graphics")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("cannot change listen address setting on spice graphics")); return -1; } if (STRNEQ_NULLABLE(oldListenNetwork, newListenNetwork)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("cannot change listen network setting on spice graphics")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("cannot change listen network setting on spice graphics")); return -1; } if (STRNEQ_NULLABLE(olddev->data.spice.keymap, dev->data.spice.keymap)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("cannot change keymap setting on spice graphics")); return -1; } @@ -1584,9 +1584,9 @@ qemuDomainChangeGraphics(struct qemud_driver *driver, break; default: - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unable to change config on '%s' graphics type"), - virDomainGraphicsTypeToString(dev->type)); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unable to change config on '%s' graphics type"), + virDomainGraphicsTypeToString(dev->type)); break; } @@ -1646,33 +1646,33 @@ int qemuDomainDetachPciDiskDevice(struct qemud_driver *driver, i = qemuFindDisk(vm->def, dev->data.disk->dst); if (i < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("disk %s not found"), dev->data.disk->dst); + virReportError(VIR_ERR_OPERATION_FAILED, + _("disk %s not found"), dev->data.disk->dst); goto cleanup; } detach = vm->def->disks[i]; if (qemuIsMultiFunctionDevice(vm->def, &detach->info)) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("cannot hot unplug multifunction PCI device: %s"), - dev->data.disk->dst); + virReportError(VIR_ERR_OPERATION_FAILED, + _("cannot hot unplug multifunction PCI device: %s"), + dev->data.disk->dst); goto cleanup; } if (qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_DEVICES)) { if (virCgroupForDomain(driver->cgroup, vm->def->name, &cgroup, 0) != 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to find cgroup for %s"), - vm->def->name); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Unable to find cgroup for %s"), + vm->def->name); goto cleanup; } } if (!virDomainDeviceAddressIsValid(&detach->info, VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI)) { - qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", - _("device cannot be detached without a PCI address")); + virReportError(VIR_ERR_OPERATION_FAILED, "%s", + _("device cannot be detached without a PCI address")); goto cleanup; } @@ -1750,15 +1750,15 @@ int qemuDomainDetachDiskDevice(struct qemud_driver *driver, i = qemuFindDisk(vm->def, dev->data.disk->dst); if (i < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("disk %s not found"), dev->data.disk->dst); + virReportError(VIR_ERR_OPERATION_FAILED, + _("disk %s not found"), dev->data.disk->dst); goto cleanup; } if (!qemuCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("Underlying qemu does not support %s disk removal"), - virDomainDiskBusTypeToString(dev->data.disk->bus)); + virReportError(VIR_ERR_OPERATION_FAILED, + _("Underlying qemu does not support %s disk removal"), + virDomainDiskBusTypeToString(dev->data.disk->bus)); goto cleanup; } @@ -1766,9 +1766,9 @@ int qemuDomainDetachDiskDevice(struct qemud_driver *driver, if (qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_DEVICES)) { if (virCgroupForDomain(driver->cgroup, vm->def->name, &cgroup, 0) != 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to find cgroup for %s"), - vm->def->name); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Unable to find cgroup for %s"), + vm->def->name); goto cleanup; } } @@ -1887,30 +1887,30 @@ int qemuDomainDetachPciControllerDevice(struct qemud_driver *driver, } if (!detach) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("disk controller %s:%d not found"), - virDomainControllerTypeToString(dev->data.controller->type), - dev->data.controller->idx); + virReportError(VIR_ERR_OPERATION_FAILED, + _("disk controller %s:%d not found"), + virDomainControllerTypeToString(dev->data.controller->type), + dev->data.controller->idx); goto cleanup; } if (!virDomainDeviceAddressIsValid(&detach->info, VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI)) { - qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", - _("device cannot be detached without a PCI address")); + virReportError(VIR_ERR_OPERATION_FAILED, "%s", + _("device cannot be detached without a PCI address")); goto cleanup; } if (qemuIsMultiFunctionDevice(vm->def, &detach->info)) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("cannot hot unplug multifunction PCI device: %s"), - dev->data.disk->dst); + virReportError(VIR_ERR_OPERATION_FAILED, + _("cannot hot unplug multifunction PCI device: %s"), + dev->data.disk->dst); goto cleanup; } if (qemuDomainControllerIsBusy(vm, detach)) { - qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", - _("device cannot be detached: device is busy")); + virReportError(VIR_ERR_OPERATION_FAILED, "%s", + _("device cannot be detached: device is busy")); goto cleanup; } @@ -1973,17 +1973,17 @@ qemuDomainDetachHostPciDevice(struct qemud_driver *driver, pciDevice *activePci; if (qemuIsMultiFunctionDevice(vm->def, detach->info)) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("cannot hot unplug multifunction PCI device: %.4x:%.2x:%.2x.%.1x"), - subsys->u.pci.domain, subsys->u.pci.bus, - subsys->u.pci.slot, subsys->u.pci.function); + virReportError(VIR_ERR_OPERATION_FAILED, + _("cannot hot unplug multifunction PCI device: %.4x:%.2x:%.2x.%.1x"), + subsys->u.pci.domain, subsys->u.pci.bus, + subsys->u.pci.slot, subsys->u.pci.function); return -1; } if (!virDomainDeviceAddressIsValid(detach->info, VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI)) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("device cannot be detached without a PCI address")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("device cannot be detached without a PCI address")); return -1; } @@ -2042,14 +2042,14 @@ qemuDomainDetachHostUsbDevice(struct qemud_driver *driver, int ret; if (!detach->info->alias) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("device cannot be detached without a device alias")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("device cannot be detached without a device alias")); return -1; } if (!qemuCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("device cannot be detached with this QEMU version")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("device cannot be detached with this QEMU version")); return -1; } @@ -2088,9 +2088,9 @@ int qemuDomainDetachThisHostDevice(struct qemud_driver *driver, break; } if (idx >= vm->def->nhostdevs) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("device not found in hostdevs list (%d entries)"), - vm->def->nhostdevs); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("device not found in hostdevs list (%d entries)"), + vm->def->nhostdevs); return ret; } } @@ -2103,9 +2103,9 @@ int qemuDomainDetachThisHostDevice(struct qemud_driver *driver, ret = qemuDomainDetachHostUsbDevice(driver, vm, detach); break; default: - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("hostdev subsys type '%s' not supported"), - virDomainHostdevSubsysTypeToString(detach->source.subsys.type)); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("hostdev subsys type '%s' not supported"), + virDomainHostdevSubsysTypeToString(detach->source.subsys.type)); return -1; } @@ -2131,9 +2131,9 @@ int qemuDomainDetachHostDevice(struct qemud_driver *driver, int idx; if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("hostdev mode '%s' not supported"), - virDomainHostdevModeTypeToString(hostdev->mode)); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("hostdev mode '%s' not supported"), + virDomainHostdevModeTypeToString(hostdev->mode)); return -1; } @@ -2142,25 +2142,25 @@ int qemuDomainDetachHostDevice(struct qemud_driver *driver, if (idx < 0) { switch(subsys->type) { case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI: - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("host pci device %.4x:%.2x:%.2x.%.1x not found"), - subsys->u.pci.domain, subsys->u.pci.bus, - subsys->u.pci.slot, subsys->u.pci.function); + virReportError(VIR_ERR_OPERATION_FAILED, + _("host pci device %.4x:%.2x:%.2x.%.1x not found"), + subsys->u.pci.domain, subsys->u.pci.bus, + subsys->u.pci.slot, subsys->u.pci.function); break; case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB: if (subsys->u.usb.bus && subsys->u.usb.device) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("host usb device %03d.%03d not found"), - subsys->u.usb.bus, subsys->u.usb.device); + virReportError(VIR_ERR_OPERATION_FAILED, + _("host usb device %03d.%03d not found"), + subsys->u.usb.bus, subsys->u.usb.device); } else { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("host usb device vendor=0x%.4x product=0x%.4x not found"), - subsys->u.usb.vendor, subsys->u.usb.product); + virReportError(VIR_ERR_OPERATION_FAILED, + _("host usb device vendor=0x%.4x product=0x%.4x not found"), + subsys->u.usb.vendor, subsys->u.usb.product); } break; default: - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected hostdev type %d"), subsys->type); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unexpected hostdev type %d"), subsys->type); break; } return -1; @@ -2197,11 +2197,11 @@ qemuDomainDetachNetDevice(struct qemud_driver *driver, } if (!detach) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("network device %02x:%02x:%02x:%02x:%02x:%02x not found"), - dev->data.net->mac.addr[0], dev->data.net->mac.addr[1], - dev->data.net->mac.addr[2], dev->data.net->mac.addr[3], - dev->data.net->mac.addr[4], dev->data.net->mac.addr[5]); + virReportError(VIR_ERR_OPERATION_FAILED, + _("network device %02x:%02x:%02x:%02x:%02x:%02x not found"), + dev->data.net->mac.addr[0], dev->data.net->mac.addr[1], + dev->data.net->mac.addr[2], dev->data.net->mac.addr[3], + dev->data.net->mac.addr[4], dev->data.net->mac.addr[5]); goto cleanup; } @@ -2214,21 +2214,21 @@ qemuDomainDetachNetDevice(struct qemud_driver *driver, if (!virDomainDeviceAddressIsValid(&detach->info, VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI)) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("device cannot be detached without a PCI address")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("device cannot be detached without a PCI address")); goto cleanup; } if (qemuIsMultiFunctionDevice(vm->def, &detach->info)) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("cannot hot unplug multifunction PCI device :%s"), - dev->data.disk->dst); + virReportError(VIR_ERR_OPERATION_FAILED, + _("cannot hot unplug multifunction PCI device :%s"), + dev->data.disk->dst); goto cleanup; } if ((vlan = qemuDomainNetVLAN(detach)) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("unable to determine original VLAN")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("unable to determine original VLAN")); goto cleanup; } @@ -2341,8 +2341,8 @@ qemuDomainChangeGraphicsPasswords(struct qemud_driver *driver, if (ret == -2) { if (type != VIR_DOMAIN_GRAPHICS_TYPE_VNC) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Graphics password only supported for VNC")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Graphics password only supported for VNC")); ret = -1; } else { ret = qemuMonitorSetVNCPassword(priv->mon, @@ -2367,8 +2367,8 @@ qemuDomainChangeGraphicsPasswords(struct qemud_driver *driver, if (ret == -2) { /* XXX we could fake this with a timer */ if (auth->expires) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Expiry of passwords is not supported")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Expiry of passwords is not supported")); ret = -1; } else { ret = 0; @@ -2405,9 +2405,9 @@ int qemuDomainDetachLease(struct qemud_driver *driver, int i; if ((i = virDomainLeaseIndex(vm->def, lease)) < 0) { - qemuReportError(VIR_ERR_INVALID_ARG, - _("Lease %s in lockspace %s does not exist"), - lease->key, NULLSTR(lease->lockspace)); + virReportError(VIR_ERR_INVALID_ARG, + _("Lease %s in lockspace %s does not exist"), + lease->key, NULLSTR(lease->lockspace)); return -1; } diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index d176e7d..f8e2f90 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -164,16 +164,16 @@ qemuDomainExtractTLSSubject(const char *certdir) goto no_memory; if (virFileReadAll(certfile, 8192, &pemdata) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unable to read server cert %s"), certfile); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unable to read server cert %s"), certfile); goto error; } ret = gnutls_x509_crt_init(&cert); if (ret < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot initialize cert object: %s"), - gnutls_strerror(ret)); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot initialize cert object: %s"), + gnutls_strerror(ret)); goto error; } @@ -182,9 +182,9 @@ qemuDomainExtractTLSSubject(const char *certdir) ret = gnutls_x509_crt_import(cert, &pemdatum, GNUTLS_X509_FMT_PEM); if (ret < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot load cert data from %s: %s"), - certfile, gnutls_strerror(ret)); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot load cert data from %s: %s"), + certfile, gnutls_strerror(ret)); goto error; } @@ -277,8 +277,8 @@ qemuMigrationCookieNew(virDomainObjPtr dom) if (!(mig->localHostname = virGetHostname(NULL))) goto error; if (virGetHostUUID(mig->localHostuuid) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Unable to obtain host UUID")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to obtain host UUID")); goto error; } @@ -298,8 +298,8 @@ qemuMigrationCookieAddGraphics(qemuMigrationCookiePtr mig, virDomainObjPtr dom) { if (mig->flags & QEMU_MIGRATION_COOKIE_GRAPHICS) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Migration graphics data already present")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Migration graphics data already present")); return -1; } @@ -324,8 +324,8 @@ qemuMigrationCookieAddLockstate(qemuMigrationCookiePtr mig, qemuDomainObjPrivatePtr priv = dom->privateData; if (mig->flags & QEMU_MIGRATION_COOKIE_LOCKSTATE) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Migration lockstate data already present")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Migration lockstate data already present")); return -1; } @@ -355,8 +355,8 @@ qemuMigrationCookieAddPersistent(qemuMigrationCookiePtr mig, virDomainObjPtr dom) { if (mig->flags & QEMU_MIGRATION_COOKIE_PERSISTENT) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Migration persistent data already present")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Migration persistent data already present")); return -1; } @@ -474,32 +474,32 @@ qemuMigrationCookieGraphicsXMLParse(xmlXPathContextPtr ctxt) goto no_memory; if (!(tmp = virXPathString("string(./graphics/@type)", ctxt))) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("missing type attribute in migration data")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("missing type attribute in migration data")); goto error; } if ((grap->type = virDomainGraphicsTypeFromString(tmp)) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unknown graphics type %s"), tmp); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unknown graphics type %s"), tmp); VIR_FREE(tmp); goto error; } VIR_FREE(tmp); if (virXPathInt("string(./graphics/@port)", ctxt, &grap->port) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("missing port attribute in migration data")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("missing port attribute in migration data")); goto error; } if (grap->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE) { if (virXPathInt("string(./graphics/@tlsPort)", ctxt, &grap->tlsPort) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("missing tlsPort attribute in migration data")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("missing tlsPort attribute in migration data")); goto error; } } if (!(grap->listen = virXPathString("string(./graphics/@listen)", ctxt))) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("missing listen attribute in migration data")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("missing listen attribute in migration data")); goto error; } /* Optional */ @@ -535,14 +535,14 @@ qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig, /* Extract domain name */ if (!(tmp = virXPathString("string(./name[1])", ctxt))) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("missing name element in migration data")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("missing name element in migration data")); goto error; } if (STRNEQ(tmp, mig->name)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Incoming cookie data had unexpected name %s vs %s"), - tmp, mig->name); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Incoming cookie data had unexpected name %s vs %s"), + tmp, mig->name); goto error; } VIR_FREE(tmp); @@ -550,45 +550,45 @@ qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig, /* Extract domain uuid */ tmp = virXPathString("string(./uuid[1])", ctxt); if (!tmp) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("missing uuid element in migration data")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("missing uuid element in migration data")); goto error; } virUUIDFormat(mig->uuid, uuidstr); if (STRNEQ(tmp, uuidstr)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Incoming cookie data had unexpected UUID %s vs %s"), - tmp, uuidstr); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Incoming cookie data had unexpected UUID %s vs %s"), + tmp, uuidstr); } VIR_FREE(tmp); /* Check & forbid "localhost" migration */ if (!(mig->remoteHostname = virXPathString("string(./hostname[1])", ctxt))) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("missing hostname element in migration data")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("missing hostname element in migration data")); goto error; } if (STREQ(mig->remoteHostname, mig->localHostname)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Attempt to migrate guest to the same host %s"), - mig->remoteHostname); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Attempt to migrate guest to the same host %s"), + mig->remoteHostname); goto error; } if (!(tmp = virXPathString("string(./hostuuid[1])", ctxt))) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("missing hostuuid element in migration data")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("missing hostuuid element in migration data")); goto error; } if (virUUIDParse(tmp, mig->remoteHostuuid) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("malformed hostuuid element in migration data")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("malformed hostuuid element in migration data")); goto error; } if (memcmp(mig->remoteHostuuid, mig->localHostuuid, VIR_UUID_BUFLEN) == 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Attempt to migrate guest to the same host %s"), - tmp); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Attempt to migrate guest to the same host %s"), + tmp); goto error; } VIR_FREE(tmp); @@ -602,23 +602,23 @@ qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig, int val; char *str = virXMLPropString(nodes[i], "name"); if (!str) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("missing feature name")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("missing feature name")); goto error; } if ((val = qemuMigrationCookieFlagTypeFromString(str)) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Unknown migration cookie feature %s"), - str); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Unknown migration cookie feature %s"), + str); VIR_FREE(str); goto error; } if ((flags & (1 << val)) == 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Unsupported migration cookie feature %s"), - str); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Unsupported migration cookie feature %s"), + str); VIR_FREE(str); } VIR_FREE(str); @@ -634,8 +634,8 @@ qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig, virXPathBoolean("count(./lockstate) > 0", ctxt)) { mig->lockDriver = virXPathString("string(./lockstate[1]/@driver)", ctxt); if (!mig->lockDriver) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Missing lock driver name in migration cookie")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Missing lock driver name in migration cookie")); goto error; } mig->lockState = virXPathString("string(./lockstate[1]/leases[1])", ctxt); @@ -646,10 +646,10 @@ qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig, if ((flags & QEMU_MIGRATION_COOKIE_PERSISTENT) && virXPathBoolean("count(./domain) > 0", ctxt)) { if ((n = virXPathNodeSet("./domain", ctxt, &nodes)) > 1) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Too many domain elements in " - "migration cookie: %d"), - n); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Too many domain elements in " + "migration cookie: %d"), + n); goto error; } mig->persistent = virDomainDefParseNode(driver->caps, doc, nodes[0], @@ -744,8 +744,8 @@ qemuMigrationEatCookie(struct qemud_driver *driver, /* Parse & validate incoming cookie (if any) */ if (cookiein && cookieinlen && cookiein[cookieinlen-1] != '\0') { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Migration cookie was not NULL terminated")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Migration cookie was not NULL terminated")); goto error; } @@ -764,17 +764,17 @@ qemuMigrationEatCookie(struct qemud_driver *driver, if (mig->flags & QEMU_MIGRATION_COOKIE_LOCKSTATE) { if (!mig->lockDriver) { if (virLockManagerPluginUsesState(driver->lockManager)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Missing %s lock state for migration cookie"), - virLockManagerPluginGetName(driver->lockManager)); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Missing %s lock state for migration cookie"), + virLockManagerPluginGetName(driver->lockManager)); goto error; } } else if (STRNEQ(mig->lockDriver, virLockManagerPluginGetName(driver->lockManager))) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Source host lock driver %s different from target %s"), - mig->lockDriver, - virLockManagerPluginGetName(driver->lockManager)); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Source host lock driver %s different from target %s"), + mig->lockDriver, + virLockManagerPluginGetName(driver->lockManager)); goto error; } } @@ -803,23 +803,23 @@ qemuMigrationIsAllowed(struct qemud_driver *driver, virDomainObjPtr vm, if (vm) { if (qemuProcessAutoDestroyActive(driver, vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is marked for auto destroy")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is marked for auto destroy")); return false; } if ((nsnapshots = virDomainSnapshotObjListNum(&vm->snapshots, NULL, 0))) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - _("cannot migrate domain with %d snapshots"), - nsnapshots); + virReportError(VIR_ERR_OPERATION_INVALID, + _("cannot migrate domain with %d snapshots"), + nsnapshots); return false; } def = vm->def; } if (def->nhostdevs > 0) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("Domain with assigned host devices cannot be migrated")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("Domain with assigned host devices cannot be migrated")); return false; } @@ -852,9 +852,9 @@ qemuMigrationIsSafe(virDomainDefPtr def) continue; } - qemuReportError(VIR_ERR_MIGRATE_UNSAFE, "%s", - _("Migration may lead to data corruption if disks" - " use cache != none")); + virReportError(VIR_ERR_MIGRATE_UNSAFE, "%s", + _("Migration may lead to data corruption if disks" + " use cache != none")); return false; } } @@ -922,8 +922,8 @@ qemuMigrationUpdateJobStatus(struct qemud_driver *driver, switch (status) { case QEMU_MONITOR_MIGRATION_STATUS_INACTIVE: priv->job.info.type = VIR_DOMAIN_JOB_NONE; - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("%s: %s"), job, _("is not active")); + virReportError(VIR_ERR_OPERATION_FAILED, + _("%s: %s"), job, _("is not active")); break; case QEMU_MONITOR_MIGRATION_STATUS_ACTIVE: @@ -945,14 +945,14 @@ qemuMigrationUpdateJobStatus(struct qemud_driver *driver, case QEMU_MONITOR_MIGRATION_STATUS_ERROR: priv->job.info.type = VIR_DOMAIN_JOB_FAILED; - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("%s: %s"), job, _("unexpectedly failed")); + virReportError(VIR_ERR_OPERATION_FAILED, + _("%s: %s"), job, _("unexpectedly failed")); break; case QEMU_MONITOR_MIGRATION_STATUS_CANCELLED: priv->job.info.type = VIR_DOMAIN_JOB_CANCELLED; - qemuReportError(VIR_ERR_OPERATION_ABORTED, - _("%s: %s"), job, _("canceled by client")); + virReportError(VIR_ERR_OPERATION_ABORTED, + _("%s: %s"), job, _("canceled by client")); break; } @@ -992,8 +992,8 @@ qemuMigrationWaitForCompletion(struct qemud_driver *driver, virDomainObjPtr vm, goto cleanup; if (dconn && virConnectIsAlive(dconn) <= 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", - _("Lost connection to destination host")); + virReportError(VIR_ERR_OPERATION_FAILED, "%s", + _("Lost connection to destination host")); goto cleanup; } @@ -1158,8 +1158,8 @@ char *qemuMigrationBegin(struct qemud_driver *driver, goto cleanup; if (STRNEQ(def->name, vm->def->name)) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("target domain name doesn't match source name")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("target domain name doesn't match source name")); goto cleanup; } @@ -1371,8 +1371,8 @@ qemuMigrationPrepareAny(struct qemud_driver *driver, */ if (qemuMigrationJobContinue(vm) == 0) { vm = NULL; - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("domain disappeared")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("domain disappeared")); goto cleanup; } @@ -1480,9 +1480,9 @@ qemuMigrationPrepareDirect(struct qemud_driver *driver, goto cleanup; if (STRPREFIX(hostname, "localhost")) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("hostname on destination resolved to localhost," - " but migration requires an FQDN")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("hostname on destination resolved to localhost," + " but migration requires an FQDN")); goto cleanup; } @@ -1502,9 +1502,9 @@ qemuMigrationPrepareDirect(struct qemud_driver *driver, * characters in hostname part don't matter. */ if (!STRPREFIX (uri_in, "tcp:")) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("only tcp URIs are supported for KVM/QEMU" - " migrations")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("only tcp URIs are supported for KVM/QEMU" + " migrations")); goto cleanup; } @@ -1526,8 +1526,8 @@ qemuMigrationPrepareDirect(struct qemud_driver *driver, p++; /* definitely has a ':' in it, see above */ this_port = virParseNumber (&p); if (this_port == -1 || p-uri_in != strlen (uri_in)) { - qemuReportError(VIR_ERR_INVALID_ARG, - "%s", _("URI ended with incorrect ':port'")); + virReportError(VIR_ERR_INVALID_ARG, + "%s", _("URI ended with incorrect ':port'")); goto cleanup; } } @@ -1850,10 +1850,10 @@ qemuMigrationRun(struct qemud_driver *driver, if (virLockManagerPluginUsesState(driver->lockManager) && !cookieout) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Migration with lock driver %s requires" - " cookie support"), - virLockManagerPluginGetName(driver->lockManager)); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Migration with lock driver %s requires" + " cookie support"), + virLockManagerPluginGetName(driver->lockManager)); return -1; } @@ -1932,8 +1932,8 @@ qemuMigrationRun(struct qemud_driver *driver, ret = -1; if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("guest unexpectedly quit")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("guest unexpectedly quit")); goto cleanup; } @@ -2102,8 +2102,8 @@ static int doTunnelMigrate(struct qemud_driver *driver, if (!qemuCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATE_QEMU_FD) && !qemuCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATE_QEMU_UNIX) && !qemuCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATE_QEMU_EXEC)) { - qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", - _("Source qemu is too old to support tunnelled migration")); + virReportError(VIR_ERR_OPERATION_FAILED, "%s", + _("Source qemu is too old to support tunnelled migration")); return -1; } @@ -2233,15 +2233,15 @@ static int doPeer2PeerMigrate2(struct qemud_driver *driver, * in qemuDomainObjEnterRemoteWithDriver, so check again */ if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("guest unexpectedly quit")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("guest unexpectedly quit")); goto cleanup; } if (!(flags & VIR_MIGRATE_TUNNELLED) && (uri_out == NULL)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("domainMigratePrepare2 did not set uri")); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("domainMigratePrepare2 did not set uri")); cancelled = 1; goto finish; } @@ -2378,8 +2378,8 @@ static int doPeer2PeerMigrate3(struct qemud_driver *driver, if (!(flags & VIR_MIGRATE_TUNNELLED) && (uri_out == NULL)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("domainMigratePrepare3 did not set uri")); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("domainMigratePrepare3 did not set uri")); cancelled = 1; goto finish; } @@ -2529,8 +2529,8 @@ static int doPeer2PeerMigrate(struct qemud_driver *driver, dconn = virConnectOpen(dconnuri); qemuDomainObjExitRemoteWithDriver(driver, vm); if (dconn == NULL) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("Failed to connect to remote libvirt URI %s"), dconnuri); + virReportError(VIR_ERR_OPERATION_FAILED, + _("Failed to connect to remote libvirt URI %s"), dconnuri); return -1; } @@ -2550,15 +2550,15 @@ static int doPeer2PeerMigrate(struct qemud_driver *driver, qemuDomainObjExitRemoteWithDriver(driver, vm); if (!p2p) { - qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", - _("Destination libvirt does not support peer-to-peer migration protocol")); + virReportError(VIR_ERR_OPERATION_FAILED, "%s", + _("Destination libvirt does not support peer-to-peer migration protocol")); goto cleanup; } /* domain may have been stopped while we were talking to remote daemon */ if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("guest unexpectedly quit")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("guest unexpectedly quit")); goto cleanup; } @@ -2620,8 +2620,8 @@ qemuMigrationPerformJob(struct qemud_driver *driver, goto cleanup; if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is not running")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is not running")); goto endjob; } @@ -2816,8 +2816,8 @@ qemuMigrationPerform(struct qemud_driver *driver, if ((flags & (VIR_MIGRATE_TUNNELLED | VIR_MIGRATE_PEER2PEER))) { if (cookieinlen) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("received unexpected cookie with P2P migration")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("received unexpected cookie with P2P migration")); return -1; } @@ -2827,8 +2827,8 @@ qemuMigrationPerform(struct qemud_driver *driver, v3proto); } else { if (dconnuri) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("Unexpected dconnuri parameter with non-peer2peer migration")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("Unexpected dconnuri parameter with non-peer2peer migration")); return -1; } @@ -2863,9 +2863,9 @@ qemuMigrationVPAssociatePortProfiles(virDomainDefPtr def) { def->uuid, VIR_NETDEV_VPORT_PROFILE_OP_MIGRATE_IN_FINISH, false) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("Port profile Associate failed for %s"), - net->ifname); + virReportError(VIR_ERR_OPERATION_FAILED, + _("Port profile Associate failed for %s"), + net->ifname); goto err_exit; } VIR_DEBUG("Port profile Associate succeeded for %s", net->ifname); @@ -2943,8 +2943,8 @@ qemuMigrationFinish(struct qemud_driver *driver, */ if (retcode == 0) { if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("guest unexpectedly quit")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("guest unexpectedly quit")); goto endjob; } @@ -2990,8 +2990,8 @@ qemuMigrationFinish(struct qemud_driver *driver, vm->persistent = 0; } if (!vmdef) - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("can't get vmdef")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("can't get vmdef")); goto endjob; } @@ -3014,8 +3014,8 @@ qemuMigrationFinish(struct qemud_driver *driver, VIR_DOMAIN_RUNNING_MIGRATED, QEMU_ASYNC_JOB_MIGRATION_IN) < 0) { if (virGetLastError() == NULL) - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("resume operation failed")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("resume operation failed")); /* Need to save the current error, in case shutting * down the process overwrites it */ @@ -3144,8 +3144,8 @@ int qemuMigrationConfirm(struct qemud_driver *driver, VIR_DOMAIN_RUNNING_MIGRATED, QEMU_ASYNC_JOB_MIGRATION_OUT) < 0) { if (virGetLastError() == NULL) - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("resume operation failed")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("resume operation failed")); goto cleanup; } @@ -3214,9 +3214,9 @@ qemuMigrationToFile(struct qemud_driver *driver, virDomainObjPtr vm, VIR_CGROUP_CONTROLLER_DEVICES)) { if (virCgroupForDomain(driver->cgroup, vm->def->name, &cgroup, 0) != 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to find cgroup for %s"), - vm->def->name); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Unable to find cgroup for %s"), + vm->def->name); goto cleanup; } rc = virCgroupAllowDevicePath(cgroup, path, @@ -3401,7 +3401,7 @@ qemuMigrationJobIsActive(virDomainObjPtr vm, else msg = _("domain '%s' is not being migrated"); - qemuReportError(VIR_ERR_OPERATION_INVALID, msg, vm->def->name); + virReportError(VIR_ERR_OPERATION_INVALID, msg, vm->def->name); return false; } return true; diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 42a5d6c..ac78b29 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -286,8 +286,8 @@ qemuMonitorOpenUnix(const char *monitor, pid_t cpid) memset(&addr, 0, sizeof(addr)); addr.sun_family = AF_UNIX; if (virStrcpyStatic(addr.sun_path, monitor) == NULL) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Monitor path %s too big for destination"), monitor); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Monitor path %s too big for destination"), monitor); goto error; } @@ -329,8 +329,8 @@ qemuMonitorOpenPty(const char *monitor) int monfd; if ((monfd = open(monitor, O_RDWR)) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to open monitor path %s"), monitor); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Unable to open monitor path %s"), monitor); return -1; } @@ -451,8 +451,8 @@ qemuMonitorIOWrite(qemuMonitorPtr mon) return 0; if (mon->msg->txFD != -1 && !mon->hasSendFD) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Monitor does not support sending of file descriptors")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Monitor does not support sending of file descriptors")); return -1; } @@ -577,9 +577,9 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque) { if (mon->fd != fd || mon->watch != watch) { if (events & (VIR_EVENT_HANDLE_HANGUP | VIR_EVENT_HANDLE_ERROR)) eof = true; - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("event from unexpected fd %d!=%d / watch %d!=%d"), - mon->fd, fd, mon->watch, watch); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("event from unexpected fd %d!=%d / watch %d!=%d"), + mon->fd, fd, mon->watch, watch); error = true; } else if (mon->lastError.code != VIR_ERR_OK) { if (events & (VIR_EVENT_HANDLE_HANGUP | VIR_EVENT_HANDLE_ERROR)) @@ -612,23 +612,23 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque) { if (!error && events & VIR_EVENT_HANDLE_HANGUP) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("End of file from monitor")); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("End of file from monitor")); eof = 1; events &= ~VIR_EVENT_HANDLE_HANGUP; } if (!error && !eof && events & VIR_EVENT_HANDLE_ERROR) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Invalid file descriptor while waiting for monitor")); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Invalid file descriptor while waiting for monitor")); eof = 1; events &= ~VIR_EVENT_HANDLE_ERROR; } if (!error && events) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Unhandled event %d for monitor fd %d"), - events, mon->fd); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Unhandled event %d for monitor fd %d"), + events, mon->fd); error = 1; } } @@ -640,8 +640,8 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque) { } else { virErrorPtr err = virGetLastError(); if (!err) - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Error while processing monitor IO")); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Error while processing monitor IO")); virCopyLastError(&mon->lastError); virResetLastError(); } @@ -698,8 +698,8 @@ qemuMonitorOpen(virDomainObjPtr vm, qemuMonitorPtr mon; if (!cb || !cb->eofNotify) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("EOF notify callback must be supplied")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("EOF notify callback must be supplied")); return NULL; } @@ -709,14 +709,14 @@ qemuMonitorOpen(virDomainObjPtr vm, } if (virMutexInit(&mon->lock) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("cannot initialize monitor mutex")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("cannot initialize monitor mutex")); VIR_FREE(mon); return NULL; } if (virCondInit(&mon->notify) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("cannot initialize monitor condition")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("cannot initialize monitor condition")); virMutexDestroy(&mon->lock); VIR_FREE(mon); return NULL; @@ -739,22 +739,22 @@ qemuMonitorOpen(virDomainObjPtr vm, break; default: - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unable to handle monitor type: %s"), - virDomainChrTypeToString(config->type)); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unable to handle monitor type: %s"), + virDomainChrTypeToString(config->type)); goto cleanup; } if (mon->fd == -1) goto cleanup; if (virSetCloseExec(mon->fd) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("Unable to set monitor close-on-exec flag")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("Unable to set monitor close-on-exec flag")); goto cleanup; } if (virSetNonBlock(mon->fd) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("Unable to put monitor into non-blocking mode")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("Unable to put monitor into non-blocking mode")); goto cleanup; } @@ -765,8 +765,8 @@ qemuMonitorOpen(virDomainObjPtr vm, VIR_EVENT_HANDLE_READABLE, qemuMonitorIO, mon, qemuMonitorUnwatch)) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("unable to register monitor events")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("unable to register monitor events")); goto cleanup; } qemuMonitorRef(mon); @@ -813,8 +813,8 @@ void qemuMonitorClose(qemuMonitorPtr mon) if (mon->lastError.code == VIR_ERR_OK) { virErrorPtr err = virSaveLastError(); - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("Qemu monitor was closed")); + virReportError(VIR_ERR_OPERATION_FAILED, + _("Qemu monitor was closed")); virCopyLastError(&mon->lastError); if (err) { virSetError(err); @@ -866,8 +866,8 @@ int qemuMonitorSend(qemuMonitorPtr mon, while (!mon->msg->finished) { if (virCondWait(&mon->notify, &mon->lock) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Unable to wait on monitor condition")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to wait on monitor condition")); goto cleanup; } } @@ -902,8 +902,8 @@ int qemuMonitorHMPCommandWithFd(qemuMonitorPtr mon, json_cmd = qemuMonitorUnescapeArg(cmd); if (!json_cmd) { VIR_DEBUG("Could not unescape command: %s", cmd); - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Unable to unescape command")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to unescape command")); goto cleanup; } ret = qemuMonitorJSONHumanCommandWithFd(mon, json_cmd, scm_fd, reply); @@ -1105,8 +1105,8 @@ int qemuMonitorSetCapabilities(qemuMonitorPtr mon, VIR_DEBUG("mon=%p", mon); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -1155,8 +1155,8 @@ qemuMonitorStartCPUs(qemuMonitorPtr mon, VIR_DEBUG("mon=%p", mon); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -1175,8 +1175,8 @@ qemuMonitorStopCPUs(qemuMonitorPtr mon) VIR_DEBUG("mon=%p", mon); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -1197,8 +1197,8 @@ qemuMonitorGetStatus(qemuMonitorPtr mon, VIR_DEBUG("mon=%p, running=%p, reason=%p", mon, running, reason); if (!mon || !running) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("both monitor and running must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("both monitor and running must not be NULL")); return -1; } @@ -1216,8 +1216,8 @@ int qemuMonitorSystemPowerdown(qemuMonitorPtr mon) VIR_DEBUG("mon=%p", mon); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -1235,8 +1235,8 @@ int qemuMonitorSystemReset(qemuMonitorPtr mon) VIR_DEBUG("mon=%p", mon); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -1255,8 +1255,8 @@ int qemuMonitorGetCPUInfo(qemuMonitorPtr mon, VIR_DEBUG("mon=%p", mon); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -1275,8 +1275,8 @@ int qemuMonitorSetLink(qemuMonitorPtr mon, VIR_DEBUG("mon=%p, name=%p:%s, state=%u", mon, name, name, state); if (!mon || !name) { - qemuReportError(VIR_ERR_INVALID_ARG, - _("monitor || name must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, + _("monitor || name must not be NULL")); return -1; } @@ -1294,8 +1294,8 @@ int qemuMonitorGetVirtType(qemuMonitorPtr mon, VIR_DEBUG("mon=%p", mon); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -1314,8 +1314,8 @@ int qemuMonitorGetBalloonInfo(qemuMonitorPtr mon, VIR_DEBUG("mon=%p", mon); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -1335,8 +1335,8 @@ int qemuMonitorGetMemoryStats(qemuMonitorPtr mon, VIR_DEBUG("mon=%p stats=%p nstats=%u", mon, stats, nr_stats); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -1353,8 +1353,8 @@ qemuMonitorBlockIOStatusToError(const char *status) int st = qemuMonitorBlockIOStatusTypeFromString(status); if (st < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unknown block IO status: %s"), status); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unknown block IO status: %s"), status); return -1; } @@ -1382,8 +1382,8 @@ qemuMonitorGetBlockInfo(qemuMonitorPtr mon) VIR_DEBUG("mon=%p", mon); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return NULL; } @@ -1412,9 +1412,9 @@ qemuMonitorBlockInfoLookup(virHashTablePtr blockInfo, VIR_DEBUG("blockInfo=%p dev=%s", blockInfo, NULLSTR(devname)); if (!(info = virHashLookup(blockInfo, devname))) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot find info for device '%s'"), - NULLSTR(devname)); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot find info for device '%s'"), + NULLSTR(devname)); } return info; @@ -1436,8 +1436,8 @@ int qemuMonitorGetBlockStatsInfo(qemuMonitorPtr mon, VIR_DEBUG("mon=%p dev=%s", mon, dev_name); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -1472,8 +1472,8 @@ int qemuMonitorGetBlockStatsParamsNumber(qemuMonitorPtr mon, VIR_DEBUG("mon=%p nparams=%p", mon, nparams); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -1525,8 +1525,8 @@ int qemuMonitorSetVNCPassword(qemuMonitorPtr mon, mon, password); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -1548,9 +1548,9 @@ static const char* qemuMonitorTypeToProtocol(int type) case VIR_DOMAIN_GRAPHICS_TYPE_SPICE: return "spice"; default: - qemuReportError(VIR_ERR_INVALID_ARG, - _("unsupported protocol type %s"), - virDomainGraphicsTypeToString(type)); + virReportError(VIR_ERR_INVALID_ARG, + _("unsupported protocol type %s"), + virDomainGraphicsTypeToString(type)); return NULL; } } @@ -1571,8 +1571,8 @@ int qemuMonitorSetPassword(qemuMonitorPtr mon, mon, protocol, password, action_if_connected); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -1603,8 +1603,8 @@ int qemuMonitorExpirePassword(qemuMonitorPtr mon, mon, protocol, expire_time); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -1625,8 +1625,8 @@ int qemuMonitorSetBalloon(qemuMonitorPtr mon, VIR_DEBUG("mon=%p newmem=%lu", mon, newmem); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -1644,8 +1644,8 @@ int qemuMonitorSetCPU(qemuMonitorPtr mon, int cpu, int online) VIR_DEBUG("mon=%p cpu=%d online=%d", mon, cpu, online); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -1665,8 +1665,8 @@ int qemuMonitorEjectMedia(qemuMonitorPtr mon, VIR_DEBUG("mon=%p dev_name=%s force=%d", mon, dev_name, force); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -1688,8 +1688,8 @@ int qemuMonitorChangeMedia(qemuMonitorPtr mon, mon, dev_name, newmedia, format); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -1711,8 +1711,8 @@ int qemuMonitorSaveVirtualMemory(qemuMonitorPtr mon, mon, offset, length, path); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -1733,8 +1733,8 @@ int qemuMonitorSavePhysicalMemory(qemuMonitorPtr mon, mon, offset, length, path); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -1753,8 +1753,8 @@ int qemuMonitorSetMigrationSpeed(qemuMonitorPtr mon, VIR_DEBUG("mon=%p bandwidth=%lu", mon, bandwidth); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -1773,8 +1773,8 @@ int qemuMonitorSetMigrationDowntime(qemuMonitorPtr mon, VIR_DEBUG("mon=%p downtime=%llu", mon, downtime); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -1796,8 +1796,8 @@ int qemuMonitorGetMigrationStatus(qemuMonitorPtr mon, VIR_DEBUG("mon=%p", mon); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -1824,8 +1824,8 @@ int qemuMonitorMigrateToFd(qemuMonitorPtr mon, mon, fd, flags); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -1857,8 +1857,8 @@ int qemuMonitorMigrateToHost(qemuMonitorPtr mon, mon, hostname, port, flags); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -1889,8 +1889,8 @@ int qemuMonitorMigrateToCommand(qemuMonitorPtr mon, mon, argv, flags); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -1931,15 +1931,15 @@ int qemuMonitorMigrateToFile(qemuMonitorPtr mon, mon, argv, target, offset, flags); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } if (offset % QEMU_MONITOR_MIGRATE_TO_FILE_BS) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("file offset must be a multiple of %llu"), - QEMU_MONITOR_MIGRATE_TO_FILE_BS); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("file offset must be a multiple of %llu"), + QEMU_MONITOR_MIGRATE_TO_FILE_BS); return -1; } @@ -1996,8 +1996,8 @@ int qemuMonitorMigrateToUnix(qemuMonitorPtr mon, mon, unixfile, flags); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -2021,8 +2021,8 @@ int qemuMonitorMigrateCancel(qemuMonitorPtr mon) VIR_DEBUG("mon=%p", mon); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -2044,8 +2044,8 @@ int qemuMonitorDumpToFd(qemuMonitorPtr mon, mon, fd, flags, begin, length); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -2053,8 +2053,8 @@ int qemuMonitorDumpToFd(qemuMonitorPtr mon, /* We don't have qemuMonitorTextDump(), so we should check mon->json * here. */ - qemuReportError(VIR_ERR_NO_SUPPORT, "%s", - _("dump-guest-memory is not supported in text mode")); + virReportError(VIR_ERR_NO_SUPPORT, "%s", + _("dump-guest-memory is not supported in text mode")); return -1; } @@ -2108,8 +2108,8 @@ int qemuMonitorAddUSBDisk(qemuMonitorPtr mon, VIR_DEBUG("mon=%p path=%s", mon, path); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -2129,8 +2129,8 @@ int qemuMonitorAddUSBDeviceExact(qemuMonitorPtr mon, VIR_DEBUG("mon=%p bus=%d dev=%d", mon, bus, dev); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -2150,8 +2150,8 @@ int qemuMonitorAddUSBDeviceMatch(qemuMonitorPtr mon, mon, vendor, product); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -2173,8 +2173,8 @@ int qemuMonitorAddPCIHostDevice(qemuMonitorPtr mon, hostAddr->domain, hostAddr->bus, hostAddr->slot, hostAddr->function); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -2196,8 +2196,8 @@ int qemuMonitorAddPCIDisk(qemuMonitorPtr mon, mon, path, bus); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -2217,8 +2217,8 @@ int qemuMonitorAddPCINetwork(qemuMonitorPtr mon, VIR_DEBUG("mon=%p nicstr=%s", mon, nicstr); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -2239,8 +2239,8 @@ int qemuMonitorRemovePCIDevice(qemuMonitorPtr mon, guestAddr->slot, guestAddr->function); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -2261,21 +2261,21 @@ int qemuMonitorSendFileHandle(qemuMonitorPtr mon, mon, fdname, fd); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } if (fd < 0) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("fd must be valid")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("fd must be valid")); return -1; } if (!mon->hasSendFD) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("qemu is not using a unix socket monitor, " - "cannot send fd %s"), fdname); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("qemu is not using a unix socket monitor, " + "cannot send fd %s"), fdname); return -1; } @@ -2299,8 +2299,8 @@ int qemuMonitorCloseFileHandle(qemuMonitorPtr mon, error = virSaveLastError(); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); goto cleanup; } @@ -2330,8 +2330,8 @@ int qemuMonitorAddHostNetwork(qemuMonitorPtr mon, vhostfd, NULLSTR(vhostfd_name)); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -2369,8 +2369,8 @@ int qemuMonitorRemoveHostNetwork(qemuMonitorPtr mon, mon, netname); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -2394,8 +2394,8 @@ int qemuMonitorAddNetdev(qemuMonitorPtr mon, vhostfd, NULLSTR(vhostfd_name)); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -2431,8 +2431,8 @@ int qemuMonitorRemoveNetdev(qemuMonitorPtr mon, mon, alias); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -2452,8 +2452,8 @@ int qemuMonitorGetPtyPaths(qemuMonitorPtr mon, mon); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -2473,8 +2473,8 @@ int qemuMonitorAttachPCIDiskController(qemuMonitorPtr mon, int ret; if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -2499,8 +2499,8 @@ int qemuMonitorAttachDrive(qemuMonitorPtr mon, int ret; if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -2519,8 +2519,8 @@ int qemuMonitorGetAllPCIAddresses(qemuMonitorPtr mon, int ret; if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -2538,8 +2538,8 @@ int qemuMonitorDriveDel(qemuMonitorPtr mon, int ret; if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -2557,8 +2557,8 @@ int qemuMonitorDelDevice(qemuMonitorPtr mon, int ret; if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -2580,8 +2580,8 @@ int qemuMonitorAddDeviceWithFd(qemuMonitorPtr mon, int ret; if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -2614,8 +2614,8 @@ int qemuMonitorAddDrive(qemuMonitorPtr mon, int ret; if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -2635,8 +2635,8 @@ int qemuMonitorSetDrivePassphrase(qemuMonitorPtr mon, int ret; if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -2654,8 +2654,8 @@ int qemuMonitorCreateSnapshot(qemuMonitorPtr mon, const char *name) VIR_DEBUG("mon=%p, name=%s",mon,name); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -2673,8 +2673,8 @@ int qemuMonitorLoadSnapshot(qemuMonitorPtr mon, const char *name) VIR_DEBUG("mon=%p, name=%s",mon,name); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -2692,8 +2692,8 @@ int qemuMonitorDeleteSnapshot(qemuMonitorPtr mon, const char *name) VIR_DEBUG("mon=%p, name=%s",mon,name); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -2718,8 +2718,8 @@ qemuMonitorDiskSnapshot(qemuMonitorPtr mon, virJSONValuePtr actions, mon, actions, device, file, format, reuse); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -2728,8 +2728,8 @@ qemuMonitorDiskSnapshot(qemuMonitorPtr mon, virJSONValuePtr actions, reuse); } else { if (actions || STRNEQ(format, "qcow2") || reuse) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("text monitor lacks several snapshot features")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("text monitor lacks several snapshot features")); return -1; } ret = qemuMonitorTextDiskSnapshot(mon, device, file); @@ -2748,8 +2748,8 @@ qemuMonitorTransaction(qemuMonitorPtr mon, virJSONValuePtr actions) if (mon->json) ret = qemuMonitorJSONTransaction(mon, actions); else - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("transaction requires JSON monitor")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("transaction requires JSON monitor")); return ret; } @@ -2808,8 +2808,8 @@ int qemuMonitorScreendump(qemuMonitorPtr mon, VIR_DEBUG("mon=%p, file=%s", mon, file); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG,"%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG,"%s", + _("monitor must not be NULL")); return -1; } @@ -2839,9 +2839,9 @@ int qemuMonitorBlockJob(qemuMonitorPtr mon, /* Convert bandwidth MiB to bytes */ speed = bandwidth; if (speed > ULLONG_MAX / 1024 / 1024) { - qemuReportError(VIR_ERR_OVERFLOW, - _("bandwidth must be less than %llu"), - ULLONG_MAX / 1024 / 1024); + virReportError(VIR_ERR_OVERFLOW, + _("bandwidth must be less than %llu"), + ULLONG_MAX / 1024 / 1024); return -1; } speed <<= 20; @@ -2850,8 +2850,8 @@ int qemuMonitorBlockJob(qemuMonitorPtr mon, ret = qemuMonitorJSONBlockJob(mon, device, base, speed, info, mode, modern); else - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("block jobs require JSON monitor")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("block jobs require JSON monitor")); return ret; } @@ -2950,8 +2950,8 @@ int qemuMonitorOpenGraphics(qemuMonitorPtr mon, int ret; if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } @@ -2976,14 +2976,14 @@ int qemuMonitorSystemWakeup(qemuMonitorPtr mon) VIR_DEBUG("mon=%p", mon); if (!mon) { - qemuReportError(VIR_ERR_INVALID_ARG, "%s", - _("monitor must not be NULL")); + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("monitor must not be NULL")); return -1; } if (!mon->json) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("JSON monitor is required")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("JSON monitor is required")); return -1; } diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index a99bf60..5c16284 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -147,8 +147,8 @@ qemuMonitorJSONIOProcessLine(qemuMonitorPtr mon, goto cleanup; if (obj->type != VIR_JSON_TYPE_OBJECT) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Parsed JSON reply '%s' isn't an object"), line); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Parsed JSON reply '%s' isn't an object"), line); goto cleanup; } @@ -168,12 +168,12 @@ qemuMonitorJSONIOProcessLine(qemuMonitorPtr mon, obj = NULL; ret = 0; } else { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Unexpected JSON reply '%s'"), line); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Unexpected JSON reply '%s'"), line); } } else { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Unknown JSON reply '%s'"), line); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Unknown JSON reply '%s'"), line); } cleanup: @@ -237,8 +237,8 @@ qemuMonitorJSONCommandWithFd(qemuMonitorPtr mon, if (!(id = qemuMonitorNextCommandID(mon))) goto cleanup; if (virJSONValueObjectAppendString(cmd, "id", id) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Unable to append command 'id' string")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to append command 'id' string")); goto cleanup; } } @@ -264,8 +264,8 @@ qemuMonitorJSONCommandWithFd(qemuMonitorPtr mon, if (ret == 0) { if (!msg.rxObject) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Missing monitor reply object")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Missing monitor reply object")); ret = -1; } else { *reply = msg.rxObject; @@ -337,14 +337,14 @@ qemuMonitorJSONCheckError(virJSONValuePtr cmd, /* Only send the user the command name + friendly error */ if (!error) - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unable to execute QEMU command '%s'"), - qemuMonitorJSONCommandName(cmd)); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unable to execute QEMU command '%s'"), + qemuMonitorJSONCommandName(cmd)); else - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unable to execute QEMU command '%s': %s"), - qemuMonitorJSONCommandName(cmd), - qemuMonitorJSONStringifyError(error)); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unable to execute QEMU command '%s': %s"), + qemuMonitorJSONCommandName(cmd), + qemuMonitorJSONStringifyError(error)); VIR_FREE(cmdstr); VIR_FREE(replystr); @@ -355,9 +355,9 @@ qemuMonitorJSONCheckError(virJSONValuePtr cmd, VIR_DEBUG("Neither 'return' nor 'error' is set in the JSON reply %s: %s", cmdstr, replystr); - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unable to execute QEMU command '%s'"), - qemuMonitorJSONCommandName(cmd)); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unable to execute QEMU command '%s'"), + qemuMonitorJSONCommandName(cmd)); VIR_FREE(cmdstr); VIR_FREE(replystr); return -1; @@ -415,9 +415,9 @@ qemuMonitorJSONMakeCommandRaw(bool wrap, const char *cmdname, ...) char type; if (strlen(key) < 3) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("argument key '%s' is too short, missing type prefix"), - key); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("argument key '%s' is too short, missing type prefix"), + key); goto error; } @@ -434,9 +434,9 @@ qemuMonitorJSONMakeCommandRaw(bool wrap, const char *cmdname, ...) case 's': { char *val = va_arg(args, char *); if (!val) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("argument key '%s' must not have null value"), - key); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("argument key '%s' must not have null value"), + key); goto error; } ret = virJSONValueObjectAppendString(jargs, key, val); @@ -478,8 +478,8 @@ qemuMonitorJSONMakeCommandRaw(bool wrap, const char *cmdname, ...) ret = virJSONValueObjectAppend(jargs, key, val); } break; default: - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unsupported data type '%c' for arg '%s'"), type, key - 2); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unsupported data type '%c' for arg '%s'"), type, key - 2); goto error; } if (ret < 0) @@ -538,8 +538,8 @@ qemuMonitorJSONKeywordStringToJSON(const char *str, const char *firstkeyword) for (i = 0 ; i < nkeywords ; i++) { if (values[i] == NULL) { if (i != 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected empty keyword in %s"), str); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unexpected empty keyword in %s"), str); goto error; } else { /* This 3rd arg isn't a typo - the way the parser works is @@ -912,8 +912,8 @@ qemuMonitorJSONHumanCommandWithFd(qemuMonitorPtr mon, goto cleanup; if (!(obj = virJSONValueObjectGet(reply, "return"))) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("human monitor command was missing return data")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("human monitor command was missing return data")); goto cleanup; } @@ -1153,14 +1153,14 @@ qemuMonitorJSONGetStatus(qemuMonitorPtr mon, ret = -1; if (!(data = virJSONValueObjectGet(reply, "return"))) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("query-status reply was missing return data")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("query-status reply was missing return data")); goto cleanup; } if (virJSONValueObjectGetBoolean(data, "running", running) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("query-status reply was missing running state")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("query-status reply was missing running state")); goto cleanup; } @@ -1256,20 +1256,20 @@ qemuMonitorJSONExtractCPUInfo(virJSONValuePtr reply, int ncpus; if (!(data = virJSONValueObjectGet(reply, "return"))) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("cpu reply was missing return data")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("cpu reply was missing return data")); goto cleanup; } if (data->type != VIR_JSON_TYPE_ARRAY) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("cpu information was not an array")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("cpu information was not an array")); goto cleanup; } if ((ncpus = virJSONValueArraySize(data)) <= 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("cpu information was empty")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("cpu information was empty")); goto cleanup; } @@ -1283,14 +1283,14 @@ qemuMonitorJSONExtractCPUInfo(virJSONValuePtr reply, int cpu; int thread; if (!entry) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("character device information was missing array element")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("character device information was missing array element")); goto cleanup; } if (virJSONValueObjectGetNumberInt(entry, "CPU", &cpu) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("cpu information was missing cpu number")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("cpu information was missing cpu number")); goto cleanup; } @@ -1302,9 +1302,9 @@ qemuMonitorJSONExtractCPUInfo(virJSONValuePtr reply, } if (cpu != i) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected cpu index %d expecting %d"), - i, cpu); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unexpected cpu index %d expecting %d"), + i, cpu); goto cleanup; } @@ -1371,15 +1371,15 @@ int qemuMonitorJSONGetVirtType(qemuMonitorPtr mon, bool val = false; if (!(data = virJSONValueObjectGet(reply, "return"))) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("info kvm reply was missing return data")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("info kvm reply was missing return data")); ret = -1; goto cleanup; } if (virJSONValueObjectGetBoolean(data, "enabled", &val) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("info kvm reply missing 'running' field")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("info kvm reply missing 'running' field")); ret = -1; goto cleanup; } @@ -1428,15 +1428,15 @@ int qemuMonitorJSONGetBalloonInfo(qemuMonitorPtr mon, unsigned long long mem; if (!(data = virJSONValueObjectGet(reply, "return"))) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("info balloon reply was missing return data")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("info balloon reply was missing return data")); ret = -1; goto cleanup; } if (virJSONValueObjectGetNumberUlong(data, "actual", &mem) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("info balloon reply was missing balloon data")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("info balloon reply was missing balloon data")); ret = -1; goto cleanup; } @@ -1483,16 +1483,16 @@ int qemuMonitorJSONGetMemoryStats(qemuMonitorPtr mon, unsigned long long mem; if (!(data = virJSONValueObjectGet(reply, "return"))) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("info balloon reply was missing return data")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("info balloon reply was missing return data")); ret = -1; goto cleanup; } if (virJSONValueObjectHasKey(data, "actual") && (got < nr_stats)) { if (virJSONValueObjectGetNumberUlong(data, "actual", &mem) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("info balloon reply was missing balloon actual")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("info balloon reply was missing balloon actual")); ret = -1; goto cleanup; } @@ -1503,8 +1503,8 @@ int qemuMonitorJSONGetMemoryStats(qemuMonitorPtr mon, if (virJSONValueObjectHasKey(data, "mem_swapped_in") && (got < nr_stats)) { if (virJSONValueObjectGetNumberUlong(data, "mem_swapped_in", &mem) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("info balloon reply was missing balloon mem_swapped_in")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("info balloon reply was missing balloon mem_swapped_in")); ret = -1; goto cleanup; } @@ -1514,8 +1514,8 @@ int qemuMonitorJSONGetMemoryStats(qemuMonitorPtr mon, } if (virJSONValueObjectHasKey(data, "mem_swapped_out") && (got < nr_stats)) { if (virJSONValueObjectGetNumberUlong(data, "mem_swapped_out", &mem) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("info balloon reply was missing balloon mem_swapped_out")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("info balloon reply was missing balloon mem_swapped_out")); ret = -1; goto cleanup; } @@ -1525,8 +1525,8 @@ int qemuMonitorJSONGetMemoryStats(qemuMonitorPtr mon, } if (virJSONValueObjectHasKey(data, "major_page_faults") && (got < nr_stats)) { if (virJSONValueObjectGetNumberUlong(data, "major_page_faults", &mem) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("info balloon reply was missing balloon major_page_faults")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("info balloon reply was missing balloon major_page_faults")); ret = -1; goto cleanup; } @@ -1536,8 +1536,8 @@ int qemuMonitorJSONGetMemoryStats(qemuMonitorPtr mon, } if (virJSONValueObjectHasKey(data, "minor_page_faults") && (got < nr_stats)) { if (virJSONValueObjectGetNumberUlong(data, "minor_page_faults", &mem) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("info balloon reply was missing balloon minor_page_faults")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("info balloon reply was missing balloon minor_page_faults")); ret = -1; goto cleanup; } @@ -1547,8 +1547,8 @@ int qemuMonitorJSONGetMemoryStats(qemuMonitorPtr mon, } if (virJSONValueObjectHasKey(data, "free_mem") && (got < nr_stats)) { if (virJSONValueObjectGetNumberUlong(data, "free_mem", &mem) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("info balloon reply was missing balloon free_mem")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("info balloon reply was missing balloon free_mem")); ret = -1; goto cleanup; } @@ -1558,8 +1558,8 @@ int qemuMonitorJSONGetMemoryStats(qemuMonitorPtr mon, } if (virJSONValueObjectHasKey(data, "total_mem") && (got < nr_stats)) { if (virJSONValueObjectGetNumberUlong(data, "total_mem", &mem) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("info balloon reply was missing balloon total_mem")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("info balloon reply was missing balloon total_mem")); ret = -1; goto cleanup; } @@ -1604,7 +1604,7 @@ int qemuMonitorJSONGetBlockInfo(qemuMonitorPtr mon, devices = virJSONValueObjectGet(reply, "return"); if (!devices || devices->type != VIR_JSON_TYPE_ARRAY) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("block info reply was missing device list")); goto cleanup; } @@ -1616,14 +1616,14 @@ int qemuMonitorJSONGetBlockInfo(qemuMonitorPtr mon, const char *status; if (!dev || dev->type != VIR_JSON_TYPE_OBJECT) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("block info device entry was not in expected format")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("block info device entry was not in expected format")); goto cleanup; } if ((thisdev = virJSONValueObjectGetString(dev, "device")) == NULL) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("block info device entry was not in expected format")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("block info device entry was not in expected format")); goto cleanup; } @@ -1641,16 +1641,16 @@ int qemuMonitorJSONGetBlockInfo(qemuMonitorPtr mon, } if (virJSONValueObjectGetBoolean(dev, "removable", &info->removable) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot read %s value"), - "removable"); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot read %s value"), + "removable"); goto cleanup; } if (virJSONValueObjectGetBoolean(dev, "locked", &info->locked) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot read %s value"), - "locked"); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot read %s value"), + "locked"); goto cleanup; } @@ -1722,8 +1722,8 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon, devices = virJSONValueObjectGet(reply, "return"); if (!devices || devices->type != VIR_JSON_TYPE_ARRAY) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("blockstats reply was missing device list")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("blockstats reply was missing device list")); goto cleanup; } @@ -1732,14 +1732,14 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon, virJSONValuePtr stats; const char *thisdev; if (!dev || dev->type != VIR_JSON_TYPE_OBJECT) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("blockstats device entry was not in expected format")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("blockstats device entry was not in expected format")); goto cleanup; } if ((thisdev = virJSONValueObjectGetString(dev, "device")) == NULL) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("blockstats device entry was not in expected format")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("blockstats device entry was not in expected format")); goto cleanup; } @@ -1756,20 +1756,20 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon, found = 1; if ((stats = virJSONValueObjectGet(dev, "stats")) == NULL || stats->type != VIR_JSON_TYPE_OBJECT) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("blockstats stats entry was not in expected format")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("blockstats stats entry was not in expected format")); goto cleanup; } if (virJSONValueObjectGetNumberLong(stats, "rd_bytes", rd_bytes) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot read %s statistic"), - "rd_bytes"); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot read %s statistic"), + "rd_bytes"); goto cleanup; } if (virJSONValueObjectGetNumberLong(stats, "rd_operations", rd_req) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot read %s statistic"), + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot read %s statistic"), "rd_operations"); goto cleanup; } @@ -1777,55 +1777,55 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon, virJSONValueObjectHasKey(stats, "rd_total_time_ns") && (virJSONValueObjectGetNumberLong(stats, "rd_total_time_ns", rd_total_times) < 0)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot read %s statistic"), - "rd_total_time_ns"); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot read %s statistic"), + "rd_total_time_ns"); goto cleanup; } if (virJSONValueObjectGetNumberLong(stats, "wr_bytes", wr_bytes) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot read %s statistic"), - "wr_bytes"); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot read %s statistic"), + "wr_bytes"); goto cleanup; } if (virJSONValueObjectGetNumberLong(stats, "wr_operations", wr_req) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot read %s statistic"), - "wr_operations"); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot read %s statistic"), + "wr_operations"); goto cleanup; } if (wr_total_times && virJSONValueObjectHasKey(stats, "wr_total_time_ns") && (virJSONValueObjectGetNumberLong(stats, "wr_total_time_ns", wr_total_times) < 0)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot read %s statistic"), - "wr_total_time_ns"); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot read %s statistic"), + "wr_total_time_ns"); goto cleanup; } if (flush_req && virJSONValueObjectHasKey(stats, "flush_operations") && (virJSONValueObjectGetNumberLong(stats, "flush_operations", flush_req) < 0)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot read %s statistic"), - "flush_operations"); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot read %s statistic"), + "flush_operations"); goto cleanup; } if (flush_total_times && virJSONValueObjectHasKey(stats, "flush_total_time_ns") && (virJSONValueObjectGetNumberLong(stats, "flush_total_time_ns", flush_total_times) < 0)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot read %s statistic"), - "flush_total_time_ns"); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot read %s statistic"), + "flush_total_time_ns"); goto cleanup; } } if (!found) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot find statistics for device '%s'"), dev_name); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot find statistics for device '%s'"), dev_name); goto cleanup; } ret = 0; @@ -1861,23 +1861,23 @@ int qemuMonitorJSONGetBlockStatsParamsNumber(qemuMonitorPtr mon, devices = virJSONValueObjectGet(reply, "return"); if (!devices || devices->type != VIR_JSON_TYPE_ARRAY) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("blockstats reply was missing device list")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("blockstats reply was missing device list")); goto cleanup; } dev = virJSONValueArrayGet(devices, 0); if (!dev || dev->type != VIR_JSON_TYPE_OBJECT) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("blockstats device entry was not in expected format")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("blockstats device entry was not in expected format")); goto cleanup; } if ((stats = virJSONValueObjectGet(dev, "stats")) == NULL || stats->type != VIR_JSON_TYPE_OBJECT) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("blockstats stats entry was not in expected format")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("blockstats stats entry was not in expected format")); goto cleanup; } @@ -1936,8 +1936,8 @@ int qemuMonitorJSONGetBlockExtent(qemuMonitorPtr mon, devices = virJSONValueObjectGet(reply, "return"); if (!devices || devices->type != VIR_JSON_TYPE_ARRAY) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("blockstats reply was missing device list")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("blockstats reply was missing device list")); goto cleanup; } @@ -1947,14 +1947,14 @@ int qemuMonitorJSONGetBlockExtent(qemuMonitorPtr mon, virJSONValuePtr parent; const char *thisdev; if (!dev || dev->type != VIR_JSON_TYPE_OBJECT) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("blockstats device entry was not in expected format")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("blockstats device entry was not in expected format")); goto cleanup; } if ((thisdev = virJSONValueObjectGetString(dev, "device")) == NULL) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("blockstats device entry was not in expected format")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("blockstats device entry was not in expected format")); goto cleanup; } @@ -1971,29 +1971,29 @@ int qemuMonitorJSONGetBlockExtent(qemuMonitorPtr mon, found = 1; if ((parent = virJSONValueObjectGet(dev, "parent")) == NULL || parent->type != VIR_JSON_TYPE_OBJECT) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("blockstats parent entry was not in expected format")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("blockstats parent entry was not in expected format")); goto cleanup; } if ((stats = virJSONValueObjectGet(parent, "stats")) == NULL || stats->type != VIR_JSON_TYPE_OBJECT) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("blockstats stats entry was not in expected format")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("blockstats stats entry was not in expected format")); goto cleanup; } if (virJSONValueObjectGetNumberUlong(stats, "wr_highest_offset", extent) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot read %s statistic"), - "wr_highest_offset"); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot read %s statistic"), + "wr_highest_offset"); goto cleanup; } } if (!found) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot find statistics for device '%s'"), dev_name); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot find statistics for device '%s'"), dev_name); goto cleanup; } ret = 0; @@ -2373,48 +2373,48 @@ qemuMonitorJSONGetMigrationStatusReply(virJSONValuePtr reply, unsigned long long t; if (!(ret = virJSONValueObjectGet(reply, "return"))) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("info migration reply was missing return data")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("info migration reply was missing return data")); return -1; } if (!(statusstr = virJSONValueObjectGetString(ret, "status"))) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("info migration reply was missing return status")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("info migration reply was missing return status")); return -1; } if ((*status = qemuMonitorMigrationStatusTypeFromString(statusstr)) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected migration status in %s"), statusstr); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unexpected migration status in %s"), statusstr); return -1; } if (*status == QEMU_MONITOR_MIGRATION_STATUS_ACTIVE) { virJSONValuePtr ram = virJSONValueObjectGet(ret, "ram"); if (!ram) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("migration was active, but no RAM info was set")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("migration was active, but no RAM info was set")); return -1; } if (virJSONValueObjectGetNumberUlong(ram, "transferred", transferred) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("migration was active, but RAM 'transferred' " - "data was missing")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("migration was active, but RAM 'transferred' " + "data was missing")); return -1; } if (virJSONValueObjectGetNumberUlong(ram, "remaining", remaining) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("migration was active, but RAM 'remaining' " - "data was missing")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("migration was active, but RAM 'remaining' " + "data was missing")); return -1; } if (virJSONValueObjectGetNumberUlong(ram, "total", total) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("migration was active, but RAM 'total' " - "data was missing")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("migration was active, but RAM 'total' " + "data was missing")); return -1; } @@ -2424,23 +2424,23 @@ qemuMonitorJSONGetMigrationStatusReply(virJSONValuePtr reply, } if (virJSONValueObjectGetNumberUlong(disk, "transferred", &t) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("disk migration was active, but 'transferred' " - "data was missing")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("disk migration was active, but 'transferred' " + "data was missing")); return -1; } *transferred += t; if (virJSONValueObjectGetNumberUlong(disk, "remaining", &t) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("disk migration was active, but 'remaining' " - "data was missing")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("disk migration was active, but 'remaining' " + "data was missing")); return -1; } *remaining += t; if (virJSONValueObjectGetNumberUlong(disk, "total", &t) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("disk migration was active, but 'total' " - "data was missing")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("disk migration was active, but 'total' " + "data was missing")); return -1; } *total += t; @@ -2601,8 +2601,8 @@ int qemuMonitorJSONGraphicsRelocate(qemuMonitorPtr mon, int qemuMonitorJSONAddUSBDisk(qemuMonitorPtr mon ATTRIBUTE_UNUSED, const char *path ATTRIBUTE_UNUSED) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("usb_add not supported in JSON mode")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("usb_add not supported in JSON mode")); return -1; } @@ -2611,8 +2611,8 @@ int qemuMonitorJSONAddUSBDeviceExact(qemuMonitorPtr mon ATTRIBUTE_UNUSED, int bus ATTRIBUTE_UNUSED, int dev ATTRIBUTE_UNUSED) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("usb_add not supported in JSON mode")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("usb_add not supported in JSON mode")); return -1; } @@ -2621,8 +2621,8 @@ int qemuMonitorJSONAddUSBDeviceMatch(qemuMonitorPtr mon ATTRIBUTE_UNUSED, int vendor ATTRIBUTE_UNUSED, int product ATTRIBUTE_UNUSED) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("usb_add not supported in JSON mode")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("usb_add not supported in JSON mode")); return -1; } @@ -2631,8 +2631,8 @@ int qemuMonitorJSONAddPCIHostDevice(qemuMonitorPtr mon ATTRIBUTE_UNUSED, virDomainDevicePCIAddress *hostAddr ATTRIBUTE_UNUSED, virDomainDevicePCIAddress *guestAddr ATTRIBUTE_UNUSED) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("pci_add not supported in JSON mode")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("pci_add not supported in JSON mode")); return -1; } @@ -2642,8 +2642,8 @@ int qemuMonitorJSONAddPCIDisk(qemuMonitorPtr mon ATTRIBUTE_UNUSED, const char *bus ATTRIBUTE_UNUSED, virDomainDevicePCIAddress *guestAddr ATTRIBUTE_UNUSED) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("pci_add not supported in JSON mode")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("pci_add not supported in JSON mode")); return -1; } @@ -2652,8 +2652,8 @@ int qemuMonitorJSONAddPCINetwork(qemuMonitorPtr mon ATTRIBUTE_UNUSED, const char *nicstr ATTRIBUTE_UNUSED, virDomainDevicePCIAddress *guestAddr ATTRIBUTE_UNUSED) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("pci_add not supported in JSON mode")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("pci_add not supported in JSON mode")); return -1; } @@ -2661,8 +2661,8 @@ int qemuMonitorJSONAddPCINetwork(qemuMonitorPtr mon ATTRIBUTE_UNUSED, int qemuMonitorJSONRemovePCIDevice(qemuMonitorPtr mon ATTRIBUTE_UNUSED, virDomainDevicePCIAddress *guestAddr ATTRIBUTE_UNUSED) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("pci_del not supported in JSON mode")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("pci_del not supported in JSON mode")); return -1; } @@ -2833,14 +2833,14 @@ static int qemuMonitorJSONExtractPtyPaths(virJSONValuePtr reply, int i; if (!(data = virJSONValueObjectGet(reply, "return"))) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("character device reply was missing return data")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("character device reply was missing return data")); goto cleanup; } if (data->type != VIR_JSON_TYPE_ARRAY) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("character device information was not an array")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("character device information was not an array")); goto cleanup; } @@ -2849,20 +2849,20 @@ static int qemuMonitorJSONExtractPtyPaths(virJSONValuePtr reply, const char *type; const char *id; if (!entry) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("character device information was missing array element")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("character device information was missing array element")); goto cleanup; } if (!(type = virJSONValueObjectGetString(entry, "filename"))) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("character device information was missing filename")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("character device information was missing filename")); goto cleanup; } if (!(id = virJSONValueObjectGetString(entry, "label"))) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("character device information was missing filename")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("character device information was missing filename")); goto cleanup; } @@ -2874,8 +2874,8 @@ static int qemuMonitorJSONExtractPtyPaths(virJSONValuePtr reply, } if (virHashAddEntry(paths, id, path) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("failed to save chardev path '%s'"), path); + virReportError(VIR_ERR_OPERATION_FAILED, + _("failed to save chardev path '%s'"), path); VIR_FREE(path); goto cleanup; } @@ -2918,8 +2918,8 @@ int qemuMonitorJSONAttachPCIDiskController(qemuMonitorPtr mon ATTRIBUTE_UNUSED, const char *bus ATTRIBUTE_UNUSED, virDomainDevicePCIAddress *guestAddr ATTRIBUTE_UNUSED) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("pci_add not supported in JSON mode")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("pci_add not supported in JSON mode")); return -1; } @@ -2932,20 +2932,20 @@ qemuMonitorJSONGetGuestDriveAddress(virJSONValuePtr reply, addr = virJSONValueObjectGet(reply, "return"); if (!addr || addr->type != VIR_JSON_TYPE_OBJECT) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("drive_add reply was missing device address")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("drive_add reply was missing device address")); return -1; } if (virJSONValueObjectGetNumberUint(addr, "bus", &driveAddr->bus) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("drive_add reply was missing device bus number")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("drive_add reply was missing device bus number")); return -1; } if (virJSONValueObjectGetNumberUint(addr, "unit", &driveAddr->unit) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("drive_add reply was missing device unit number")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("drive_add reply was missing device unit number")); return -1; } @@ -2995,8 +2995,8 @@ int qemuMonitorJSONAttachDrive(qemuMonitorPtr mon, int qemuMonitorJSONGetAllPCIAddresses(qemuMonitorPtr mon ATTRIBUTE_UNUSED, qemuMonitorPCIAddress **addrs ATTRIBUTE_UNUSED) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("query-pci not supported in JSON mode")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("query-pci not supported in JSON mode")); return -1; } @@ -3341,9 +3341,9 @@ int qemuMonitorJSONArbitraryCommand(qemuMonitorPtr mon, if (hmp) { if (!qemuMonitorCheckHMP(mon, NULL)) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("HMP passthrough is not supported by qemu" - " process; only QMP commands can be used")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("HMP passthrough is not supported by qemu" + " process; only QMP commands can be used")); return -1; } return qemuMonitorJSONHumanCommandWithFd(mon, cmd_str, -1, reply_str); @@ -3441,8 +3441,8 @@ static int qemuMonitorJSONGetBlockJobInfoOne(virJSONValuePtr entry, unsigned long long speed_bytes; if ((this_dev = virJSONValueObjectGetString(entry, "device")) == NULL) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("entry was missing 'device'")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("entry was missing 'device'")); return -1; } if (!STREQ(this_dev, device)) @@ -3450,8 +3450,8 @@ static int qemuMonitorJSONGetBlockJobInfoOne(virJSONValuePtr entry, type = virJSONValueObjectGetString(entry, "type"); if (!type) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("entry was missing 'type'")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("entry was missing 'type'")); return -1; } if (STREQ(type, "stream")) @@ -3460,21 +3460,21 @@ static int qemuMonitorJSONGetBlockJobInfoOne(virJSONValuePtr entry, info->type = VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN; if (virJSONValueObjectGetNumberUlong(entry, "speed", &speed_bytes) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("entry was missing 'speed'")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("entry was missing 'speed'")); return -1; } info->bandwidth = speed_bytes / 1024ULL / 1024ULL; if (virJSONValueObjectGetNumberUlong(entry, "offset", &info->cur) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("entry was missing 'offset'")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("entry was missing 'offset'")); return -1; } if (virJSONValueObjectGetNumberUlong(entry, "len", &info->end) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("entry was missing 'len'")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("entry was missing 'len'")); return -1; } return 0; @@ -3495,28 +3495,28 @@ static int qemuMonitorJSONGetBlockJobInfo(virJSONValuePtr reply, return -1; if ((data = virJSONValueObjectGet(reply, "return")) == NULL) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("reply was missing return data")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("reply was missing return data")); return -1; } if (data->type != VIR_JSON_TYPE_ARRAY) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("unrecognized format of block job information")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("unrecognized format of block job information")); return -1; } if ((nr_results = virJSONValueArraySize(data)) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("unable to determine array size")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("unable to determine array size")); return -1; } for (i = 0; i < nr_results; i++) { virJSONValuePtr entry = virJSONValueArrayGet(data, i); if (!entry) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("missing array element")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("missing array element")); return -1; } if (qemuMonitorJSONGetBlockJobInfoOne(entry, device, info) == 0) @@ -3543,14 +3543,14 @@ qemuMonitorJSONBlockJob(qemuMonitorPtr mon, const char *cmd_name = NULL; if (base && (mode != BLOCK_JOB_PULL || !modern)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("only modern block pull supports base: %s"), base); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("only modern block pull supports base: %s"), base); return -1; } if (speed && mode == BLOCK_JOB_PULL && !modern) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("only modern block pull supports speed: %llu"), - speed); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("only modern block pull supports speed: %llu"), + speed); return -1; } @@ -3593,22 +3593,22 @@ qemuMonitorJSONBlockJob(qemuMonitorPtr mon, if (ret == 0 && virJSONValueObjectHasKey(reply, "error")) { ret = -1; if (qemuMonitorJSONHasError(reply, "DeviceNotActive")) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - _("No active operation on device: %s"), - device); + virReportError(VIR_ERR_OPERATION_INVALID, + _("No active operation on device: %s"), + device); } else if (qemuMonitorJSONHasError(reply, "DeviceInUse")){ - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("Device %s in use"), device); + virReportError(VIR_ERR_OPERATION_FAILED, + _("Device %s in use"), device); } else if (qemuMonitorJSONHasError(reply, "NotSupported")) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - _("Operation is not supported for device: %s"), - device); + virReportError(VIR_ERR_OPERATION_INVALID, + _("Operation is not supported for device: %s"), + device); } else if (qemuMonitorJSONHasError(reply, "CommandNotFound")) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - _("Command '%s' is not found"), cmd_name); + virReportError(VIR_ERR_OPERATION_INVALID, + _("Command '%s' is not found"), cmd_name); } else { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Unexpected error")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unexpected error")); } } @@ -3661,8 +3661,8 @@ qemuMonitorJSONBlockIoThrottleInfo(virJSONValuePtr result, io_throttle = virJSONValueObjectGet(result, "return"); if (!io_throttle || io_throttle->type != VIR_JSON_TYPE_ARRAY) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _(" block_io_throttle reply was missing device list")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _(" block_io_throttle reply was missing device list")); goto cleanup; } @@ -3672,14 +3672,14 @@ qemuMonitorJSONBlockIoThrottleInfo(virJSONValuePtr result, const char *current_dev; if (!temp_dev || temp_dev->type != VIR_JSON_TYPE_OBJECT) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("block_io_throttle device entry was not in expected format")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("block_io_throttle device entry was not in expected format")); goto cleanup; } if ((current_dev = virJSONValueObjectGetString(temp_dev, "device")) == NULL) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("block_io_throttle device entry was not in expected format")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("block_io_throttle device entry was not in expected format")); goto cleanup; } @@ -3692,53 +3692,53 @@ qemuMonitorJSONBlockIoThrottleInfo(virJSONValuePtr result, found = 1; if ((inserted = virJSONValueObjectGet(temp_dev, "inserted")) == NULL || inserted->type != VIR_JSON_TYPE_OBJECT) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("block_io_throttle inserted entry was not in expected format")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("block_io_throttle inserted entry was not in expected format")); goto cleanup; } if (virJSONValueObjectGetNumberUlong(inserted, "bps", &reply->total_bytes_sec) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("cannot read total_bytes_sec")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("cannot read total_bytes_sec")); goto cleanup; } if (virJSONValueObjectGetNumberUlong(inserted, "bps_rd", &reply->read_bytes_sec) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("cannot read read_bytes_sec")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("cannot read read_bytes_sec")); goto cleanup; } if (virJSONValueObjectGetNumberUlong(inserted, "bps_wr", &reply->write_bytes_sec) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("cannot read write_bytes_sec")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("cannot read write_bytes_sec")); goto cleanup; } if (virJSONValueObjectGetNumberUlong(inserted, "iops", &reply->total_iops_sec) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("cannot read total_iops_sec")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("cannot read total_iops_sec")); goto cleanup; } if (virJSONValueObjectGetNumberUlong(inserted, "iops_rd", &reply->read_iops_sec) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("cannot read read_iops_sec")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("cannot read read_iops_sec")); goto cleanup; } if (virJSONValueObjectGetNumberUlong(inserted, "iops_wr", &reply->write_iops_sec) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("cannot read write_iops_sec")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("cannot read write_iops_sec")); goto cleanup; } break; } if (!found) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot find throttling info for device '%s'"), - device); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot find throttling info for device '%s'"), + device); goto cleanup; } ret = 0; @@ -3771,14 +3771,14 @@ int qemuMonitorJSONSetBlockIoThrottle(qemuMonitorPtr mon, if (ret == 0 && virJSONValueObjectHasKey(result, "error")) { if (qemuMonitorJSONHasError(result, "DeviceNotActive")) - qemuReportError(VIR_ERR_OPERATION_INVALID, - _("No active operation on device: %s"), device); + virReportError(VIR_ERR_OPERATION_INVALID, + _("No active operation on device: %s"), device); else if (qemuMonitorJSONHasError(result, "NotSupported")) - qemuReportError(VIR_ERR_OPERATION_INVALID, - _("Operation is not supported for device: %s"), device); + virReportError(VIR_ERR_OPERATION_INVALID, + _("Operation is not supported for device: %s"), device); else - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Unexpected error")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unexpected error")); ret = -1; } @@ -3804,14 +3804,14 @@ int qemuMonitorJSONGetBlockIoThrottle(qemuMonitorPtr mon, if (ret == 0 && virJSONValueObjectHasKey(result, "error")) { if (qemuMonitorJSONHasError(result, "DeviceNotActive")) - qemuReportError(VIR_ERR_OPERATION_INVALID, - _("No active operation on device: %s"), device); + virReportError(VIR_ERR_OPERATION_INVALID, + _("No active operation on device: %s"), device); else if (qemuMonitorJSONHasError(result, "NotSupported")) - qemuReportError(VIR_ERR_OPERATION_INVALID, - _("Operation is not supported for device: %s"), device); + virReportError(VIR_ERR_OPERATION_INVALID, + _("Operation is not supported for device: %s"), device); else - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Unexpected error")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unexpected error")); ret = -1; } diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c index 086b06b..c7de172 100644 --- a/src/qemu/qemu_monitor_text.c +++ b/src/qemu/qemu_monitor_text.c @@ -173,8 +173,8 @@ int qemuMonitorTextIOProcess(qemuMonitorPtr mon ATTRIBUTE_UNUSED, /* Handled, so skip forward over password prompt */ start = passwd; } else { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Password request seen, but no handler available")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Password request seen, but no handler available")); return -1; } } @@ -321,9 +321,9 @@ qemuMonitorSendDiskPassphrase(qemuMonitorPtr mon, pathStart = strstr(data, DISK_ENCRYPTION_PREFIX); pathEnd = strstr(data, DISK_ENCRYPTION_POSTFIX); if (!pathStart || !pathEnd || pathStart >= pathEnd) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to extract disk path from %s"), - data); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Unable to extract disk path from %s"), + data); return -1; } @@ -389,8 +389,8 @@ qemuMonitorTextStopCPUs(qemuMonitorPtr mon) { char *info; if (qemuMonitorHMPCommand(mon, "stop", &info) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("cannot stop CPU execution")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("cannot stop CPU execution")); return -1; } VIR_FREE(info); @@ -410,8 +410,8 @@ qemuMonitorTextGetStatus(qemuMonitorPtr mon, *reason = VIR_DOMAIN_PAUSED_UNKNOWN; if (qemuMonitorHMPCommand(mon, "info status", &reply) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("cannot get status info")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("cannot get status info")); return -1; } @@ -433,8 +433,8 @@ qemuMonitorTextGetStatus(qemuMonitorPtr mon, *reason = qemuMonitorVMStatusToPausedReason(status); *running = false; } else { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("unexpected reply from info status: %s"), reply); + virReportError(VIR_ERR_OPERATION_FAILED, + _("unexpected reply from info status: %s"), reply); goto cleanup; } @@ -450,8 +450,8 @@ int qemuMonitorTextSystemPowerdown(qemuMonitorPtr mon) { char *info; if (qemuMonitorHMPCommand(mon, "system_powerdown", &info) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("system shutdown operation failed")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("system shutdown operation failed")); return -1; } VIR_FREE(info); @@ -474,23 +474,23 @@ int qemuMonitorTextSetLink(qemuMonitorPtr mon, const char *name, enum virDomainN goto error; } if (qemuMonitorHMPCommand(mon, cmd, &info) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("set_link operation failed")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("set_link operation failed")); goto error; } /* check if set_link command is supported */ if (strstr(info, "\nunknown ")) { - qemuReportError(VIR_ERR_NO_SUPPORT, - "%s", - _("\'set_link\' not supported by this qemu")); + virReportError(VIR_ERR_NO_SUPPORT, + "%s", + _("\'set_link\' not supported by this qemu")); goto error; } /* check if qemu didn't reject device name */ if (strstr(info, "\nDevice ")) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("device name rejected")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("device name rejected")); goto error; } @@ -509,8 +509,8 @@ int qemuMonitorTextSystemReset(qemuMonitorPtr mon) { char *info; if (qemuMonitorHMPCommand(mon, "system_reset", &info) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("system reset operation failed")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("system reset operation failed")); return -1; } VIR_FREE(info); @@ -528,8 +528,8 @@ int qemuMonitorTextGetCPUInfo(qemuMonitorPtr mon, size_t ncpupids = 0; if (qemuMonitorHMPCommand(mon, "info cpus", &qemucpus) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("cannot run monitor command to fetch CPU thread info")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("cannot run monitor command to fetch CPU thread info")); return -1; } @@ -609,8 +609,8 @@ int qemuMonitorTextGetVirtType(qemuMonitorPtr mon, *virtType = VIR_DOMAIN_VIRT_QEMU; if (qemuMonitorHMPCommand(mon, "info kvm", &reply) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("could not query kvm status")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("could not query kvm status")); return -1; } @@ -716,8 +716,8 @@ int qemuMonitorTextGetBalloonInfo(qemuMonitorPtr mon, char *offset; if (qemuMonitorHMPCommand(mon, "info balloon", &reply) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("could not query memory balloon allocation")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("could not query memory balloon allocation")); return -1; } @@ -726,14 +726,14 @@ int qemuMonitorTextGetBalloonInfo(qemuMonitorPtr mon, struct _virDomainMemoryStat stats[1]; if (qemuMonitorParseBalloonInfo(offset, stats, 1) == 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected balloon information '%s'"), reply); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unexpected balloon information '%s'"), reply); goto cleanup; } if (stats[0].tag != VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected balloon information '%s'"), reply); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unexpected balloon information '%s'"), reply); goto cleanup; } @@ -760,8 +760,8 @@ int qemuMonitorTextGetMemoryStats(qemuMonitorPtr mon, char *offset; if (qemuMonitorHMPCommand(mon, "info balloon", &reply) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("could not query memory balloon statistics")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("could not query memory balloon statistics")); return -1; } @@ -787,15 +787,15 @@ int qemuMonitorTextGetBlockInfo(qemuMonitorPtr mon, int tmp; if (qemuMonitorHMPCommand(mon, "info block", &reply) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("info block command failed")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("info block command failed")); goto cleanup; } if (strstr(reply, "\ninfo ")) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", - _("info block not supported by this qemu")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", + _("info block not supported by this qemu")); goto cleanup; } @@ -906,8 +906,8 @@ int qemuMonitorTextGetBlockStatsInfo(qemuMonitorPtr mon, int devnamelen = strlen(dev_name); if (qemuMonitorHMPCommand (mon, "info blockstats", &info) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("'info blockstats' command failed")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("'info blockstats' command failed")); goto cleanup; } @@ -917,9 +917,9 @@ int qemuMonitorTextGetBlockStatsInfo(qemuMonitorPtr mon, * to detect if qemu supports the command. */ if (strstr(info, "\ninfo ")) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", - _("'info blockstats' not supported by this qemu")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", + _("'info blockstats' not supported by this qemu")); goto cleanup; } @@ -1016,8 +1016,8 @@ int qemuMonitorTextGetBlockStatsInfo(qemuMonitorPtr mon, } /* If we reach here then the device was not found. */ - qemuReportError (VIR_ERR_INVALID_ARG, - _("no stats found for device %s"), dev_name); + virReportError (VIR_ERR_INVALID_ARG, + _("no stats found for device %s"), dev_name); cleanup: VIR_FREE(info); @@ -1033,8 +1033,8 @@ int qemuMonitorTextGetBlockStatsParamsNumber(qemuMonitorPtr mon, const char *p, *eol; if (qemuMonitorHMPCommand (mon, "info blockstats", &info) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("'info blockstats' command failed")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("'info blockstats' command failed")); goto cleanup; } @@ -1044,9 +1044,9 @@ int qemuMonitorTextGetBlockStatsParamsNumber(qemuMonitorPtr mon, * to detect if qemu supports the command. */ if (strstr(info, "\ninfo ")) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", - _("'info blockstats' not supported by this qemu")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", + _("'info blockstats' not supported by this qemu")); goto cleanup; } @@ -1096,8 +1096,8 @@ int qemuMonitorTextGetBlockExtent(qemuMonitorPtr mon ATTRIBUTE_UNUSED, const char *dev_name ATTRIBUTE_UNUSED, unsigned long long *extent ATTRIBUTE_UNUSED) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("unable to query block extent with this QEMU")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("unable to query block extent with this QEMU")); return -1; } @@ -1117,8 +1117,8 @@ int qemuMonitorTextBlockResize(qemuMonitorPtr mon, } if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("failed to resize block")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("failed to resize block")); goto cleanup; } @@ -1173,8 +1173,8 @@ int qemuMonitorTextSetVNCPassword(qemuMonitorPtr mon, qemuMonitorSendVNCPassphrase, (char *)password, -1, &info) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("setting VNC password failed")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("setting VNC password failed")); return -1; } VIR_FREE(info); @@ -1198,8 +1198,8 @@ int qemuMonitorTextSetPassword(qemuMonitorPtr mon, } if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("setting password failed")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("setting password failed")); goto cleanup; } @@ -1232,8 +1232,8 @@ int qemuMonitorTextExpirePassword(qemuMonitorPtr mon, } if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("expiring password failed")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("expiring password failed")); goto cleanup; } @@ -1271,8 +1271,8 @@ int qemuMonitorTextSetBalloon(qemuMonitorPtr mon, } if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("could not balloon memory allocation")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("could not balloon memory allocation")); VIR_FREE(cmd); return -1; } @@ -1308,8 +1308,8 @@ int qemuMonitorTextSetCPU(qemuMonitorPtr mon, int cpu, int online) } if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("could not change CPU online status")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("could not change CPU online status")); VIR_FREE(cmd); return -1; } @@ -1343,8 +1343,8 @@ int qemuMonitorTextEjectMedia(qemuMonitorPtr mon, } if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("could not eject media on %s"), dev_name); + virReportError(VIR_ERR_OPERATION_FAILED, + _("could not eject media on %s"), dev_name); goto cleanup; } @@ -1352,8 +1352,8 @@ int qemuMonitorTextEjectMedia(qemuMonitorPtr mon, * device not found, device is locked ... * No message is printed on success it seems */ if (c_strcasestr(reply, "device ")) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("could not eject media on %s: %s"), dev_name, reply); + virReportError(VIR_ERR_OPERATION_FAILED, + _("could not eject media on %s: %s"), dev_name, reply); goto cleanup; } @@ -1387,8 +1387,8 @@ int qemuMonitorTextChangeMedia(qemuMonitorPtr mon, } if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("could not change media on %s"), dev_name); + virReportError(VIR_ERR_OPERATION_FAILED, + _("could not change media on %s"), dev_name); goto cleanup; } @@ -1396,15 +1396,15 @@ int qemuMonitorTextChangeMedia(qemuMonitorPtr mon, * device not found, device is locked ... * No message is printed on success it seems */ if (c_strcasestr(reply, "device ")) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("could not change media on %s: %s"), dev_name, reply); + virReportError(VIR_ERR_OPERATION_FAILED, + _("could not change media on %s: %s"), dev_name, reply); goto cleanup; } /* Could not open message indicates bad filename */ if (strstr(reply, "Could not open ")) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("could not change media on %s: %s"), dev_name, reply); + virReportError(VIR_ERR_OPERATION_FAILED, + _("could not change media on %s: %s"), dev_name, reply); goto cleanup; } @@ -1439,8 +1439,8 @@ static int qemuMonitorTextSaveMemory(qemuMonitorPtr mon, } if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("could not save memory region to '%s'"), path); + virReportError(VIR_ERR_OPERATION_FAILED, + _("could not save memory region to '%s'"), path); goto cleanup; } @@ -1486,8 +1486,8 @@ int qemuMonitorTextSetMigrationSpeed(qemuMonitorPtr mon, } if (qemuMonitorHMPCommand(mon, cmd, &info) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("could not restrict migration speed")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("could not restrict migration speed")); goto cleanup; } @@ -1513,8 +1513,8 @@ int qemuMonitorTextSetMigrationDowntime(qemuMonitorPtr mon, } if (qemuMonitorHMPCommand(mon, cmd, &info) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("could not set maximum migration downtime")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("could not set maximum migration downtime")); goto cleanup; } @@ -1554,8 +1554,8 @@ int qemuMonitorTextGetMigrationStatus(qemuMonitorPtr mon, *total = 0; if (qemuMonitorHMPCommand(mon, "info migrate", &reply) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("cannot query migration status")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("cannot query migration status")); return -1; } @@ -1563,15 +1563,15 @@ int qemuMonitorTextGetMigrationStatus(qemuMonitorPtr mon, tmp += strlen(MIGRATION_PREFIX); end = strchr(tmp, '\r'); if (end == NULL) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected migration status in %s"), reply); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unexpected migration status in %s"), reply); goto cleanup; } *end = '\0'; if ((*status = qemuMonitorMigrationStatusTypeFromString(tmp)) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unexpected migration status in %s"), reply); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unexpected migration status in %s"), reply); goto cleanup; } @@ -1583,9 +1583,9 @@ int qemuMonitorTextGetMigrationStatus(qemuMonitorPtr mon, tmp += strlen(MIGRATION_TRANSFER_PREFIX); if (virStrToLong_ull(tmp, &end, 10, transferred) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot parse migration data transferred " - "statistic %s"), tmp); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot parse migration data transferred " + "statistic %s"), tmp); goto cleanup; } *transferred *= 1024; @@ -1596,9 +1596,9 @@ int qemuMonitorTextGetMigrationStatus(qemuMonitorPtr mon, tmp += strlen(MIGRATION_REMAINING_PREFIX); if (virStrToLong_ull(tmp, &end, 10, remaining) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot parse migration data remaining " - "statistic %s"), tmp); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot parse migration data remaining " + "statistic %s"), tmp); goto cleanup; } *remaining *= 1024; @@ -1609,9 +1609,9 @@ int qemuMonitorTextGetMigrationStatus(qemuMonitorPtr mon, tmp += strlen(MIGRATION_TOTAL_PREFIX); if (virStrToLong_ull(tmp, &end, 10, total) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot parse migration data total " - "statistic %s"), tmp); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot parse migration data total " + "statistic %s"), tmp); goto cleanup; } *total *= 1024; @@ -1625,9 +1625,9 @@ int qemuMonitorTextGetMigrationStatus(qemuMonitorPtr mon, tmp += strlen(MIGRATION_DISK_TRANSFER_PREFIX); if (virStrToLong_ull(tmp, &end, 10, &disk_transferred) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot parse disk migration data " - "transferred statistic %s"), tmp); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot parse disk migration data " + "transferred statistic %s"), tmp); goto cleanup; } *transferred += disk_transferred * 1024; @@ -1638,9 +1638,9 @@ int qemuMonitorTextGetMigrationStatus(qemuMonitorPtr mon, tmp += strlen(MIGRATION_DISK_REMAINING_PREFIX); if (virStrToLong_ull(tmp, &end, 10, &disk_remaining) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot parse disk migration data remaining " - "statistic %s"), tmp); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot parse disk migration data remaining " + "statistic %s"), tmp); goto cleanup; } *remaining += disk_remaining * 1024; @@ -1651,9 +1651,9 @@ int qemuMonitorTextGetMigrationStatus(qemuMonitorPtr mon, tmp += strlen(MIGRATION_DISK_TOTAL_PREFIX); if (virStrToLong_ull(tmp, &end, 10, &disk_total) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot parse disk migration data total " - "statistic %s"), tmp); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot parse disk migration data total " + "statistic %s"), tmp); goto cleanup; } *total += disk_total * 1024; @@ -1705,22 +1705,22 @@ int qemuMonitorTextMigrate(qemuMonitorPtr mon, } if (qemuMonitorHMPCommand(mon, cmd, &info) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unable to start migration to %s"), dest); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unable to start migration to %s"), dest); goto cleanup; } /* Now check for "fail" in the output string */ if (strstr(info, "fail") != NULL) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("migration to '%s' failed: %s"), dest, info); + virReportError(VIR_ERR_OPERATION_FAILED, + _("migration to '%s' failed: %s"), dest, info); goto cleanup; } /* If the command isn't supported then qemu prints: * unknown command: migrate" */ if (strstr(info, "unknown command:")) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - _("migration to '%s' not supported by this qemu: %s"), dest, info); + virReportError(VIR_ERR_OPERATION_INVALID, + _("migration to '%s' not supported by this qemu: %s"), dest, info); goto cleanup; } @@ -1740,8 +1740,8 @@ int qemuMonitorTextMigrateCancel(qemuMonitorPtr mon) char *info = NULL; if (qemuMonitorHMPCommand(mon, "migrate_cancel", &info) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("cannot run monitor command to cancel migration")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("cannot run monitor command to cancel migration")); return -1; } VIR_FREE(info); @@ -1769,8 +1769,8 @@ int qemuMonitorTextGraphicsRelocate(qemuMonitorPtr mon, if (qemuMonitorHMPCommand(mon, cmd, &info) < 0) { VIR_FREE(cmd); - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("cannot run monitor command to relocate graphics client")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("cannot run monitor command to relocate graphics client")); return -1; } VIR_FREE(cmd); @@ -1800,16 +1800,16 @@ int qemuMonitorTextAddUSBDisk(qemuMonitorPtr mon, } if (qemuMonitorHMPCommand(mon, cmd, &info) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("cannot run monitor command to add usb disk")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("cannot run monitor command to add usb disk")); goto cleanup; } /* If the command failed qemu prints: * Could not add ... */ if (strstr(info, "Could not add ")) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("unable to add USB disk %s: %s"), path, info); + virReportError(VIR_ERR_OPERATION_FAILED, + _("unable to add USB disk %s: %s"), path, info); goto cleanup; } @@ -1836,16 +1836,16 @@ static int qemuMonitorTextAddUSBDevice(qemuMonitorPtr mon, } if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("cannot attach usb device")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("cannot attach usb device")); goto cleanup; } /* If the command failed qemu prints: * Could not add ... */ if (strstr(reply, "Could not add ")) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("adding usb device failed")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("adding usb device failed")); goto cleanup; } @@ -1977,20 +1977,20 @@ int qemuMonitorTextAddPCIHostDevice(qemuMonitorPtr mon, } if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("cannot attach host pci device")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("cannot attach host pci device")); goto cleanup; } if (strstr(reply, "invalid type: host")) { - qemuReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("PCI device assignment is not supported by this version of qemu")); + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("PCI device assignment is not supported by this version of qemu")); goto cleanup; } if (qemuMonitorTextParsePciAddReply(mon, reply, guestAddr) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("parsing pci_add reply failed: %s"), reply); + virReportError(VIR_ERR_OPERATION_FAILED, + _("parsing pci_add reply failed: %s"), reply); goto cleanup; } @@ -2028,8 +2028,8 @@ try_command: } if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("cannot attach %s disk %s"), bus, path); + virReportError(VIR_ERR_OPERATION_FAILED, + _("cannot attach %s disk %s"), bus, path); goto cleanup; } @@ -2041,8 +2041,8 @@ try_command: goto try_command; } - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("adding %s disk failed %s: %s"), bus, path, reply); + virReportError(VIR_ERR_OPERATION_FAILED, + _("adding %s disk failed %s: %s"), bus, path, reply); goto cleanup; } @@ -2070,14 +2070,14 @@ int qemuMonitorTextAddPCINetwork(qemuMonitorPtr mon, } if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("failed to add NIC with '%s'"), cmd); + virReportError(VIR_ERR_OPERATION_FAILED, + _("failed to add NIC with '%s'"), cmd); goto cleanup; } if (qemuMonitorTextParsePciAddReply(mon, reply, guestAddr) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("parsing pci_add reply failed: %s"), reply); + virReportError(VIR_ERR_OPERATION_FAILED, + _("parsing pci_add reply failed: %s"), reply); goto cleanup; } @@ -2114,8 +2114,8 @@ try_command: } if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("failed to remove PCI device")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("failed to remove PCI device")); goto cleanup; } @@ -2133,9 +2133,9 @@ try_command: * nothing is printed on success */ if (strstr(reply, "invalid slot") || strstr(reply, "Invalid pci address")) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("failed to detach PCI device, invalid address %.4x:%.2x:%.2x: %s"), - guestAddr->domain, guestAddr->bus, guestAddr->slot, reply); + virReportError(VIR_ERR_OPERATION_FAILED, + _("failed to detach PCI device, invalid address %.4x:%.2x:%.2x: %s"), + guestAddr->domain, guestAddr->bus, guestAddr->slot, reply); goto cleanup; } @@ -2162,23 +2162,23 @@ int qemuMonitorTextSendFileHandle(qemuMonitorPtr mon, } if (qemuMonitorHMPCommandWithFd(mon, cmd, fd, &reply) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("failed to pass fd to qemu with '%s'"), cmd); + virReportError(VIR_ERR_OPERATION_FAILED, + _("failed to pass fd to qemu with '%s'"), cmd); goto cleanup; } /* If the command isn't supported then qemu prints: * unknown command: getfd" */ if (strstr(reply, "unknown command:")) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - _("qemu does not support sending of file handles: %s"), - reply); + virReportError(VIR_ERR_OPERATION_INVALID, + _("qemu does not support sending of file handles: %s"), + reply); goto cleanup; } if (STRNEQ(reply, "")) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unable to send file handle '%s': %s"), + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unable to send file handle '%s': %s"), fdname, reply); goto cleanup; } @@ -2205,17 +2205,17 @@ int qemuMonitorTextCloseFileHandle(qemuMonitorPtr mon, } if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("failed to close fd in qemu with '%s'"), cmd); + virReportError(VIR_ERR_OPERATION_FAILED, + _("failed to close fd in qemu with '%s'"), cmd); goto cleanup; } /* If the command isn't supported then qemu prints: * unknown command: getfd" */ if (strstr(reply, "unknown command:")) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - _("qemu does not support closing of file handles: %s"), - reply); + virReportError(VIR_ERR_OPERATION_INVALID, + _("qemu does not support closing of file handles: %s"), + reply); goto cleanup; } @@ -2241,15 +2241,15 @@ int qemuMonitorTextAddHostNetwork(qemuMonitorPtr mon, } if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("failed to add host net with '%s'"), cmd); + virReportError(VIR_ERR_OPERATION_FAILED, + _("failed to add host net with '%s'"), cmd); goto cleanup; } if (STRNEQ(reply, "")) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("unable to add host net: %s"), - reply); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unable to add host net: %s"), + reply); goto cleanup; } @@ -2276,8 +2276,8 @@ int qemuMonitorTextRemoveHostNetwork(qemuMonitorPtr mon, } if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("failed to remove host network in qemu with '%s'"), cmd); + virReportError(VIR_ERR_OPERATION_FAILED, + _("failed to remove host network in qemu with '%s'"), cmd); goto cleanup; } @@ -2305,8 +2305,8 @@ int qemuMonitorTextAddNetdev(qemuMonitorPtr mon, } if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("failed to add netdev with '%s'"), cmd); + virReportError(VIR_ERR_OPERATION_FAILED, + _("failed to add netdev with '%s'"), cmd); goto cleanup; } @@ -2334,8 +2334,8 @@ int qemuMonitorTextRemoveNetdev(qemuMonitorPtr mon, } if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("failed to remove netdev in qemu with '%s'"), cmd); + virReportError(VIR_ERR_OPERATION_FAILED, + _("failed to remove netdev in qemu with '%s'"), cmd); goto cleanup; } @@ -2369,8 +2369,8 @@ int qemuMonitorTextGetPtyPaths(qemuMonitorPtr mon, int ret = -1; if (qemuMonitorHMPCommand(mon, "info chardev", &reply) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", - _("failed to retrieve chardev info in qemu with 'info chardev'")); + virReportError(VIR_ERR_OPERATION_FAILED, "%s", + _("failed to retrieve chardev info in qemu with 'info chardev'")); return -1; } @@ -2420,9 +2420,9 @@ int qemuMonitorTextGetPtyPaths(qemuMonitorPtr mon, } if (virHashAddEntry(paths, id, path) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("failed to save chardev path '%s'"), - path); + virReportError(VIR_ERR_OPERATION_FAILED, + _("failed to save chardev path '%s'"), + path); VIR_FREE(path); goto cleanup; } @@ -2454,8 +2454,8 @@ try_command: } if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("cannot attach %s disk controller"), bus); + virReportError(VIR_ERR_OPERATION_FAILED, + _("cannot attach %s disk controller"), bus); goto cleanup; } @@ -2467,8 +2467,8 @@ try_command: goto try_command; } - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("adding %s disk controller failed: %s"), bus, reply); + virReportError(VIR_ERR_OPERATION_FAILED, + _("adding %s disk controller failed: %s"), bus, reply); goto cleanup; } @@ -2553,14 +2553,14 @@ try_command: } if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("failed to attach drive '%s'"), drivestr); + virReportError(VIR_ERR_OPERATION_FAILED, + _("failed to attach drive '%s'"), drivestr); goto cleanup; } if (strstr(reply, "unknown command:")) { - qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", - _("drive hotplug is not supported")); + virReportError(VIR_ERR_OPERATION_FAILED, "%s", + _("drive hotplug is not supported")); goto cleanup; } @@ -2571,8 +2571,8 @@ try_command: tryOldSyntax = 1; goto try_command; } - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("adding %s disk failed: %s"), drivestr, reply); + virReportError(VIR_ERR_OPERATION_FAILED, + _("adding %s disk failed: %s"), drivestr, reply); goto cleanup; } @@ -2626,8 +2626,8 @@ cleanup: (p) += strlen(lbl); #define GET_INT(p, base, val) \ if (virStrToLong_ui((p), &(p), (base), &(val)) < 0) { \ - qemuReportError(VIR_ERR_OPERATION_FAILED, \ - _("cannot parse value for %s"), #val); \ + virReportError(VIR_ERR_OPERATION_FAILED, \ + _("cannot parse value for %s"), #val); \ break; \ } #define SKIP_SPACE(p) \ @@ -2644,8 +2644,8 @@ int qemuMonitorTextGetAllPCIAddresses(qemuMonitorPtr mon, *retaddrs = NULL; if (qemuMonitorHMPCommand(mon, "info pci", &reply) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("cannot query PCI addresses")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("cannot query PCI addresses")); return -1; } @@ -2737,14 +2737,14 @@ int qemuMonitorTextDelDevice(qemuMonitorPtr mon, VIR_DEBUG("TextDelDevice devalias=%s", devalias); if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("cannot detach %s device"), devalias); + virReportError(VIR_ERR_OPERATION_FAILED, + _("cannot detach %s device"), devalias); goto cleanup; } if (STRNEQ(reply, "")) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("detaching %s device failed: %s"), devalias, reply); + virReportError(VIR_ERR_OPERATION_FAILED, + _("detaching %s device failed: %s"), devalias, reply); goto cleanup; } @@ -2777,8 +2777,8 @@ int qemuMonitorTextAddDevice(qemuMonitorPtr mon, } if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("cannot attach %s device"), devicestr); + virReportError(VIR_ERR_OPERATION_FAILED, + _("cannot attach %s device"), devicestr); goto cleanup; } @@ -2793,8 +2793,8 @@ int qemuMonitorTextAddDevice(qemuMonitorPtr mon, /* Otherwise, if the command succeeds, no output is sent. So * any non-empty string shows an error */ if (STRNEQ(reply, "")) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("adding %s device failed: %s"), devicestr, reply); + virReportError(VIR_ERR_OPERATION_FAILED, + _("adding %s device failed: %s"), devicestr, reply); goto cleanup; } @@ -2830,20 +2830,20 @@ int qemuMonitorTextAddDrive(qemuMonitorPtr mon, } if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("failed to add drive '%s'"), drivestr); + virReportError(VIR_ERR_OPERATION_FAILED, + _("failed to add drive '%s'"), drivestr); goto cleanup; } if (strstr(reply, "unknown command:")) { - qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", - _("drive hotplug is not supported")); + virReportError(VIR_ERR_OPERATION_FAILED, "%s", + _("drive hotplug is not supported")); goto cleanup; } if (strstr(reply, "could not open disk image")) { - qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", - _("open disk image file failed")); + virReportError(VIR_ERR_OPERATION_FAILED, "%s", + _("open disk image file failed")); goto cleanup; } @@ -2878,8 +2878,8 @@ int qemuMonitorTextDriveDel(qemuMonitorPtr mon, } if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("cannot delete %s drive"), drivestr); + virReportError(VIR_ERR_OPERATION_FAILED, + _("cannot delete %s drive"), drivestr); goto cleanup; } @@ -2895,8 +2895,8 @@ int qemuMonitorTextDriveDel(qemuMonitorPtr mon, /* NB: device not found errors mean the drive was auto-deleted and we * ignore the error */ } else if (STRNEQ(reply, "")) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("deleting %s drive failed: %s"), drivestr, reply); + virReportError(VIR_ERR_OPERATION_FAILED, + _("deleting %s drive failed: %s"), drivestr, reply); goto cleanup; } @@ -2931,18 +2931,18 @@ int qemuMonitorTextSetDrivePassphrase(qemuMonitorPtr mon, } if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", - _("failed to set disk password")); + virReportError(VIR_ERR_OPERATION_FAILED, "%s", + _("failed to set disk password")); goto cleanup; } if (strstr(reply, "unknown command:")) { - qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", - _("setting disk password is not supported")); + virReportError(VIR_ERR_OPERATION_FAILED, "%s", + _("setting disk password is not supported")); goto cleanup; } else if (strstr(reply, "The entered password is invalid")) { - qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", - _("the disk password is incorrect")); + virReportError(VIR_ERR_OPERATION_FAILED, "%s", + _("the disk password is incorrect")); goto cleanup; } @@ -2969,28 +2969,28 @@ int qemuMonitorTextCreateSnapshot(qemuMonitorPtr mon, const char *name) } if (qemuMonitorHMPCommand(mon, cmd, &reply)) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("failed to take snapshot using command '%s'"), cmd); + virReportError(VIR_ERR_OPERATION_FAILED, + _("failed to take snapshot using command '%s'"), cmd); goto cleanup; } if (strstr(reply, "Error while creating snapshot") != NULL) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("Failed to take snapshot: %s"), reply); + virReportError(VIR_ERR_OPERATION_FAILED, + _("Failed to take snapshot: %s"), reply); goto cleanup; } else if (strstr(reply, "No block device can accept snapshots") != NULL) { - qemuReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("this domain does not have a device to take snapshots")); + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("this domain does not have a device to take snapshots")); goto cleanup; } else if (strstr(reply, "Could not open VM state file") != NULL) { - qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", reply); + virReportError(VIR_ERR_OPERATION_FAILED, "%s", reply); goto cleanup; } else if (strstr(reply, "Error") != NULL && strstr(reply, "while writing VM") != NULL) { - qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", reply); + virReportError(VIR_ERR_OPERATION_FAILED, "%s", reply); goto cleanup; } @@ -3017,39 +3017,39 @@ int qemuMonitorTextLoadSnapshot(qemuMonitorPtr mon, const char *name) } if (qemuMonitorHMPCommand(mon, cmd, &reply)) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("failed to restore snapshot using command '%s'"), - cmd); + virReportError(VIR_ERR_OPERATION_FAILED, + _("failed to restore snapshot using command '%s'"), + cmd); goto cleanup; } if (strstr(reply, "No block device supports snapshots") != NULL) { - qemuReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("this domain does not have a device to load snapshots")); + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("this domain does not have a device to load snapshots")); goto cleanup; } else if (strstr(reply, "Could not find snapshot") != NULL) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - _("the snapshot '%s' does not exist, and was not loaded"), - name); + virReportError(VIR_ERR_OPERATION_INVALID, + _("the snapshot '%s' does not exist, and was not loaded"), + name); goto cleanup; } else if (strstr(reply, "Snapshots not supported on device") != NULL) { - qemuReportError(VIR_ERR_OPERATION_INVALID, "%s", reply); + virReportError(VIR_ERR_OPERATION_INVALID, "%s", reply); goto cleanup; } else if (strstr(reply, "Could not open VM state file") != NULL) { - qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", reply); + virReportError(VIR_ERR_OPERATION_FAILED, "%s", reply); goto cleanup; } else if (strstr(reply, "Error") != NULL && strstr(reply, "while loading VM state") != NULL) { - qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", reply); + virReportError(VIR_ERR_OPERATION_FAILED, "%s", reply); goto cleanup; } else if (strstr(reply, "Error") != NULL && strstr(reply, "while activating snapshot on") != NULL) { - qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", reply); + virReportError(VIR_ERR_OPERATION_FAILED, "%s", reply); goto cleanup; } @@ -3075,24 +3075,24 @@ int qemuMonitorTextDeleteSnapshot(qemuMonitorPtr mon, const char *name) goto cleanup; } if (qemuMonitorHMPCommand(mon, cmd, &reply)) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("failed to delete snapshot using command '%s'"), - cmd); + virReportError(VIR_ERR_OPERATION_FAILED, + _("failed to delete snapshot using command '%s'"), + cmd); goto cleanup; } if (strstr(reply, "No block device supports snapshots") != NULL) { - qemuReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("this domain does not have a device to delete snapshots")); + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("this domain does not have a device to delete snapshots")); goto cleanup; } else if (strstr(reply, "Snapshots not supported on device") != NULL) { - qemuReportError(VIR_ERR_OPERATION_INVALID, "%s", reply); + virReportError(VIR_ERR_OPERATION_INVALID, "%s", reply); goto cleanup; } else if (strstr(reply, "Error") != NULL && strstr(reply, "while deleting snapshot") != NULL) { - qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", reply); + virReportError(VIR_ERR_OPERATION_FAILED, "%s", reply); goto cleanup; } @@ -3121,15 +3121,15 @@ qemuMonitorTextDiskSnapshot(qemuMonitorPtr mon, const char *device, } if (qemuMonitorHMPCommand(mon, cmd, &reply)) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("failed to take snapshot using command '%s'"), cmd); + virReportError(VIR_ERR_OPERATION_FAILED, + _("failed to take snapshot using command '%s'"), cmd); goto cleanup; } if (strstr(reply, "error while creating qcow2") != NULL || strstr(reply, "unknown command:") != NULL) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("Failed to take snapshot: %s"), reply); + virReportError(VIR_ERR_OPERATION_FAILED, + _("Failed to take snapshot: %s"), reply); goto cleanup; } @@ -3159,8 +3159,8 @@ int qemuMonitorTextArbitraryCommand(qemuMonitorPtr mon, const char *cmd, ret = qemuMonitorHMPCommand(mon, safecmd, reply); if (ret != 0) - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("failed to run cmd '%s'"), safecmd); + virReportError(VIR_ERR_OPERATION_FAILED, + _("failed to run cmd '%s'"), safecmd); VIR_FREE(safecmd); @@ -3189,9 +3189,9 @@ int qemuMonitorTextInjectNMI(qemuMonitorPtr mon) return 0; fail: - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("failed to inject NMI using command '%s'"), - cmd); + virReportError(VIR_ERR_OPERATION_FAILED, + _("failed to inject NMI using command '%s'"), + cmd); return -1; } @@ -3211,9 +3211,9 @@ int qemuMonitorTextSendKey(qemuMonitorPtr mon, virBufferAddLit(&buf, "sendkey "); for (i = 0; i < nkeycodes; i++) { if (keycodes[i] > 0xffff) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("keycode %d is invalid: 0x%X"), - i, keycodes[i]); + virReportError(VIR_ERR_OPERATION_FAILED, + _("keycode %d is invalid: 0x%X"), + i, keycodes[i]); virBufferFreeAndReset(&buf); return -1; } @@ -3233,15 +3233,15 @@ int qemuMonitorTextSendKey(qemuMonitorPtr mon, cmd = virBufferContentAndReset(&buf); if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("failed to send key using command '%s'"), - cmd); + virReportError(VIR_ERR_OPERATION_FAILED, + _("failed to send key using command '%s'"), + cmd); goto cleanup; } if (STRNEQ(reply, "")) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - _("failed to send key '%s'"), reply); + virReportError(VIR_ERR_OPERATION_FAILED, + _("failed to send key '%s'"), reply); goto cleanup; } @@ -3266,8 +3266,8 @@ int qemuMonitorTextScreendump(qemuMonitorPtr mon, const char *file) } if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("taking screenshot failed")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("taking screenshot failed")); goto cleanup; } @@ -3300,8 +3300,8 @@ int qemuMonitorTextOpenGraphics(qemuMonitorPtr mon, } if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, - "%s", _("adding graphics client failed")); + virReportError(VIR_ERR_OPERATION_FAILED, + "%s", _("adding graphics client failed")); goto cleanup; } @@ -3339,15 +3339,15 @@ int qemuMonitorTextSetBlockIoThrottle(qemuMonitorPtr mon, } if (qemuMonitorHMPCommand(mon, cmd, &result) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("cannot run monitor command")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("cannot run monitor command")); ret = -1; goto cleanup; } if (qemuMonitorTextCommandNotFound(cmd_name, result)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - _("Command '%s' is not found"), cmd_name); + virReportError(VIR_ERR_OPERATION_INVALID, + _("Command '%s' is not found"), cmd_name); ret = -1; goto cleanup; } @@ -3429,8 +3429,8 @@ qemuMonitorTextParseBlockIoThrottle(const char *result, p++; } - qemuReportError(VIR_ERR_INVALID_ARG, - _("No info for device '%s'"), device); + virReportError(VIR_ERR_INVALID_ARG, + _("No info for device '%s'"), device); cleanup: return ret; @@ -3445,15 +3445,15 @@ int qemuMonitorTextGetBlockIoThrottle(qemuMonitorPtr mon, const char *cmd_name = "info block"; if (qemuMonitorHMPCommand(mon, cmd_name, &result) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("cannot run monitor command")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("cannot run monitor command")); ret = -1; goto cleanup; } if (qemuMonitorTextCommandNotFound(cmd_name, result)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - _("Command '%s' is not found"), cmd_name); + virReportError(VIR_ERR_OPERATION_INVALID, + _("Command '%s' is not found"), cmd_name); ret = -1; goto cleanup; } diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index d8169e8..97403be 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -368,9 +368,9 @@ qemuProcessFindDomainDiskByPath(virDomainObjPtr vm, if (i >= 0) return vm->def->disks[i]; - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("no disk found with path %s"), - path); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("no disk found with path %s"), + path); return NULL; } @@ -391,9 +391,9 @@ qemuProcessFindDomainDiskByAlias(virDomainObjPtr vm, return disk; } - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("no disk found with alias %s"), - alias); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("no disk found with alias %s"), + alias); return NULL; } @@ -411,24 +411,24 @@ qemuProcessGetVolumeQcowPassphrase(virConnectPtr conn, virStorageEncryptionPtr enc; if (!disk->encryption) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("disk %s does not have any encryption information"), - disk->src); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("disk %s does not have any encryption information"), + disk->src); return -1; } enc = disk->encryption; if (!conn) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("cannot find secrets without a connection")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("cannot find secrets without a connection")); goto cleanup; } if (conn->secretDriver == NULL || conn->secretDriver->lookupByUUID == NULL || conn->secretDriver->getValue == NULL) { - qemuReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("secret storage not supported")); + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("secret storage not supported")); goto cleanup; } @@ -436,8 +436,8 @@ qemuProcessGetVolumeQcowPassphrase(virConnectPtr conn, enc->nsecrets != 1 || enc->secrets[0]->type != VIR_STORAGE_ENCRYPTION_SECRET_TYPE_PASSPHRASE) { - qemuReportError(VIR_ERR_XML_ERROR, - _("invalid <encryption> for volume %s"), disk->src); + virReportError(VIR_ERR_XML_ERROR, + _("invalid <encryption> for volume %s"), disk->src); goto cleanup; } @@ -454,9 +454,9 @@ qemuProcessGetVolumeQcowPassphrase(virConnectPtr conn, if (memchr(data, '\0', size) != NULL) { memset(data, 0, size); VIR_FREE(data); - qemuReportError(VIR_ERR_XML_ERROR, - _("format='qcow' passphrase for %s must not contain a " - "'\\0'"), disk->src); + virReportError(VIR_ERR_XML_ERROR, + _("format='qcow' passphrase for %s must not contain a " + "'\\0'"), disk->src); goto cleanup; } @@ -550,8 +550,8 @@ qemuProcessFakeReboot(void *opaque) goto cleanup; if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("guest unexpectedly quit")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("guest unexpectedly quit")); goto endjob; } @@ -563,8 +563,8 @@ qemuProcessFakeReboot(void *opaque) qemuDomainObjExitMonitorWithDriver(driver, vm); if (!virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("guest unexpectedly quit")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("guest unexpectedly quit")); goto endjob; } @@ -572,8 +572,8 @@ qemuProcessFakeReboot(void *opaque) VIR_DOMAIN_RUNNING_BOOTED, QEMU_ASYNC_JOB_NONE) < 0) { if (virGetLastError() == NULL) - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("resume operation failed")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("resume operation failed")); goto endjob; } priv->gotShutdown = false; @@ -1326,16 +1326,16 @@ qemuProcessReadLogOutput(virDomainObjPtr vm, } if (got == buflen-1) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Out of space while reading %s log output: %s"), - what, buf); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Out of space while reading %s log output: %s"), + what, buf); goto cleanup; } if (isdead) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Process exited while reading %s log output: %s"), - what, buf); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Process exited while reading %s log output: %s"), + what, buf); goto cleanup; } @@ -1348,9 +1348,9 @@ qemuProcessReadLogOutput(virDomainObjPtr vm, retries--; } - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Timed out while reading %s log output: %s"), - what, buf); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Timed out while reading %s log output: %s"), + what, buf); cleanup: VIR_FREE(debug); @@ -1435,8 +1435,8 @@ qemuProcessLookupPTYs(virDomainChrDefPtr *devices, /* neither the log output nor 'info chardev' had a * pty path for this chardev, report an error */ - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("no assigned pty for device %s"), id); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("no assigned pty for device %s"), id); return -1; } else { /* 'info chardev' had no pty path for this chardev, @@ -1627,9 +1627,9 @@ cleanup: /* VM is dead, any other error raised in the interim is probably * not as important as the qemu cmdline output */ qemuProcessReadLogFD(logfd, buf, buf_size, strlen(buf)); - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("process exited while connecting to monitor: %s"), - buf); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("process exited while connecting to monitor: %s"), + buf); ret = -1; } @@ -1672,10 +1672,10 @@ qemuProcessDetectVcpuPIDs(struct qemud_driver *driver, qemuDomainObjExitMonitorWithDriver(driver, vm); if (ncpupids != vm->def->vcpus) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("got wrong number of vCPU pids from QEMU monitor. " - "got %d, wanted %d"), - ncpupids, vm->def->vcpus); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("got wrong number of vCPU pids from QEMU monitor. " + "got %d, wanted %d"), + ncpupids, vm->def->vcpus); VIR_FREE(cpupids); return -1; } @@ -1720,8 +1720,8 @@ qemuProcessInitNumaMemoryPolicy(virDomainObjPtr vm, } if (numa_available() < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("Host kernel is not aware of NUMA.")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("Host kernel is not aware of NUMA.")); return -1; } @@ -1731,8 +1731,8 @@ qemuProcessInitNumaMemoryPolicy(virDomainObjPtr vm, for (i = 0; i < VIR_DOMAIN_CPUMASK_LEN; i++) { if (tmp_nodemask[i]) { if (i > NUMA_NUM_NODES) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Host cannot support NUMA node %d"), i); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Host cannot support NUMA node %d"), i); return -1; } if (i > maxnode && !warned) { @@ -1760,9 +1760,9 @@ qemuProcessInitNumaMemoryPolicy(virDomainObjPtr vm, } if (nnodes != 1) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("NUMA memory tuning in 'preferred' mode " - "only supports single node")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("NUMA memory tuning in 'preferred' mode " + "only supports single node")); goto cleanup; } @@ -1774,8 +1774,8 @@ qemuProcessInitNumaMemoryPolicy(virDomainObjPtr vm, /* XXX: Shouldn't go here, as we already do checking when * parsing domain XML. */ - qemuReportError(VIR_ERR_XML_ERROR, - "%s", _("Invalid mode for memory NUMA tuning.")); + virReportError(VIR_ERR_XML_ERROR, + "%s", _("Invalid mode for memory NUMA tuning.")); goto cleanup; } @@ -1790,8 +1790,8 @@ qemuProcessInitNumaMemoryPolicy(virDomainObjPtr vm, const char *nodemask ATTRIBUTE_UNUSED) { if (vm->def->numatune.memory.nodemask) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("libvirt is compiled without NUMA tuning support")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("libvirt is compiled without NUMA tuning support")); return -1; } @@ -1814,9 +1814,9 @@ qemuGetNumadAdvice(virDomainDefPtr def) virCommandSetOutputBuffer(cmd, &output); if (virCommandRun(cmd, NULL) < 0) - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Failed to query numad for the " - "advisory nodeset")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Failed to query numad for the " + "advisory nodeset")); virCommandFree(cmd); return output; @@ -1825,8 +1825,8 @@ qemuGetNumadAdvice(virDomainDefPtr def) static char * qemuGetNumadAdvice(virDomainDefPtr def ATTRIBUTE_UNUSED) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("numad is not available on this host")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("numad is not available on this host")); return NULL; } #endif @@ -1920,8 +1920,8 @@ qemuProcessSetLinkStates(virDomainObjPtr vm) VIR_DEBUG("Setting link state: %s", def->nets[i]->info.alias); if (!qemuCapsGet(priv->qemuCaps, QEMU_CAPS_NETDEV)) { - qemuReportError(VIR_ERR_NO_SUPPORT, - _("Setting of link state is not supported by this qemu")); + virReportError(VIR_ERR_NO_SUPPORT, + _("Setting of link state is not supported by this qemu")); return -1; } @@ -1929,7 +1929,7 @@ qemuProcessSetLinkStates(virDomainObjPtr vm) def->nets[i]->info.alias, VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOWN); if (ret != 0) { - qemuReportError(VIR_ERR_OPERATION_FAILED, + virReportError(VIR_ERR_OPERATION_FAILED, _("Couldn't set link state on interface: %s"), def->nets[i]->info.alias); break; } @@ -1961,8 +1961,8 @@ qemuProcessSetVcpuAffinites(virConnectPtr conn, return 0; if (priv->vcpupids == NULL) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("cpu affinity is not supported")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("cpu affinity is not supported")); return -1; } @@ -2330,9 +2330,9 @@ qemuProcessDetectPCIAddresses(virDomainObjPtr vm, if (qemuProcessAssignNextPCIAddress(&(vm->def->disks[i]->info), vendor, product, addrs, naddrs) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot find PCI address for VirtIO disk %s"), - vm->def->disks[i]->dst); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot find PCI address for VirtIO disk %s"), + vm->def->disks[i]->dst); return -1; } } @@ -2344,9 +2344,9 @@ qemuProcessDetectPCIAddresses(virDomainObjPtr vm, if (qemuProcessAssignNextPCIAddress(&(vm->def->nets[i]->info), vendor, product, addrs, naddrs) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot find PCI address for %s NIC"), - vm->def->nets[i]->model); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot find PCI address for %s NIC"), + vm->def->nets[i]->model); return -1; } } @@ -2358,9 +2358,9 @@ qemuProcessDetectPCIAddresses(virDomainObjPtr vm, if (qemuProcessAssignNextPCIAddress(&(vm->def->controllers[i]->info), vendor, product, addrs, naddrs) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot find PCI address for controller %s"), - virDomainControllerTypeToString(vm->def->controllers[i]->type)); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot find PCI address for controller %s"), + virDomainControllerTypeToString(vm->def->controllers[i]->type)); return -1; } } @@ -2372,9 +2372,9 @@ qemuProcessDetectPCIAddresses(virDomainObjPtr vm, if (qemuProcessAssignNextPCIAddress(&(vm->def->videos[i]->info), vendor, product, addrs, naddrs) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot find PCI address for video adapter %s"), - virDomainVideoTypeToString(vm->def->videos[i]->type)); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot find PCI address for video adapter %s"), + virDomainVideoTypeToString(vm->def->videos[i]->type)); return -1; } } @@ -2386,9 +2386,9 @@ qemuProcessDetectPCIAddresses(virDomainObjPtr vm, if (qemuProcessAssignNextPCIAddress(&(vm->def->sounds[i]->info), vendor, product, addrs, naddrs) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot find PCI address for sound adapter %s"), - virDomainSoundModelTypeToString(vm->def->sounds[i]->model)); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot find PCI address for sound adapter %s"), + virDomainSoundModelTypeToString(vm->def->sounds[i]->model)); return -1; } } @@ -2399,9 +2399,9 @@ qemuProcessDetectPCIAddresses(virDomainObjPtr vm, if (qemuProcessAssignNextPCIAddress(&(vm->def->watchdog->info), vendor, product, addrs, naddrs) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot find PCI address for watchdog %s"), - virDomainWatchdogModelTypeToString(vm->def->watchdog->model)); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot find PCI address for watchdog %s"), + virDomainWatchdogModelTypeToString(vm->def->watchdog->model)); return -1; } } @@ -2411,9 +2411,9 @@ qemuProcessDetectPCIAddresses(virDomainObjPtr vm, if (qemuProcessAssignNextPCIAddress(&(vm->def->memballoon->info), vendor, product, addrs, naddrs) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot find PCI address for balloon %s"), - virDomainMemballoonModelTypeToString(vm->def->memballoon->model)); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot find PCI address for balloon %s"), + virDomainMemballoonModelTypeToString(vm->def->memballoon->model)); return -1; } } @@ -3273,9 +3273,9 @@ qemuProcessReconnectHelper(void *payload, virConnectClose(data->conn); - qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Could not create thread. QEMU initialization " - "might be incomplete")); + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Could not create thread. QEMU initialization " + "might be incomplete")); if (qemuDomainObjEndJob(src->driver, obj) == 0) { obj = NULL; } else if (virDomainObjUnref(obj) > 0) { @@ -3354,8 +3354,8 @@ int qemuProcessStart(virConnectPtr conn, VIR_DEBUG("Beginning VM startup process"); if (virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("VM is already active")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("VM is already active")); return -1; } @@ -3420,8 +3420,8 @@ int qemuProcessStart(virConnectPtr conn, vm->def->graphics[0]->data.vnc.autoport) { int port = qemuProcessNextFreePort(driver, QEMU_VNC_PORT_MIN); if (port < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("Unable to find an unused VNC port")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("Unable to find an unused VNC port")); goto cleanup; } vm->def->graphics[0]->data.vnc.port = port; @@ -3432,8 +3432,8 @@ int qemuProcessStart(virConnectPtr conn, port = qemuProcessNextFreePort(driver, QEMU_VNC_PORT_MIN); if (port < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("Unable to find an unused SPICE port")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("Unable to find an unused SPICE port")); goto cleanup; } @@ -3446,8 +3446,8 @@ int qemuProcessStart(virConnectPtr conn, int tlsPort = qemuProcessNextFreePort(driver, vm->def->graphics[0]->data.spice.port + 1); if (tlsPort < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("Unable to find an unused SPICE TLS port")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("Unable to find an unused SPICE TLS port")); qemuProcessReturnPort(driver, port); goto cleanup; } @@ -3492,10 +3492,10 @@ int qemuProcessStart(virConnectPtr conn, if (vm->def->virtType == VIR_DOMAIN_VIRT_KVM) { VIR_DEBUG("Checking for KVM availability"); if (access("/dev/kvm", F_OK) != 0) { - qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("Domain requires KVM, but it is not available. " - "Check that virtualization is enabled in the host BIOS, " - "and host configuration is setup to load the kvm modules.")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Domain requires KVM, but it is not available. " + "Check that virtualization is enabled in the host BIOS, " + "and host configuration is setup to load the kvm modules.")); goto cleanup; } } @@ -3658,8 +3658,8 @@ int qemuProcessStart(virConnectPtr conn, /* wait for qemu process to show up */ if (ret == 0) { if (virPidFileReadPath(priv->pidfile, &vm->pid) < 0) { - qemuReportError(VIR_ERR_INTERNAL_ERROR, - _("Domain %s didn't show up"), vm->def->name); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Domain %s didn't show up"), vm->def->name); ret = -1; } #if 0 @@ -3790,9 +3790,9 @@ int qemuProcessStart(virConnectPtr conn, VIR_DEBUG("Setting initial memory amount"); cur_balloon = vm->def->mem.cur_balloon; if (cur_balloon != vm->def->mem.cur_balloon) { - qemuReportError(VIR_ERR_OVERFLOW, - _("unable to set balloon to %lld"), - vm->def->mem.cur_balloon); + virReportError(VIR_ERR_OVERFLOW, + _("unable to set balloon to %lld"), + vm->def->mem.cur_balloon); goto cleanup; } qemuDomainObjEnterMonitorWithDriver(driver, vm); @@ -3809,8 +3809,8 @@ int qemuProcessStart(virConnectPtr conn, VIR_DOMAIN_RUNNING_BOOTED, QEMU_ASYNC_JOB_NONE) < 0) { if (virGetLastError() == NULL) - qemuReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("resume operation failed")); + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", _("resume operation failed")); goto cleanup; } } else { @@ -4199,8 +4199,8 @@ int qemuProcessAttach(virConnectPtr conn ATTRIBUTE_UNUSED, VIR_DEBUG("Beginning VM attach process"); if (virDomainObjIsActive(vm)) { - qemuReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("VM is already active")); + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("VM is already active")); return -1; } -- 1.7.10.4 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list