mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 22:45:21 +00:00
Remove passing of virConnectPtr throughout QEMU driver
This commit is contained in:
parent
d47ef780f2
commit
caa805ea64
File diff suppressed because it is too large
Load Diff
@ -157,8 +157,8 @@ typedef qemuDomainPCIAddressSet *qemuDomainPCIAddressSetPtr;
|
|||||||
/* Config type for XML import/export conversions */
|
/* Config type for XML import/export conversions */
|
||||||
#define QEMU_CONFIG_FORMAT_ARGV "qemu-argv"
|
#define QEMU_CONFIG_FORMAT_ARGV "qemu-argv"
|
||||||
|
|
||||||
#define qemudReportError(conn, dom, net, code, fmt...) \
|
#define qemuReportError(code, fmt...) \
|
||||||
virReportErrorHelper(conn, VIR_FROM_QEMU, code, __FILE__, \
|
virReportErrorHelper(NULL, VIR_FROM_QEMU, code, __FILE__, \
|
||||||
__FUNCTION__, __LINE__, fmt)
|
__FUNCTION__, __LINE__, fmt)
|
||||||
|
|
||||||
|
|
||||||
@ -191,15 +191,13 @@ int qemudBuildCommandLine (virConnectPtr conn,
|
|||||||
const char *migrateFrom);
|
const char *migrateFrom);
|
||||||
|
|
||||||
/* With vlan == -1, use netdev syntax, else old hostnet */
|
/* With vlan == -1, use netdev syntax, else old hostnet */
|
||||||
char * qemuBuildHostNetStr(virConnectPtr conn,
|
char * qemuBuildHostNetStr(virDomainNetDefPtr net,
|
||||||
virDomainNetDefPtr net,
|
|
||||||
char type_sep,
|
char type_sep,
|
||||||
int vlan,
|
int vlan,
|
||||||
const char *tapfd);
|
const char *tapfd);
|
||||||
|
|
||||||
/* Legacy, pre device support */
|
/* Legacy, pre device support */
|
||||||
char * qemuBuildNicStr(virConnectPtr conn,
|
char * qemuBuildNicStr(virDomainNetDefPtr net,
|
||||||
virDomainNetDefPtr net,
|
|
||||||
const char *prefix,
|
const char *prefix,
|
||||||
int vlan);
|
int vlan);
|
||||||
|
|
||||||
@ -213,8 +211,7 @@ char *qemuBuildDriveStr(virDomainDiskDefPtr disk,
|
|||||||
int qemuCmdFlags);
|
int qemuCmdFlags);
|
||||||
|
|
||||||
/* Current, best practice */
|
/* Current, best practice */
|
||||||
char * qemuBuildDriveDevStr(virConnectPtr conn,
|
char * qemuBuildDriveDevStr(virDomainDiskDefPtr disk);
|
||||||
virDomainDiskDefPtr disk);
|
|
||||||
/* Current, best practice */
|
/* Current, best practice */
|
||||||
char * qemuBuildControllerDevStr(virDomainControllerDefPtr def);
|
char * qemuBuildControllerDevStr(virDomainControllerDefPtr def);
|
||||||
|
|
||||||
@ -258,12 +255,10 @@ int qemudProbeCPUModels (const char *qemu,
|
|||||||
int qemudCanonicalizeMachine (struct qemud_driver *driver,
|
int qemudCanonicalizeMachine (struct qemud_driver *driver,
|
||||||
virDomainDefPtr def);
|
virDomainDefPtr def);
|
||||||
|
|
||||||
virDomainDefPtr qemuParseCommandLine(virConnectPtr conn,
|
virDomainDefPtr qemuParseCommandLine(virCapsPtr caps,
|
||||||
virCapsPtr caps,
|
|
||||||
const char **progenv,
|
const char **progenv,
|
||||||
const char **progargv);
|
const char **progargv);
|
||||||
virDomainDefPtr qemuParseCommandLineString(virConnectPtr conn,
|
virDomainDefPtr qemuParseCommandLineString(virCapsPtr caps,
|
||||||
virCapsPtr caps,
|
|
||||||
const char *args);
|
const char *args);
|
||||||
|
|
||||||
qemuDomainPCIAddressSetPtr qemuDomainPCIAddressSetCreate(virDomainDefPtr def);
|
qemuDomainPCIAddressSetPtr qemuDomainPCIAddressSetCreate(virDomainDefPtr def);
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -240,7 +240,7 @@ qemuMonitorOpenUnix(const char *monitor)
|
|||||||
memset(&addr, 0, sizeof(addr));
|
memset(&addr, 0, sizeof(addr));
|
||||||
addr.sun_family = AF_UNIX;
|
addr.sun_family = AF_UNIX;
|
||||||
if (virStrcpyStatic(addr.sun_path, monitor) == NULL) {
|
if (virStrcpyStatic(addr.sun_path, monitor) == NULL) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Monitor path %s too big for destination"), monitor);
|
_("Monitor path %s too big for destination"), monitor);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
@ -282,7 +282,7 @@ qemuMonitorOpenPty(const char *monitor)
|
|||||||
int monfd;
|
int monfd;
|
||||||
|
|
||||||
if ((monfd = open(monitor, O_RDWR)) < 0) {
|
if ((monfd = open(monitor, O_RDWR)) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Unable to open monitor path %s"), monitor);
|
_("Unable to open monitor path %s"), monitor);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -569,7 +569,7 @@ qemuMonitorOpen(virDomainObjPtr vm,
|
|||||||
qemuMonitorPtr mon;
|
qemuMonitorPtr mon;
|
||||||
|
|
||||||
if (!cb || !cb->eofNotify) {
|
if (!cb || !cb->eofNotify) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("EOF notify callback must be supplied"));
|
_("EOF notify callback must be supplied"));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -580,13 +580,13 @@ qemuMonitorOpen(virDomainObjPtr vm,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (virMutexInit(&mon->lock) < 0) {
|
if (virMutexInit(&mon->lock) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("cannot initialize monitor mutex"));
|
_("cannot initialize monitor mutex"));
|
||||||
VIR_FREE(mon);
|
VIR_FREE(mon);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (virCondInit(&mon->notify) < 0) {
|
if (virCondInit(&mon->notify) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("cannot initialize monitor condition"));
|
_("cannot initialize monitor condition"));
|
||||||
virMutexDestroy(&mon->lock);
|
virMutexDestroy(&mon->lock);
|
||||||
VIR_FREE(mon);
|
VIR_FREE(mon);
|
||||||
@ -610,7 +610,7 @@ qemuMonitorOpen(virDomainObjPtr vm,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("unable to handle monitor type: %s"),
|
_("unable to handle monitor type: %s"),
|
||||||
virDomainChrTypeToString(config->type));
|
virDomainChrTypeToString(config->type));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -619,12 +619,12 @@ qemuMonitorOpen(virDomainObjPtr vm,
|
|||||||
if (mon->fd == -1) goto cleanup;
|
if (mon->fd == -1) goto cleanup;
|
||||||
|
|
||||||
if (virSetCloseExec(mon->fd) < 0) {
|
if (virSetCloseExec(mon->fd) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("Unable to set monitor close-on-exec flag"));
|
"%s", _("Unable to set monitor close-on-exec flag"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
if (virSetNonBlock(mon->fd) < 0) {
|
if (virSetNonBlock(mon->fd) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("Unable to put monitor into non-blocking mode"));
|
"%s", _("Unable to put monitor into non-blocking mode"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -636,7 +636,7 @@ qemuMonitorOpen(virDomainObjPtr vm,
|
|||||||
VIR_EVENT_HANDLE_READABLE,
|
VIR_EVENT_HANDLE_READABLE,
|
||||||
qemuMonitorIO,
|
qemuMonitorIO,
|
||||||
mon, NULL)) < 0) {
|
mon, NULL)) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("unable to register monitor events"));
|
_("unable to register monitor events"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
@ -215,7 +215,7 @@ qemuMonitorJSONCommandWithFd(qemuMonitorPtr mon,
|
|||||||
|
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
if (!((*reply) = virJSONValueFromString(msg.rxBuffer))) {
|
if (!((*reply) = virJSONValueFromString(msg.rxBuffer))) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("cannot parse JSON doc '%s'"), msg.rxBuffer);
|
_("cannot parse JSON doc '%s'"), msg.rxBuffer);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -269,13 +269,13 @@ qemuMonitorJSONCheckError(virJSONValuePtr cmd,
|
|||||||
if (!error) {
|
if (!error) {
|
||||||
VIR_DEBUG("Saw a JSON error, but value is null for %s: %s",
|
VIR_DEBUG("Saw a JSON error, but value is null for %s: %s",
|
||||||
cmdstr, replystr);
|
cmdstr, replystr);
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("error running QEMU command '%s': '%s'"),
|
_("error running QEMU command '%s': '%s'"),
|
||||||
cmdstr, replystr);
|
cmdstr, replystr);
|
||||||
} else {
|
} else {
|
||||||
VIR_DEBUG("Got a JSON error set for %s", cmdstr);
|
VIR_DEBUG("Got a JSON error set for %s", cmdstr);
|
||||||
char *detail = qemuMonitorJSONStringifyError(error);
|
char *detail = qemuMonitorJSONStringifyError(error);
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("error running QEMU command '%s': %s ('%s')"),
|
_("error running QEMU command '%s': %s ('%s')"),
|
||||||
cmdstr, detail, replystr);
|
cmdstr, detail, replystr);
|
||||||
VIR_FREE(detail);
|
VIR_FREE(detail);
|
||||||
@ -289,7 +289,7 @@ qemuMonitorJSONCheckError(virJSONValuePtr cmd,
|
|||||||
|
|
||||||
VIR_DEBUG("Neither 'return' nor 'error' is set in the JSON reply %s: %s",
|
VIR_DEBUG("Neither 'return' nor 'error' is set in the JSON reply %s: %s",
|
||||||
cmdstr, replystr);
|
cmdstr, replystr);
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("error running QEMU command '%s': '%s'"), cmdstr, replystr);
|
_("error running QEMU command '%s': '%s'"), cmdstr, replystr);
|
||||||
VIR_FREE(cmdstr);
|
VIR_FREE(cmdstr);
|
||||||
VIR_FREE(replystr);
|
VIR_FREE(replystr);
|
||||||
@ -380,7 +380,7 @@ qemuMonitorJSONMakeCommand(const char *cmdname,
|
|||||||
char type;
|
char type;
|
||||||
|
|
||||||
if (strlen(key) < 3) {
|
if (strlen(key) < 3) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("argument key '%s' is too short, missing type prefix"),
|
_("argument key '%s' is too short, missing type prefix"),
|
||||||
key);
|
key);
|
||||||
goto error;
|
goto error;
|
||||||
@ -429,7 +429,7 @@ qemuMonitorJSONMakeCommand(const char *cmdname,
|
|||||||
ret = virJSONValueObjectAppendNull(jargs, key);
|
ret = virJSONValueObjectAppendNull(jargs, key);
|
||||||
} break;
|
} break;
|
||||||
default:
|
default:
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("unsupported data type '%c' for arg '%s'"), type, key - 2);
|
_("unsupported data type '%c' for arg '%s'"), type, key - 2);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
@ -551,19 +551,19 @@ qemuMonitorJSONExtractCPUInfo(virJSONValuePtr reply,
|
|||||||
int ncpus;
|
int ncpus;
|
||||||
|
|
||||||
if (!(data = virJSONValueObjectGet(reply, "return"))) {
|
if (!(data = virJSONValueObjectGet(reply, "return"))) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("cpu reply was missing return data"));
|
_("cpu reply was missing return data"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data->type != VIR_JSON_TYPE_ARRAY) {
|
if (data->type != VIR_JSON_TYPE_ARRAY) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("cpu information was not an array"));
|
_("cpu information was not an array"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((ncpus = virJSONValueArraySize(data)) <= 0) {
|
if ((ncpus = virJSONValueArraySize(data)) <= 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("cpu information was empty"));
|
_("cpu information was empty"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -578,25 +578,25 @@ qemuMonitorJSONExtractCPUInfo(virJSONValuePtr reply,
|
|||||||
int cpu;
|
int cpu;
|
||||||
int thread;
|
int thread;
|
||||||
if (!entry) {
|
if (!entry) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("character device information was missing aray element"));
|
_("character device information was missing aray element"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virJSONValueObjectGetNumberInt(entry, "CPU", &cpu) < 0) {
|
if (virJSONValueObjectGetNumberInt(entry, "CPU", &cpu) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("cpu information was missing cpu number"));
|
_("cpu information was missing cpu number"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virJSONValueObjectGetNumberInt(entry, "thread_id", &thread) < 0) {
|
if (virJSONValueObjectGetNumberInt(entry, "thread_id", &thread) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("cpu information was missing thread ID"));
|
_("cpu information was missing thread ID"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cpu != i) {
|
if (cpu != i) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("unexpected cpu index %d expecting %d"),
|
_("unexpected cpu index %d expecting %d"),
|
||||||
i, cpu);
|
i, cpu);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -676,14 +676,14 @@ int qemuMonitorJSONGetBalloonInfo(qemuMonitorPtr mon,
|
|||||||
unsigned long long mem;
|
unsigned long long mem;
|
||||||
|
|
||||||
if (!(data = virJSONValueObjectGet(reply, "return"))) {
|
if (!(data = virJSONValueObjectGet(reply, "return"))) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("info balloon reply was missing return data"));
|
_("info balloon reply was missing return data"));
|
||||||
ret = -1;
|
ret = -1;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virJSONValueObjectGetNumberUlong(data, "balloon", &mem) < 0) {
|
if (virJSONValueObjectGetNumberUlong(data, "balloon", &mem) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("info balloon reply was missing balloon data"));
|
_("info balloon reply was missing balloon data"));
|
||||||
ret = -1;
|
ret = -1;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -733,7 +733,7 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon,
|
|||||||
|
|
||||||
devices = virJSONValueObjectGet(reply, "return");
|
devices = virJSONValueObjectGet(reply, "return");
|
||||||
if (!devices || devices->type != VIR_JSON_TYPE_ARRAY) {
|
if (!devices || devices->type != VIR_JSON_TYPE_ARRAY) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("blockstats reply was missing device list"));
|
_("blockstats reply was missing device list"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -743,13 +743,13 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon,
|
|||||||
virJSONValuePtr stats;
|
virJSONValuePtr stats;
|
||||||
const char *thisdev;
|
const char *thisdev;
|
||||||
if (!dev || dev->type != VIR_JSON_TYPE_OBJECT) {
|
if (!dev || dev->type != VIR_JSON_TYPE_OBJECT) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("blockstats device entry was not in expected format"));
|
_("blockstats device entry was not in expected format"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((thisdev = virJSONValueObjectGetString(dev, "device")) == NULL) {
|
if ((thisdev = virJSONValueObjectGetString(dev, "device")) == NULL) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("blockstats device entry was not in expected format"));
|
_("blockstats device entry was not in expected format"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -760,31 +760,31 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon,
|
|||||||
found = 1;
|
found = 1;
|
||||||
if ((stats = virJSONValueObjectGet(dev, "stats")) == NULL ||
|
if ((stats = virJSONValueObjectGet(dev, "stats")) == NULL ||
|
||||||
stats->type != VIR_JSON_TYPE_OBJECT) {
|
stats->type != VIR_JSON_TYPE_OBJECT) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("blockstats stats entry was not in expected format"));
|
_("blockstats stats entry was not in expected format"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virJSONValueObjectGetNumberLong(stats, "rd_bytes", rd_bytes) < 0) {
|
if (virJSONValueObjectGetNumberLong(stats, "rd_bytes", rd_bytes) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("cannot read %s statistic"),
|
_("cannot read %s statistic"),
|
||||||
"rd_bytes");
|
"rd_bytes");
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
if (virJSONValueObjectGetNumberLong(stats, "rd_operations", rd_req) < 0) {
|
if (virJSONValueObjectGetNumberLong(stats, "rd_operations", rd_req) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("cannot read %s statistic"),
|
_("cannot read %s statistic"),
|
||||||
"rd_operations");
|
"rd_operations");
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
if (virJSONValueObjectGetNumberLong(stats, "wr_bytes", wr_bytes) < 0) {
|
if (virJSONValueObjectGetNumberLong(stats, "wr_bytes", wr_bytes) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("cannot read %s statistic"),
|
_("cannot read %s statistic"),
|
||||||
"wr_bytes");
|
"wr_bytes");
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
if (virJSONValueObjectGetNumberLong(stats, "wr_operations", wr_req) < 0) {
|
if (virJSONValueObjectGetNumberLong(stats, "wr_operations", wr_req) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("cannot read %s statistic"),
|
_("cannot read %s statistic"),
|
||||||
"wr_operations");
|
"wr_operations");
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -792,7 +792,7 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!found) {
|
if (!found) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("cannot find statistics for device '%s'"), devname);
|
_("cannot find statistics for device '%s'"), devname);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -1007,19 +1007,19 @@ qemuMonitorJSONGetMigrationStatusReply(virJSONValuePtr reply,
|
|||||||
const char *statusstr;
|
const char *statusstr;
|
||||||
|
|
||||||
if (!(ret = virJSONValueObjectGet(reply, "return"))) {
|
if (!(ret = virJSONValueObjectGet(reply, "return"))) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("info migration reply was missing return data"));
|
_("info migration reply was missing return data"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(statusstr = virJSONValueObjectGetString(ret, "status"))) {
|
if (!(statusstr = virJSONValueObjectGetString(ret, "status"))) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("info migration reply was missing return status"));
|
_("info migration reply was missing return status"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((*status = qemuMonitorMigrationStatusTypeFromString(statusstr)) < 0) {
|
if ((*status = qemuMonitorMigrationStatusTypeFromString(statusstr)) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("unexpected migration status in %s"), statusstr);
|
_("unexpected migration status in %s"), statusstr);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -1027,23 +1027,23 @@ qemuMonitorJSONGetMigrationStatusReply(virJSONValuePtr reply,
|
|||||||
if (*status == QEMU_MONITOR_MIGRATION_STATUS_ACTIVE) {
|
if (*status == QEMU_MONITOR_MIGRATION_STATUS_ACTIVE) {
|
||||||
virJSONValuePtr ram = virJSONValueObjectGet(ret, "ram");
|
virJSONValuePtr ram = virJSONValueObjectGet(ret, "ram");
|
||||||
if (!ram) {
|
if (!ram) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("migration was active, but no RAM info was set"));
|
_("migration was active, but no RAM info was set"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virJSONValueObjectGetNumberUlong(ram, "transferred", transferred) < 0) {
|
if (virJSONValueObjectGetNumberUlong(ram, "transferred", transferred) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("migration was active, but RAM 'transferred' data was missing"));
|
_("migration was active, but RAM 'transferred' data was missing"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (virJSONValueObjectGetNumberUlong(ram, "remaining", remaining) < 0) {
|
if (virJSONValueObjectGetNumberUlong(ram, "remaining", remaining) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("migration was active, but RAM 'remaining' data was missing"));
|
_("migration was active, but RAM 'remaining' data was missing"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (virJSONValueObjectGetNumberUlong(ram, "total", total) < 0) {
|
if (virJSONValueObjectGetNumberUlong(ram, "total", total) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("migration was active, but RAM 'total' data was missing"));
|
_("migration was active, but RAM 'total' data was missing"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -1299,31 +1299,31 @@ qemuMonitorJSONGetGuestPCIAddress(virJSONValuePtr reply,
|
|||||||
|
|
||||||
addr = virJSONValueObjectGet(reply, "return");
|
addr = virJSONValueObjectGet(reply, "return");
|
||||||
if (!addr || addr->type != VIR_JSON_TYPE_OBJECT) {
|
if (!addr || addr->type != VIR_JSON_TYPE_OBJECT) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("pci_add reply was missing device address"));
|
_("pci_add reply was missing device address"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virJSONValueObjectGetNumberUint(addr, "domain", &guestAddr->domain) < 0) {
|
if (virJSONValueObjectGetNumberUint(addr, "domain", &guestAddr->domain) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("pci_add reply was missing device domain number"));
|
_("pci_add reply was missing device domain number"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virJSONValueObjectGetNumberUint(addr, "bus", &guestAddr->bus) < 0) {
|
if (virJSONValueObjectGetNumberUint(addr, "bus", &guestAddr->bus) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("pci_add reply was missing device bus number"));
|
_("pci_add reply was missing device bus number"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virJSONValueObjectGetNumberUint(addr, "slot", &guestAddr->slot) < 0) {
|
if (virJSONValueObjectGetNumberUint(addr, "slot", &guestAddr->slot) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("pci_add reply was missing device slot number"));
|
_("pci_add reply was missing device slot number"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virJSONValueObjectGetNumberUint(addr, "function", &guestAddr->function) < 0) {
|
if (virJSONValueObjectGetNumberUint(addr, "function", &guestAddr->function) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("pci_add reply was missing device function number"));
|
_("pci_add reply was missing device function number"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -1589,13 +1589,13 @@ static int qemuMonitorJSONExtractPtyPaths(virJSONValuePtr reply,
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (!(data = virJSONValueObjectGet(reply, "return"))) {
|
if (!(data = virJSONValueObjectGet(reply, "return"))) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("character device reply was missing return data"));
|
_("character device reply was missing return data"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data->type != VIR_JSON_TYPE_ARRAY) {
|
if (data->type != VIR_JSON_TYPE_ARRAY) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("character device information was not an array"));
|
_("character device information was not an array"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -1605,19 +1605,19 @@ static int qemuMonitorJSONExtractPtyPaths(virJSONValuePtr reply,
|
|||||||
const char *type;
|
const char *type;
|
||||||
const char *id;
|
const char *id;
|
||||||
if (!entry) {
|
if (!entry) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("character device information was missing aray element"));
|
_("character device information was missing aray element"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(type = virJSONValueObjectGetString(entry, "filename"))) {
|
if (!(type = virJSONValueObjectGetString(entry, "filename"))) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("character device information was missing filename"));
|
_("character device information was missing filename"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(id = virJSONValueObjectGetString(entry, "label"))) {
|
if (!(id = virJSONValueObjectGetString(entry, "label"))) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("character device information was missing filename"));
|
_("character device information was missing filename"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -1630,7 +1630,7 @@ static int qemuMonitorJSONExtractPtyPaths(virJSONValuePtr reply,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (virHashAddEntry(paths, id, path) < 0) {
|
if (virHashAddEntry(paths, id, path) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("failed to save chardev path '%s'"), path);
|
_("failed to save chardev path '%s'"), path);
|
||||||
VIR_FREE(path);
|
VIR_FREE(path);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -1718,19 +1718,19 @@ qemuMonitorJSONGetGuestDriveAddress(virJSONValuePtr reply,
|
|||||||
|
|
||||||
addr = virJSONValueObjectGet(reply, "return");
|
addr = virJSONValueObjectGet(reply, "return");
|
||||||
if (!addr || addr->type != VIR_JSON_TYPE_OBJECT) {
|
if (!addr || addr->type != VIR_JSON_TYPE_OBJECT) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("drive_add reply was missing device address"));
|
_("drive_add reply was missing device address"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virJSONValueObjectGetNumberUint(addr, "bus", &driveAddr->bus) < 0) {
|
if (virJSONValueObjectGetNumberUint(addr, "bus", &driveAddr->bus) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("drive_add reply was missing device bus number"));
|
_("drive_add reply was missing device bus number"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virJSONValueObjectGetNumberUint(addr, "unit", &driveAddr->unit) < 0) {
|
if (virJSONValueObjectGetNumberUint(addr, "unit", &driveAddr->unit) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("drive_add reply was missing device unit number"));
|
_("drive_add reply was missing device unit number"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -1781,7 +1781,7 @@ int qemuMonitorJSONAttachDrive(qemuMonitorPtr mon,
|
|||||||
int qemuMonitorJSONGetAllPCIAddresses(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
|
int qemuMonitorJSONGetAllPCIAddresses(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
|
||||||
qemuMonitorPCIAddress **addrs ATTRIBUTE_UNUSED)
|
qemuMonitorPCIAddress **addrs ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("query-pci not suppported in JSON mode"));
|
_("query-pci not suppported in JSON mode"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -366,7 +366,7 @@ qemuMonitorTextStopCPUs(qemuMonitorPtr mon) {
|
|||||||
char *info;
|
char *info;
|
||||||
|
|
||||||
if (qemuMonitorCommand(mon, "stop", &info) < 0) {
|
if (qemuMonitorCommand(mon, "stop", &info) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
"%s", _("cannot stop CPU execution"));
|
"%s", _("cannot stop CPU execution"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -379,7 +379,7 @@ int qemuMonitorTextSystemPowerdown(qemuMonitorPtr mon) {
|
|||||||
char *info;
|
char *info;
|
||||||
|
|
||||||
if (qemuMonitorCommand(mon, "system_powerdown", &info) < 0) {
|
if (qemuMonitorCommand(mon, "system_powerdown", &info) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
"%s", _("system shutdown operation failed"));
|
"%s", _("system shutdown operation failed"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -398,7 +398,7 @@ int qemuMonitorTextGetCPUInfo(qemuMonitorPtr mon,
|
|||||||
size_t ncpupids = 0;
|
size_t ncpupids = 0;
|
||||||
|
|
||||||
if (qemuMonitorCommand(mon, "info cpus", &qemucpus) < 0) {
|
if (qemuMonitorCommand(mon, "info cpus", &qemucpus) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("cannot run monitor command to fetch CPU thread info"));
|
"%s", _("cannot run monitor command to fetch CPU thread info"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -550,7 +550,7 @@ int qemuMonitorTextGetBalloonInfo(qemuMonitorPtr mon,
|
|||||||
char *offset;
|
char *offset;
|
||||||
|
|
||||||
if (qemuMonitorCommand(mon, "info balloon", &reply) < 0) {
|
if (qemuMonitorCommand(mon, "info balloon", &reply) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
"%s", _("could not query memory balloon allocation"));
|
"%s", _("could not query memory balloon allocation"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -560,7 +560,7 @@ int qemuMonitorTextGetBalloonInfo(qemuMonitorPtr mon,
|
|||||||
char *end;
|
char *end;
|
||||||
offset += strlen(BALLOON_PREFIX);
|
offset += strlen(BALLOON_PREFIX);
|
||||||
if (virStrToLong_ui(offset, &end, 10, &memMB) < 0) {
|
if (virStrToLong_ui(offset, &end, 10, &memMB) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("could not parse memory balloon allocation from '%s'"), reply);
|
_("could not parse memory balloon allocation from '%s'"), reply);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -587,7 +587,7 @@ int qemuMonitorTextGetMemoryStats(qemuMonitorPtr mon,
|
|||||||
char *offset;
|
char *offset;
|
||||||
|
|
||||||
if (qemuMonitorCommand(mon, "info balloon", &reply) < 0) {
|
if (qemuMonitorCommand(mon, "info balloon", &reply) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
"%s", _("could not query memory balloon statistics"));
|
"%s", _("could not query memory balloon statistics"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -618,7 +618,7 @@ int qemuMonitorTextGetBlockStatsInfo(qemuMonitorPtr mon,
|
|||||||
int devnamelen = strlen(devname);
|
int devnamelen = strlen(devname);
|
||||||
|
|
||||||
if (qemuMonitorCommand (mon, "info blockstats", &info) < 0) {
|
if (qemuMonitorCommand (mon, "info blockstats", &info) < 0) {
|
||||||
qemudReportError (NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
"%s", _("'info blockstats' command failed"));
|
"%s", _("'info blockstats' command failed"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -629,7 +629,7 @@ int qemuMonitorTextGetBlockStatsInfo(qemuMonitorPtr mon,
|
|||||||
* to detect if qemu supports the command.
|
* to detect if qemu supports the command.
|
||||||
*/
|
*/
|
||||||
if (strstr(info, "\ninfo ")) {
|
if (strstr(info, "\ninfo ")) {
|
||||||
qemudReportError (NULL, NULL, NULL, VIR_ERR_NO_SUPPORT,
|
qemuReportError(VIR_ERR_NO_SUPPORT,
|
||||||
"%s",
|
"%s",
|
||||||
_("'info blockstats' not supported by this qemu"));
|
_("'info blockstats' not supported by this qemu"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -694,7 +694,7 @@ int qemuMonitorTextGetBlockStatsInfo(qemuMonitorPtr mon,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* If we reach here then the device was not found. */
|
/* If we reach here then the device was not found. */
|
||||||
qemudReportError (NULL, NULL, NULL, VIR_ERR_INVALID_ARG,
|
qemuReportError (VIR_ERR_INVALID_ARG,
|
||||||
_("no stats found for device %s"), devname);
|
_("no stats found for device %s"), devname);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
@ -741,7 +741,7 @@ int qemuMonitorTextSetVNCPassword(qemuMonitorPtr mon,
|
|||||||
qemuMonitorSendVNCPassphrase,
|
qemuMonitorSendVNCPassphrase,
|
||||||
(char *)password,
|
(char *)password,
|
||||||
-1, &info) < 0) {
|
-1, &info) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("setting VNC password failed"));
|
"%s", _("setting VNC password failed"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -770,7 +770,7 @@ int qemuMonitorTextSetBalloon(qemuMonitorPtr mon,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (qemuMonitorCommand(mon, cmd, &reply) < 0) {
|
if (qemuMonitorCommand(mon, cmd, &reply) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
"%s", _("could not balloon memory allocation"));
|
"%s", _("could not balloon memory allocation"));
|
||||||
VIR_FREE(cmd);
|
VIR_FREE(cmd);
|
||||||
return -1;
|
return -1;
|
||||||
@ -803,7 +803,7 @@ int qemuMonitorTextEjectMedia(qemuMonitorPtr mon,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (qemuMonitorCommand(mon, cmd, &reply) < 0) {
|
if (qemuMonitorCommand(mon, cmd, &reply) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("could not eject media on %s"), devname);
|
_("could not eject media on %s"), devname);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -812,7 +812,7 @@ int qemuMonitorTextEjectMedia(qemuMonitorPtr mon,
|
|||||||
* device not found, device is locked ...
|
* device not found, device is locked ...
|
||||||
* No message is printed on success it seems */
|
* No message is printed on success it seems */
|
||||||
if (strstr(reply, "\ndevice ")) {
|
if (strstr(reply, "\ndevice ")) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("could not eject media on %s: %s"), devname, reply);
|
_("could not eject media on %s: %s"), devname, reply);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -847,7 +847,7 @@ int qemuMonitorTextChangeMedia(qemuMonitorPtr mon,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (qemuMonitorCommand(mon, cmd, &reply) < 0) {
|
if (qemuMonitorCommand(mon, cmd, &reply) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("could not eject media on %s"), devname);
|
_("could not eject media on %s"), devname);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -856,7 +856,7 @@ int qemuMonitorTextChangeMedia(qemuMonitorPtr mon,
|
|||||||
* device not found, device is locked ...
|
* device not found, device is locked ...
|
||||||
* No message is printed on success it seems */
|
* No message is printed on success it seems */
|
||||||
if (strstr(reply, "\ndevice ")) {
|
if (strstr(reply, "\ndevice ")) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("could not eject media on %s: %s"), devname, reply);
|
_("could not eject media on %s: %s"), devname, reply);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -892,7 +892,7 @@ static int qemuMonitorTextSaveMemory(qemuMonitorPtr mon,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (qemuMonitorCommand(mon, cmd, &reply) < 0) {
|
if (qemuMonitorCommand(mon, cmd, &reply) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("could save memory region to '%s'"), path);
|
_("could save memory region to '%s'"), path);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -939,7 +939,7 @@ int qemuMonitorTextSetMigrationSpeed(qemuMonitorPtr mon,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (qemuMonitorCommand(mon, cmd, &info) < 0) {
|
if (qemuMonitorCommand(mon, cmd, &info) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
"%s", _("could restrict migration speed"));
|
"%s", _("could restrict migration speed"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -974,7 +974,7 @@ int qemuMonitorTextGetMigrationStatus(qemuMonitorPtr mon,
|
|||||||
*total = 0;
|
*total = 0;
|
||||||
|
|
||||||
if (qemuMonitorCommand(mon, "info migrate", &reply) < 0) {
|
if (qemuMonitorCommand(mon, "info migrate", &reply) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
"%s", _("cannot query migration status"));
|
"%s", _("cannot query migration status"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -985,7 +985,7 @@ int qemuMonitorTextGetMigrationStatus(qemuMonitorPtr mon,
|
|||||||
*end = '\0';
|
*end = '\0';
|
||||||
|
|
||||||
if ((*status = qemuMonitorMigrationStatusTypeFromString(tmp)) < 0) {
|
if ((*status = qemuMonitorMigrationStatusTypeFromString(tmp)) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("unexpected migration status in %s"), reply);
|
_("unexpected migration status in %s"), reply);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -998,7 +998,7 @@ int qemuMonitorTextGetMigrationStatus(qemuMonitorPtr mon,
|
|||||||
tmp += strlen(MIGRATION_TRANSFER_PREFIX);
|
tmp += strlen(MIGRATION_TRANSFER_PREFIX);
|
||||||
|
|
||||||
if (virStrToLong_ull(tmp, NULL, 10, transferred) < 0) {
|
if (virStrToLong_ull(tmp, NULL, 10, transferred) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("cannot parse migration data transferred statistic %s"), tmp);
|
_("cannot parse migration data transferred statistic %s"), tmp);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -1009,7 +1009,7 @@ int qemuMonitorTextGetMigrationStatus(qemuMonitorPtr mon,
|
|||||||
tmp += strlen(MIGRATION_REMAINING_PREFIX);
|
tmp += strlen(MIGRATION_REMAINING_PREFIX);
|
||||||
|
|
||||||
if (virStrToLong_ull(tmp, NULL, 10, remaining) < 0) {
|
if (virStrToLong_ull(tmp, NULL, 10, remaining) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("cannot parse migration data remaining statistic %s"), tmp);
|
_("cannot parse migration data remaining statistic %s"), tmp);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -1020,7 +1020,7 @@ int qemuMonitorTextGetMigrationStatus(qemuMonitorPtr mon,
|
|||||||
tmp += strlen(MIGRATION_TOTAL_PREFIX);
|
tmp += strlen(MIGRATION_TOTAL_PREFIX);
|
||||||
|
|
||||||
if (virStrToLong_ull(tmp, NULL, 10, total) < 0) {
|
if (virStrToLong_ull(tmp, NULL, 10, total) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("cannot parse migration data total statistic %s"), tmp);
|
_("cannot parse migration data total statistic %s"), tmp);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -1064,21 +1064,21 @@ static int qemuMonitorTextMigrate(qemuMonitorPtr mon,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (qemuMonitorCommand(mon, cmd, &info) < 0) {
|
if (qemuMonitorCommand(mon, cmd, &info) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("unable to start migration to %s"), dest);
|
_("unable to start migration to %s"), dest);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now check for "fail" in the output string */
|
/* Now check for "fail" in the output string */
|
||||||
if (strstr(info, "fail") != NULL) {
|
if (strstr(info, "fail") != NULL) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("migration to '%s' failed: %s"), dest, info);
|
_("migration to '%s' failed: %s"), dest, info);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
/* If the command isn't supported then qemu prints:
|
/* If the command isn't supported then qemu prints:
|
||||||
* unknown command: migrate" */
|
* unknown command: migrate" */
|
||||||
if (strstr(info, "unknown command:")) {
|
if (strstr(info, "unknown command:")) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_NO_SUPPORT,
|
qemuReportError(VIR_ERR_NO_SUPPORT,
|
||||||
_("migration to '%s' not supported by this qemu: %s"), dest, info);
|
_("migration to '%s' not supported by this qemu: %s"), dest, info);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -1175,7 +1175,7 @@ int qemuMonitorTextMigrateCancel(qemuMonitorPtr mon)
|
|||||||
char *info = NULL;
|
char *info = NULL;
|
||||||
|
|
||||||
if (qemuMonitorCommand(mon, "migrate_cancel", &info) < 0) {
|
if (qemuMonitorCommand(mon, "migrate_cancel", &info) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("cannot run monitor command to cancel migration"));
|
"%s", _("cannot run monitor command to cancel migration"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -1204,7 +1204,7 @@ int qemuMonitorTextAddUSBDisk(qemuMonitorPtr mon,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (qemuMonitorCommand(mon, cmd, &info) < 0) {
|
if (qemuMonitorCommand(mon, cmd, &info) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("cannot run monitor command to add usb disk"));
|
"%s", _("cannot run monitor command to add usb disk"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -1212,7 +1212,7 @@ int qemuMonitorTextAddUSBDisk(qemuMonitorPtr mon,
|
|||||||
/* If the command failed qemu prints:
|
/* If the command failed qemu prints:
|
||||||
* Could not add ... */
|
* Could not add ... */
|
||||||
if (strstr(info, "Could not add ")) {
|
if (strstr(info, "Could not add ")) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("unable to add USB disk %s: %s"), path, info);
|
_("unable to add USB disk %s: %s"), path, info);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -1239,7 +1239,7 @@ static int qemuMonitorTextAddUSBDevice(qemuMonitorPtr mon,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (qemuMonitorCommand(mon, cmd, &reply) < 0) {
|
if (qemuMonitorCommand(mon, cmd, &reply) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
"%s", _("cannot attach usb device"));
|
"%s", _("cannot attach usb device"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -1247,7 +1247,7 @@ static int qemuMonitorTextAddUSBDevice(qemuMonitorPtr mon,
|
|||||||
/* If the command failed qemu prints:
|
/* If the command failed qemu prints:
|
||||||
* Could not add ... */
|
* Could not add ... */
|
||||||
if (strstr(reply, "Could not add ")) {
|
if (strstr(reply, "Could not add ")) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
"%s", _("adding usb device failed"));
|
"%s", _("adding usb device failed"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -1380,19 +1380,19 @@ int qemuMonitorTextAddPCIHostDevice(qemuMonitorPtr mon,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (qemuMonitorCommand(mon, cmd, &reply) < 0) {
|
if (qemuMonitorCommand(mon, cmd, &reply) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
"%s", _("cannot attach host pci device"));
|
"%s", _("cannot attach host pci device"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strstr(reply, "invalid type: host")) {
|
if (strstr(reply, "invalid type: host")) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_NO_SUPPORT, "%s",
|
qemuReportError(VIR_ERR_NO_SUPPORT, "%s",
|
||||||
_("PCI device assignment is not supported by this version of qemu"));
|
_("PCI device assignment is not supported by this version of qemu"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qemuMonitorTextParsePciAddReply(mon, reply, guestAddr) < 0) {
|
if (qemuMonitorTextParsePciAddReply(mon, reply, guestAddr) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("parsing pci_add reply failed: %s"), reply);
|
_("parsing pci_add reply failed: %s"), reply);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -1431,7 +1431,7 @@ try_command:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (qemuMonitorCommand(mon, cmd, &reply) < 0) {
|
if (qemuMonitorCommand(mon, cmd, &reply) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("cannot attach %s disk %s"), bus, path);
|
_("cannot attach %s disk %s"), bus, path);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -1444,7 +1444,7 @@ try_command:
|
|||||||
goto try_command;
|
goto try_command;
|
||||||
}
|
}
|
||||||
|
|
||||||
qemudReportError (NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("adding %s disk failed %s: %s"), bus, path, reply);
|
_("adding %s disk failed %s: %s"), bus, path, reply);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -1473,13 +1473,13 @@ int qemuMonitorTextAddPCINetwork(qemuMonitorPtr mon,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (qemuMonitorCommand(mon, cmd, &reply) < 0) {
|
if (qemuMonitorCommand(mon, cmd, &reply) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("failed to add NIC with '%s'"), cmd);
|
_("failed to add NIC with '%s'"), cmd);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qemuMonitorTextParsePciAddReply(mon, reply, guestAddr) < 0) {
|
if (qemuMonitorTextParsePciAddReply(mon, reply, guestAddr) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("parsing pci_add reply failed: %s"), reply);
|
_("parsing pci_add reply failed: %s"), reply);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -1517,7 +1517,7 @@ try_command:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (qemuMonitorCommand(mon, cmd, &reply) < 0) {
|
if (qemuMonitorCommand(mon, cmd, &reply) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
"%s", _("failed to remove PCI device"));
|
"%s", _("failed to remove PCI device"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -1536,7 +1536,7 @@ try_command:
|
|||||||
* nothing is printed on success */
|
* nothing is printed on success */
|
||||||
if (strstr(reply, "invalid slot") ||
|
if (strstr(reply, "invalid slot") ||
|
||||||
strstr(reply, "Invalid pci address")) {
|
strstr(reply, "Invalid pci address")) {
|
||||||
qemudReportError (NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("failed to detach PCI device, invalid address %.4x:%.2x:%.2x: %s"),
|
_("failed to detach PCI device, invalid address %.4x:%.2x:%.2x: %s"),
|
||||||
guestAddr->domain, guestAddr->bus, guestAddr->slot, reply);
|
guestAddr->domain, guestAddr->bus, guestAddr->slot, reply);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -1565,7 +1565,7 @@ int qemuMonitorTextSendFileHandle(qemuMonitorPtr mon,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (qemuMonitorCommandWithFd(mon, cmd, fd, &reply) < 0) {
|
if (qemuMonitorCommandWithFd(mon, cmd, fd, &reply) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("failed to pass fd to qemu with '%s'"), cmd);
|
_("failed to pass fd to qemu with '%s'"), cmd);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -1573,7 +1573,7 @@ int qemuMonitorTextSendFileHandle(qemuMonitorPtr mon,
|
|||||||
/* If the command isn't supported then qemu prints:
|
/* If the command isn't supported then qemu prints:
|
||||||
* unknown command: getfd" */
|
* unknown command: getfd" */
|
||||||
if (strstr(reply, "unknown command:")) {
|
if (strstr(reply, "unknown command:")) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_NO_SUPPORT,
|
qemuReportError(VIR_ERR_NO_SUPPORT,
|
||||||
_("qemu does not support sending of file handles: %s"),
|
_("qemu does not support sending of file handles: %s"),
|
||||||
reply);
|
reply);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -1601,7 +1601,7 @@ int qemuMonitorTextCloseFileHandle(qemuMonitorPtr mon,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (qemuMonitorCommand(mon, cmd, &reply) < 0) {
|
if (qemuMonitorCommand(mon, cmd, &reply) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("failed to close fd in qemu with '%s'"), cmd);
|
_("failed to close fd in qemu with '%s'"), cmd);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -1609,7 +1609,7 @@ int qemuMonitorTextCloseFileHandle(qemuMonitorPtr mon,
|
|||||||
/* If the command isn't supported then qemu prints:
|
/* If the command isn't supported then qemu prints:
|
||||||
* unknown command: getfd" */
|
* unknown command: getfd" */
|
||||||
if (strstr(reply, "unknown command:")) {
|
if (strstr(reply, "unknown command:")) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_NO_SUPPORT,
|
qemuReportError(VIR_ERR_NO_SUPPORT,
|
||||||
_("qemu does not support closing of file handles: %s"),
|
_("qemu does not support closing of file handles: %s"),
|
||||||
reply);
|
reply);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -1637,7 +1637,7 @@ int qemuMonitorTextAddHostNetwork(qemuMonitorPtr mon,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (qemuMonitorCommand(mon, cmd, &reply) < 0) {
|
if (qemuMonitorCommand(mon, cmd, &reply) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("failed to close fd in qemu with '%s'"), cmd);
|
_("failed to close fd in qemu with '%s'"), cmd);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -1667,7 +1667,7 @@ int qemuMonitorTextRemoveHostNetwork(qemuMonitorPtr mon,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (qemuMonitorCommand(mon, cmd, &reply) < 0) {
|
if (qemuMonitorCommand(mon, cmd, &reply) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("failed to remove host network in qemu with '%s'"), cmd);
|
_("failed to remove host network in qemu with '%s'"), cmd);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -1702,7 +1702,7 @@ int qemuMonitorTextGetPtyPaths(qemuMonitorPtr mon,
|
|||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
if (qemuMonitorCommand(mon, "info chardev", &reply) < 0) {
|
if (qemuMonitorCommand(mon, "info chardev", &reply) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED, "%s",
|
qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
|
||||||
_("failed to retrieve chardev info in qemu with 'info chardev'"));
|
_("failed to retrieve chardev info in qemu with 'info chardev'"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -1753,7 +1753,7 @@ int qemuMonitorTextGetPtyPaths(qemuMonitorPtr mon,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (virHashAddEntry(paths, id, path) < 0) {
|
if (virHashAddEntry(paths, id, path) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("failed to save chardev path '%s'"),
|
_("failed to save chardev path '%s'"),
|
||||||
path);
|
path);
|
||||||
VIR_FREE(path);
|
VIR_FREE(path);
|
||||||
@ -1787,7 +1787,7 @@ try_command:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (qemuMonitorCommand(mon, cmd, &reply) < 0) {
|
if (qemuMonitorCommand(mon, cmd, &reply) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("cannot attach %s disk controller"), bus);
|
_("cannot attach %s disk controller"), bus);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -1800,7 +1800,7 @@ try_command:
|
|||||||
goto try_command;
|
goto try_command;
|
||||||
}
|
}
|
||||||
|
|
||||||
qemudReportError (NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("adding %s disk controller failed: %s"), bus, reply);
|
_("adding %s disk controller failed: %s"), bus, reply);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -1887,7 +1887,7 @@ try_command:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (qemuMonitorCommand(mon, cmd, &reply) < 0) {
|
if (qemuMonitorCommand(mon, cmd, &reply) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("failed to close fd in qemu with '%s'"), cmd);
|
_("failed to close fd in qemu with '%s'"), cmd);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -1899,7 +1899,7 @@ try_command:
|
|||||||
tryOldSyntax = 1;
|
tryOldSyntax = 1;
|
||||||
goto try_command;
|
goto try_command;
|
||||||
}
|
}
|
||||||
qemudReportError (NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("adding %s disk failed: %s"), drivestr, reply);
|
_("adding %s disk failed: %s"), drivestr, reply);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -1954,7 +1954,7 @@ cleanup:
|
|||||||
(p) += strlen(lbl);
|
(p) += strlen(lbl);
|
||||||
#define GET_INT(p, base, val) \
|
#define GET_INT(p, base, val) \
|
||||||
if (virStrToLong_ui((p), &(p), (base), &(val)) < 0) { \
|
if (virStrToLong_ui((p), &(p), (base), &(val)) < 0) { \
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED, \
|
qemuReportError(VIR_ERR_OPERATION_FAILED, \
|
||||||
_("cannot parse value for %s"), #val); \
|
_("cannot parse value for %s"), #val); \
|
||||||
break; \
|
break; \
|
||||||
}
|
}
|
||||||
@ -1972,7 +1972,7 @@ int qemuMonitorTextGetAllPCIAddresses(qemuMonitorPtr mon,
|
|||||||
*retaddrs = NULL;
|
*retaddrs = NULL;
|
||||||
|
|
||||||
if (qemuMonitorCommand(mon, "info pci", &reply) < 0) {
|
if (qemuMonitorCommand(mon, "info pci", &reply) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
"%s", _("cannot query PCI addresses"));
|
"%s", _("cannot query PCI addresses"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -2064,13 +2064,13 @@ int qemuMonitorTextAddDevice(qemuMonitorPtr mon,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (qemuMonitorCommand(mon, cmd, &reply) < 0) {
|
if (qemuMonitorCommand(mon, cmd, &reply) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("cannot attach %s device"), devicestr);
|
_("cannot attach %s device"), devicestr);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (STRNEQ(reply, "")) {
|
if (STRNEQ(reply, "")) {
|
||||||
qemudReportError (NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("adding %s device failed: %s"), devicestr, reply);
|
_("adding %s device failed: %s"), devicestr, reply);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -2107,7 +2107,7 @@ int qemuMonitorTextAddDrive(qemuMonitorPtr mon,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (qemuMonitorCommand(mon, cmd, &reply) < 0) {
|
if (qemuMonitorCommand(mon, cmd, &reply) < 0) {
|
||||||
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
|
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("failed to close fd in qemu with '%s'"), cmd);
|
_("failed to close fd in qemu with '%s'"), cmd);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ static int testCompareXMLToArgvFiles(const char *xml,
|
|||||||
if (virtTestLoadFile(xml, &expectxml, MAX_FILE) < 0)
|
if (virtTestLoadFile(xml, &expectxml, MAX_FILE) < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
if (!(vmdef = qemuParseCommandLineString(NULL, driver.caps, cmd)))
|
if (!(vmdef = qemuParseCommandLineString(driver.caps, cmd)))
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
if (!(actualxml = virDomainDefFormat(NULL, vmdef, 0)))
|
if (!(actualxml = virDomainDefFormat(NULL, vmdef, 0)))
|
||||||
|
Loading…
Reference in New Issue
Block a user