msg_gen_function += libxlError
msg_gen_function += nodeReportError
msg_gen_function += openvzError
-msg_gen_function += qemuReportError
msg_gen_function += regerror
msg_gen_function += remoteError
msg_gen_function += statsError
}
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;
}
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;
}
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;
}
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:
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))
if (!error &&
events & VIR_EVENT_HANDLE_HANGUP) {
- qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("End of file from monitor"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("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, "%s",
- _("Invalid file descriptor while waiting for monitor"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("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;
}
}
} else {
virErrorPtr err = virGetLastError();
if (!err)
- qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Error while processing monitor IO"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Error while processing monitor IO"));
virCopyLastError(&mon->lastError);
virResetLastError();
}
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;
}
}
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;
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;
}
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);
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;
}
}
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;
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 {
/* 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);
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;
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;
}
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)
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:
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:
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);
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;
"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;
}
goto cleanup;
}
} else {
- qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("Block I/O tuning is not available on this host"));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("Block I/O tuning is not available on this host"));
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;
}
}
}
}
} 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"));
}
}
goto cleanup;
}
} else {
- qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("CPU tuning is not available on this host"));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("CPU tuning is not available on this host"));
}
}
mask = virDomainCpuSetFormat(vm->def->numatune.memory.nodemask,
VIR_DOMAIN_CPUMASK_LEN);
if (!mask) {
- qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("failed to convert memory nodemask"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("failed to convert memory nodemask"));
goto cleanup;
}
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;
}
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) {
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;
}
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;
}
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;
/* 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;
*/
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;
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;
}
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;
}
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)
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)
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)
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;
}
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;
}
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;
}
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;
}
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;
}
* 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;
}
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;
}
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
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;
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
continue;
if (def->disks[i]->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) {
- qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("virtio only support device address type 'PCI'"));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("virtio only support device address type 'PCI'"));
goto error;
}
{
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;
}
}
{
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;
}
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;
}
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 */
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 {
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;
}
* 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;
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;
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;
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;
/* 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)
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,",
} 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);
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' &&
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 {
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;
}
}
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;
}
}
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;
}
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;
}
*/
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;
}
}
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;
}
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;
}
}
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;
}
} 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;
}
}
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;
}
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);
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);
/* 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;
}
}
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;
}
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;
}
}
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;
}
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;
}
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;
/* 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;
}
/* 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;
}
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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,
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;
}
}
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;
}
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;
}
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;
}
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;
} 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;
}
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");
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 */
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;
}
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, "%s",
- _("guest CPU is not compatible with host CPU"));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("guest CPU is not compatible with host CPU"));
}
/* fall through */
case VIR_CPU_COMPARE_ERROR:
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");
} 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;
}
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;
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;
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;
}
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",
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;
}
}
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;
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;
}
/* 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);
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;
}
}
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:
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)
&& (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;
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;
/* 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;
* 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;
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;
}
}
/* 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;
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;
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;
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;
}
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;
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;
}
}
/* 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)
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,
}
} 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;
}
}
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;
}
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;
}
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;
}
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,
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;
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
}
}
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;
}
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;
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;
}
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;
}
if (def->graphics[0]->data.spice.tlsPort > 0) {
if (!driver->spiceTLS) {
- qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("spice TLS port set in XML configuration,"
- " but TLS is disabled in qemu.conf"));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("spice TLS port set in XML configuration,"
+ " but TLS is disabled in qemu.conf"));
goto error;
}
virBufferAsprintf(&opt, ",tls-port=%u",
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;
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",
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;
}
} 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;
}
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;
}
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;
}
}
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;
}
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;
}
}
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;
}
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;
}
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);
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;
}
}
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;
}
}
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);
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;
}
}
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)) {
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;
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;
}
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';
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")) {
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]);
}
}
}
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;
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;
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" */
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;
}
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;
}
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;
}
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;
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;
}
} 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;
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;
}
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;
}
}
}
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, ',');
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;
}
if (dom->clock.timers[i]->present != -1 &&
dom->clock.timers[i]->present != present) {
- qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("conflicting occurrences of kvmclock feature"));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("conflicting occurrences of kvmclock feature"));
goto error;
}
dom->clock.timers[i]->present = present;
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:
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;
*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;
}
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;
}
#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; \
}
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] == '[')
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;
} 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") ||
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';
*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';
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;
}
}
}
if (!first_rbd_disk) {
- qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("CEPH_ARGS was set without an rbd disk"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("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);
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;
}
}
#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; \
}
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;
}
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;
}
# 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);
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;
}
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;
}
}
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) {
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;
}
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;
}
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;
}
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;
}
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;
}
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++;
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;
}
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"));
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;
}
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())
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;
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;
}
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;
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;
}
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;
}
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;
}
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
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;
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;
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;
}
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) {
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;
}
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) {
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,
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 (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;
}
}
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 (!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 (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
}
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 (!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;
}
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 (!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_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 {
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;
}
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) {
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) {
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;
}
/* 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;
}
/* 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;
}
/* 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;
}
}
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;
}
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;
}
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;
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;
}
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 (!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;
}
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;
}
}
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) {
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 (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:
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;
}
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;
}
}
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;
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;
}
}
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;
}
}
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) {
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;
}
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) {
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;
}
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;
}
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;
}
}
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;
}
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;
}
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;
}
}
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"));
}
}
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;
}
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;
}
}
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;
}
}
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;
}
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);
}
}
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;
}
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;
}
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;
}
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;
}
/* 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;
}
}
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;
}
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 (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;
}
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;
}
}
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;
}
}
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) {
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;
}
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;
}
}
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) {
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;
}
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;
}
}
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;
}
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;
}
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;
}
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;
}
return -3;
}
}
- qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", msg);
+ virReportError(VIR_ERR_OPERATION_FAILED, "%s", msg);
goto error;
}
}
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;
}
}
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;
}
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;
}
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;
}
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) {
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) {
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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)
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;
}
}
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)
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,
} 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;
}
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;
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;
}
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;
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;
}
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;
}
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)
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;
}
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;
}
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)) {
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)) {
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)) {
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)
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;
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);
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);
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);
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;
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, "%s",
- _("this disk doesn't support update"));
+ virReportError(VIR_ERR_INVALID_ARG, "%s",
+ _("this disk doesn't support update"));
return -1;
}
/*
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;
}
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;
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;
}
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;
}
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;
}
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;
}
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) {
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;
}
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;
}
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);
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;
}
if (flags & VIR_DOMAIN_AFFECT_LIVE) {
if (!qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_BLKIO)) {
- qemuReportError(VIR_ERR_OPERATION_INVALID, "%s",
- _("blkio cgroup isn't mounted"));
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("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;
}
}
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;
}
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;
}
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;
}
if (flags & VIR_DOMAIN_AFFECT_LIVE) {
if (!qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_BLKIO)) {
- qemuReportError(VIR_ERR_OPERATION_INVALID, "%s",
- _("blkio cgroup isn't mounted"));
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("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;
}
}
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;
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;
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;
}
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;
}
}
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;
}
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;
}
}
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;
}
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;
}
}
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;
}
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;
}
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;
}
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;
}
}
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;
}
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;
}
}
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;
}
}
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;
}
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;
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;
}
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];
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;
}
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 (!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;
}
}
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 (!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 (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)
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
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;
}
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;
}
}
}
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;
}
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;
}
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;
}
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;
}
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);
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;
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;
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;
}
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 (!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;
/* 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 {
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;
}
}
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;
}
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;
}
/* 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;
}
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;
}
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;
}
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;
}
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 endjob;
}
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);
/* 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;
}
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;
}
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;
}
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;
}
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 (!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;
}
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);
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;
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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 (!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 ((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;
}
}
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;
}
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;
}
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;
}
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;
}
}
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:
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;
}
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;
}
} 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) {
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;
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) {
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;
}
}
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;
}
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. */
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;
}
}
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;
}
}
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;
}
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;
}
/* 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,
/* 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);
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) {
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,
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) {
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) {
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) {
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 (!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 (!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 (!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;
}
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) {
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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) &&
|| snap->def->state == VIR_DOMAIN_PAUSED) &&
(flags & (VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING |
VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED))) {
- qemuReportError(VIR_ERR_SNAPSHOT_REVERT_RISKY, "%s",
- _("must respawn qemu to start inactive snapshot"));
+ virReportError(VIR_ERR_SNAPSHOT_REVERT_RISKY, "%s",
+ _("must respawn qemu to start inactive snapshot"));
goto cleanup;
}
}
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);
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;
}
}
} 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,
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;
}
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;
}
}
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;
}
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;
}
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;
}
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;
}
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;
}
}
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;
}
(flags & VIR_DOMAIN_CONSOLE_FORCE) != 0);
if (ret == 1) {
- qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
- _("Active console session exists for this domain"));
+ virReportError(VIR_ERR_OPERATION_FAILED, "%s",
+ _("Active console session exists for this domain"));
ret = -1;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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) {
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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 (!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;
}
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;
}
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;
}
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;
}
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;
}
int j;
if (virCgroupForVcpu(group, i, &group_vcpu, 0) < 0) {
- qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("error accessing cgroup cpuacct for vcpu"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("error accessing cgroup cpuacct for vcpu"));
goto cleanup;
}
pos = buf;
for (j = 0; j < num; j++) {
if (virStrToLong_ull(pos, &pos, 10, &tmp) < 0) {
- qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("cpuacct parse error"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("cpuacct parse error"));
goto cleanup;
}
sum_cpu_time[j] += tmp;
}
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;
}
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++;
/* 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;
}
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;
}
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;
}
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;
}
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 (!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;
}
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;
}
#include "hostusb.h"
#include "virnetdev.h"
+#define VIR_FROM_THIS VIR_FROM_QEMU
+
static pciDeviceList *
qemuGetPciHostDeviceList(virDomainHostdevDefPtr *hostdevs, int nhostdevs)
{
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:
isvf = qemuDomainHostdevIsVirtualFunction(hostdev);
if (isvf <= 0) {
- qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("Interface type hostdev is currently supported on"
- " SR-IOV Virtual Functions only"));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("Interface type hostdev is currently supported on"
+ " SR-IOV Virtual Functions only"));
return ret;
}
isvf = qemuDomainHostdevIsVirtualFunction(hostdev);
if (isvf <= 0) {
- qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("Interface type hostdev is currently supported on"
- " SR-IOV Virtual Functions only"));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("Interface type hostdev is currently supported on"
+ " SR-IOV Virtual Functions only"));
return ret;
}
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
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;
}
}
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;
}
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;
}
}
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;
}
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;
}
}
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;
}
}
if (controller->type == VIR_DOMAIN_CONTROLLER_TYPE_USB &&
controller->model == -1 &&
!qemuCapsGet(priv->qemuCaps, QEMU_CAPS_PIIX3_USB_UHCI)) {
- qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("USB controller hotplug unsupported in this QEMU binary"));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("USB controller hotplug unsupported in this QEMU binary"));
goto cleanup;
}
}
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;
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;
}
}
/* 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;
}
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;
}
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;
}
}
/* 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;
}
}
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;
}
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;
}
}
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;
}
/* set link state */
if (net->linkstate == VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOWN) {
if (!net->info.alias) {
- qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
- _("device alias not found: cannot set link state to down"));
+ virReportError(VIR_ERR_OPERATION_FAILED, "%s",
+ _("device alias not found: cannot set link state to down"));
} else {
qemuDomainObjEnterMonitorWithDriver(driver, vm);
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);
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
VIR_DEBUG("dev: %s, state: %d", dev->info.alias, linkstate);
if (!dev->info.alias) {
- qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
- _("can't change link state: device alias not found"));
+ virReportError(VIR_ERR_OPERATION_FAILED, "%s",
+ _("can't change link state: device alias not found"));
return -1;
}
int ret = 0;
if (!olddev) {
- qemuReportError(VIR_ERR_NO_SUPPORT, "%s",
- _("cannot find existing network device to modify"));
+ virReportError(VIR_ERR_NO_SUPPORT, "%s",
+ _("cannot find existing network device to modify"));
return -1;
}
if (olddev->type != dev->type) {
- qemuReportError(VIR_ERR_NO_SUPPORT, "%s",
- _("cannot change network interface type"));
+ virReportError(VIR_ERR_NO_SUPPORT, "%s",
+ _("cannot change network interface type"));
return -1;
}
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, "%s",
- _("cannot modify ethernet network device configuration"));
+ virReportError(VIR_ERR_NO_SUPPORT, "%s",
+ _("cannot modify ethernet network device configuration"));
return -1;
}
break;
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, "%s",
- _("cannot modify network socket device configuration"));
+ virReportError(VIR_ERR_NO_SUPPORT, "%s",
+ _("cannot modify network socket device configuration"));
return -1;
}
break;
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, "%s",
- _("cannot modify network device configuration"));
+ virReportError(VIR_ERR_NO_SUPPORT, "%s",
+ _("cannot modify network device configuration"));
return -1;
}
/* allow changing brname, but not portprofile */
if (!virNetDevVPortProfileEqual(olddev->data.bridge.virtPortProfile,
dev->data.bridge.virtPortProfile)) {
- qemuReportError(VIR_ERR_NO_SUPPORT, "%s",
- _("cannot modify bridge network device configuration"));
+ virReportError(VIR_ERR_NO_SUPPORT, "%s",
+ _("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, "%s",
- _("cannot modify internal network device configuration"));
+ virReportError(VIR_ERR_NO_SUPPORT, "%s",
+ _("cannot modify internal network device configuration"));
return -1;
}
break;
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, "%s",
- _("cannot modify direct network device configuration"));
+ virReportError(VIR_ERR_NO_SUPPORT, "%s",
+ _("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;
}
/* all other unmodifiable parameters */
if (STRNEQ_NULLABLE(olddev->model, dev->model) ||
STRNEQ_NULLABLE(olddev->filter, dev->filter)) {
- qemuReportError(VIR_ERR_NO_SUPPORT, "%s",
- _("cannot modify network device configuration"));
+ virReportError(VIR_ERR_NO_SUPPORT, "%s",
+ _("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, "%s",
- _("cannot modify network device configuration"));
+ virReportError(VIR_ERR_NO_SUPPORT, "%s",
+ _("cannot modify network device configuration"));
return -1;
}
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;
}
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;
}
(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;
}
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;
}
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;
}
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;
}
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 (!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;
}
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;
}
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;
}
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;
}
}
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;
}
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;
}
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;
}
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;
}
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;
}
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,
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;
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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 */
/* 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);
/* 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);
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);
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);
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],
/* 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;
}
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;
}
}
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;
}
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;
}
}
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:
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;
}
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;
}
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;
}
*/
if (qemuMigrationJobContinue(vm) == 0) {
vm = NULL;
- qemuReportError(VIR_ERR_OPERATION_FAILED,
- "%s", _("domain disappeared"));
+ virReportError(VIR_ERR_OPERATION_FAILED,
+ "%s", _("domain disappeared"));
goto cleanup;
}
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;
}
* 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;
}
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;
}
}
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;
}
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;
}
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;
}
* 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, "%s",
- _("domainMigratePrepare2 did not set uri"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("domainMigratePrepare2 did not set uri"));
cancelled = 1;
goto finish;
}
if (!(flags & VIR_MIGRATE_TUNNELLED) &&
(uri_out == NULL)) {
- qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("domainMigratePrepare3 did not set uri"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("domainMigratePrepare3 did not set uri"));
cancelled = 1;
goto finish;
}
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;
}
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;
}
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 ((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;
}
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;
}
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);
*/
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;
}
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;
}
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
*/
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;
}
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,
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;
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;
}
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;
}
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;
}
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))
if (!error &&
events & VIR_EVENT_HANDLE_HANGUP) {
- qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("End of file from monitor"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("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, "%s",
- _("Invalid file descriptor while waiting for monitor"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("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;
}
}
} else {
virErrorPtr err = virGetLastError();
if (!err)
- qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Error while processing monitor IO"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Error while processing monitor IO"));
virCopyLastError(&mon->lastError);
virResetLastError();
}
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;
}
}
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;
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;
}
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);
if (mon->lastError.code == VIR_ERR_OK) {
virErrorPtr err = virSaveLastError();
- qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
- _("Qemu monitor was closed"));
+ virReportError(VIR_ERR_OPERATION_FAILED, "%s",
+ _("Qemu monitor was closed"));
virCopyLastError(&mon->lastError);
if (err) {
virSetError(err);
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;
}
}
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);
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
VIR_DEBUG("mon=%p, name=%p:%s, state=%u", mon, name, name, state);
if (!mon || !name) {
- qemuReportError(VIR_ERR_INVALID_ARG, "%s",
- _("monitor || name must not be NULL"));
+ virReportError(VIR_ERR_INVALID_ARG, "%s",
+ _("monitor || name must not be NULL"));
return -1;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
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;
}
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;
}
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;
}
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;
}
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
/* 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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
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;
}
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;
}
/* 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;
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;
}
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;
}
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;
}
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;
}
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:
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;
}
}
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;
/* 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);
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;
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;
}
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);
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)
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
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;
}
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;
}
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;
}
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;
}
}
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;
}
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;
}
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;
}
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;
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
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;
}
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;
}
}
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;
}
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;
}
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;
}
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;
}
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;
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;
}
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;
}
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;
}
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;
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;
}
}
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;
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
}
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;
}
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;
}
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;
}
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;
}
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);
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))
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"))
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;
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)
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;
}
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"));
}
}
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;
}
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;
}
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;
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;
}
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;
}
/* 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;
}
}
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;
}
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);
*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;
}
*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;
}
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);
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;
}
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);
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;
}
*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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
* 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;
}
}
/* 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);
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;
}
* 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;
}
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;
}
}
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;
}
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);
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
* 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;
}
}
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;
}
* 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;
}
}
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;
}
}
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;
}
}
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;
}
*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;
}
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;
}
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;
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;
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;
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;
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;
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;
}
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;
}
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);
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);
}
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;
}
}
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;
}
}
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;
}
}
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;
}
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;
}
}
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;
}
}
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;
}
* 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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
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;
}
}
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;
}
}
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;
}
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;
}
}
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;
}
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;
}
(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) \
*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;
}
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;
}
}
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;
}
/* 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;
}
}
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;
}
}
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;
}
/* 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;
}
}
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;
}
}
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;
}
}
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;
}
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;
}
}
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;
}
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);
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;
}
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;
}
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;
}
}
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;
}
}
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;
}
}
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;
}
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;
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
/* 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,
/* 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;
}
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;
}
}
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;
}
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) {
}
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;
}
/* 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;
}
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;
}
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;
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
VIR_DEBUG("Setting link state: %s", def->nets[i]->info.alias);
if (!qemuCapsGet(priv->qemuCaps, QEMU_CAPS_NETDEV)) {
- qemuReportError(VIR_ERR_NO_SUPPORT, "%s",
- _("Setting of link state is not supported by this qemu"));
+ virReportError(VIR_ERR_NO_SUPPORT, "%s",
+ _("Setting of link state is not supported by this qemu"));
return -1;
}
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;
}
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;
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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) {
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;
}
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;
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;
}
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;
}
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;
}
}
/* 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
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);
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 {
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;
}