mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 07:05:28 +00:00
Remove unnecessary curly brackets in src/qemu/
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
df6c14e6a8
commit
5cca4cd16f
@ -381,9 +381,8 @@ static int qemuAgentIOProcessData(qemuAgentPtr mon,
|
|||||||
int got = nl - (data + used);
|
int got = nl - (data + used);
|
||||||
for (i = 0; i < strlen(LINE_ENDING); i++)
|
for (i = 0; i < strlen(LINE_ENDING); i++)
|
||||||
data[used + got + i] = '\0';
|
data[used + got + i] = '\0';
|
||||||
if (qemuAgentIOProcessLine(mon, data + used, msg) < 0) {
|
if (qemuAgentIOProcessLine(mon, data + used, msg) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
used += got + strlen(LINE_ENDING);
|
used += got + strlen(LINE_ENDING);
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
|
@ -1179,9 +1179,8 @@ virQEMUCapsComputeCmdFlags(const char *help,
|
|||||||
if (is_kvm && (version >= 10000 || kvm_version >= 74))
|
if (is_kvm && (version >= 10000 || kvm_version >= 74))
|
||||||
virQEMUCapsSet(qemuCaps, QEMU_CAPS_VNET_HDR);
|
virQEMUCapsSet(qemuCaps, QEMU_CAPS_VNET_HDR);
|
||||||
|
|
||||||
if (strstr(help, ",vhost=")) {
|
if (strstr(help, ",vhost="))
|
||||||
virQEMUCapsSet(qemuCaps, QEMU_CAPS_VHOST_NET);
|
virQEMUCapsSet(qemuCaps, QEMU_CAPS_VHOST_NET);
|
||||||
}
|
|
||||||
|
|
||||||
/* Do not use -no-shutdown if qemu doesn't support it or SIGTERM handling
|
/* Do not use -no-shutdown if qemu doesn't support it or SIGTERM handling
|
||||||
* is most likely buggy when used with -no-shutdown (which applies for qemu
|
* is most likely buggy when used with -no-shutdown (which applies for qemu
|
||||||
@ -1947,9 +1946,8 @@ void virQEMUCapsDispose(void *obj)
|
|||||||
VIR_FREE(qemuCaps->machineAliases);
|
VIR_FREE(qemuCaps->machineAliases);
|
||||||
VIR_FREE(qemuCaps->machineMaxCpus);
|
VIR_FREE(qemuCaps->machineMaxCpus);
|
||||||
|
|
||||||
for (i = 0; i < qemuCaps->ncpuDefinitions; i++) {
|
for (i = 0; i < qemuCaps->ncpuDefinitions; i++)
|
||||||
VIR_FREE(qemuCaps->cpuDefinitions[i]);
|
VIR_FREE(qemuCaps->cpuDefinitions[i]);
|
||||||
}
|
|
||||||
VIR_FREE(qemuCaps->cpuDefinitions);
|
VIR_FREE(qemuCaps->cpuDefinitions);
|
||||||
|
|
||||||
virBitmapFree(qemuCaps->flags);
|
virBitmapFree(qemuCaps->flags);
|
||||||
@ -2837,9 +2835,8 @@ virQEMUCapsReset(virQEMUCapsPtr qemuCaps)
|
|||||||
qemuCaps->arch = VIR_ARCH_NONE;
|
qemuCaps->arch = VIR_ARCH_NONE;
|
||||||
qemuCaps->usedQMP = false;
|
qemuCaps->usedQMP = false;
|
||||||
|
|
||||||
for (i = 0; i < qemuCaps->ncpuDefinitions; i++) {
|
for (i = 0; i < qemuCaps->ncpuDefinitions; i++)
|
||||||
VIR_FREE(qemuCaps->cpuDefinitions[i]);
|
VIR_FREE(qemuCaps->cpuDefinitions[i]);
|
||||||
}
|
|
||||||
VIR_FREE(qemuCaps->cpuDefinitions);
|
VIR_FREE(qemuCaps->cpuDefinitions);
|
||||||
qemuCaps->ncpuDefinitions = 0;
|
qemuCaps->ncpuDefinitions = 0;
|
||||||
|
|
||||||
|
@ -920,10 +920,9 @@ qemuSetupCgroupVcpuPin(virCgroupPtr cgroup,
|
|||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
for (i = 0; i < nvcpupin; i++) {
|
for (i = 0; i < nvcpupin; i++) {
|
||||||
if (vcpuid == vcpupin[i]->vcpuid) {
|
if (vcpuid == vcpupin[i]->vcpuid)
|
||||||
return qemuSetupCgroupEmulatorPin(cgroup, vcpupin[i]->cpumask);
|
return qemuSetupCgroupEmulatorPin(cgroup, vcpupin[i]->cpumask);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -937,10 +936,9 @@ qemuSetupCgroupIOThreadsPin(virCgroupPtr cgroup,
|
|||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
for (i = 0; i < niothreadspin; i++) {
|
for (i = 0; i < niothreadspin; i++) {
|
||||||
if (iothreadid == iothreadspin[i]->vcpuid) {
|
if (iothreadid == iothreadspin[i]->vcpuid)
|
||||||
return qemuSetupCgroupEmulatorPin(cgroup, iothreadspin[i]->cpumask);
|
return qemuSetupCgroupEmulatorPin(cgroup, iothreadspin[i]->cpumask);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -8862,10 +8862,9 @@ qemuBuildCommandLine(virConnectPtr conn,
|
|||||||
_("network disks are only supported with -drive"));
|
_("network disks are only supported with -drive"));
|
||||||
goto error;
|
goto error;
|
||||||
} else {
|
} else {
|
||||||
if (VIR_STRDUP(file, disk->src->path) < 0) {
|
if (VIR_STRDUP(file, disk->src->path) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* Don't start with source if the tray is open for
|
/* Don't start with source if the tray is open for
|
||||||
* CDROM and Floppy device.
|
* CDROM and Floppy device.
|
||||||
@ -10144,9 +10143,8 @@ static int qemuStringToArgvEnv(const char *args,
|
|||||||
|
|
||||||
start = curr;
|
start = curr;
|
||||||
/* accept a space in CEPH_ARGS */
|
/* accept a space in CEPH_ARGS */
|
||||||
if (STRPREFIX(curr, "CEPH_ARGS=-m ")) {
|
if (STRPREFIX(curr, "CEPH_ARGS=-m "))
|
||||||
start += strlen("CEPH_ARGS=-m ");
|
start += strlen("CEPH_ARGS=-m ");
|
||||||
}
|
|
||||||
if (*start == '\'') {
|
if (*start == '\'') {
|
||||||
if (start == curr)
|
if (start == curr)
|
||||||
curr++;
|
curr++;
|
||||||
|
@ -1018,9 +1018,8 @@ qemuSharedDeviceEntryFree(void *payload, const void *name ATTRIBUTE_UNUSED)
|
|||||||
if (!entry)
|
if (!entry)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (i = 0; i < entry->ref; i++) {
|
for (i = 0; i < entry->ref; i++)
|
||||||
VIR_FREE(entry->domains[i]);
|
VIR_FREE(entry->domains[i]);
|
||||||
}
|
|
||||||
VIR_FREE(entry->domains);
|
VIR_FREE(entry->domains);
|
||||||
VIR_FREE(entry);
|
VIR_FREE(entry);
|
||||||
}
|
}
|
||||||
|
@ -495,9 +495,8 @@ qemuDomainObjPrivateXMLFormat(virBufferPtr buf, void *data)
|
|||||||
size_t i;
|
size_t i;
|
||||||
virBufferAddLit(buf, "<vcpus>\n");
|
virBufferAddLit(buf, "<vcpus>\n");
|
||||||
virBufferAdjustIndent(buf, 2);
|
virBufferAdjustIndent(buf, 2);
|
||||||
for (i = 0; i < priv->nvcpupids; i++) {
|
for (i = 0; i < priv->nvcpupids; i++)
|
||||||
virBufferAsprintf(buf, "<vcpu pid='%d'/>\n", priv->vcpupids[i]);
|
virBufferAsprintf(buf, "<vcpu pid='%d'/>\n", priv->vcpupids[i]);
|
||||||
}
|
|
||||||
virBufferAdjustIndent(buf, -2);
|
virBufferAdjustIndent(buf, -2);
|
||||||
virBufferAddLit(buf, "</vcpus>\n");
|
virBufferAddLit(buf, "</vcpus>\n");
|
||||||
}
|
}
|
||||||
|
@ -995,10 +995,9 @@ qemuStateStop(void)
|
|||||||
for (i = 0; i < numDomains; i++) {
|
for (i = 0; i < numDomains; i++) {
|
||||||
flags[i] = VIR_DOMAIN_SAVE_RUNNING;
|
flags[i] = VIR_DOMAIN_SAVE_RUNNING;
|
||||||
if (virDomainGetState(domains[i], &state, NULL, 0) == 0) {
|
if (virDomainGetState(domains[i], &state, NULL, 0) == 0) {
|
||||||
if (state == VIR_DOMAIN_PAUSED) {
|
if (state == VIR_DOMAIN_PAUSED)
|
||||||
flags[i] = VIR_DOMAIN_SAVE_PAUSED;
|
flags[i] = VIR_DOMAIN_SAVE_PAUSED;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
virDomainSuspend(domains[i]);
|
virDomainSuspend(domains[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1840,9 +1839,8 @@ static int qemuDomainSuspend(virDomainPtr dom)
|
|||||||
"%s", _("domain is pmsuspended"));
|
"%s", _("domain is pmsuspended"));
|
||||||
goto endjob;
|
goto endjob;
|
||||||
} else if (state != VIR_DOMAIN_PAUSED) {
|
} else if (state != VIR_DOMAIN_PAUSED) {
|
||||||
if (qemuProcessStopCPUs(driver, vm, reason, QEMU_ASYNC_JOB_NONE) < 0) {
|
if (qemuProcessStopCPUs(driver, vm, reason, QEMU_ASYNC_JOB_NONE) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
|
||||||
|
|
||||||
if (eventDetail >= 0) {
|
if (eventDetail >= 0) {
|
||||||
event = virDomainEventLifecycleNewFromObj(vm,
|
event = virDomainEventLifecycleNewFromObj(vm,
|
||||||
@ -4043,9 +4041,8 @@ processGuestPanicEvent(virQEMUDriverPtr driver,
|
|||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case VIR_DOMAIN_LIFECYCLE_CRASH_COREDUMP_DESTROY:
|
case VIR_DOMAIN_LIFECYCLE_CRASH_COREDUMP_DESTROY:
|
||||||
if (doCoreDumpToAutoDumpPath(driver, vm, VIR_DUMP_MEMORY_ONLY) < 0) {
|
if (doCoreDumpToAutoDumpPath(driver, vm, VIR_DUMP_MEMORY_ONLY) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
|
||||||
/* fall through */
|
/* fall through */
|
||||||
|
|
||||||
case VIR_DOMAIN_LIFECYCLE_CRASH_DESTROY:
|
case VIR_DOMAIN_LIFECYCLE_CRASH_DESTROY:
|
||||||
@ -4074,15 +4071,13 @@ processGuestPanicEvent(virQEMUDriverPtr driver,
|
|||||||
|
|
||||||
virDomainAuditStop(vm, "destroyed");
|
virDomainAuditStop(vm, "destroyed");
|
||||||
|
|
||||||
if (!vm->persistent) {
|
if (!vm->persistent)
|
||||||
qemuDomainRemoveInactive(driver, vm);
|
qemuDomainRemoveInactive(driver, vm);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_DOMAIN_LIFECYCLE_CRASH_COREDUMP_RESTART:
|
case VIR_DOMAIN_LIFECYCLE_CRASH_COREDUMP_RESTART:
|
||||||
if (doCoreDumpToAutoDumpPath(driver, vm, VIR_DUMP_MEMORY_ONLY) < 0) {
|
if (doCoreDumpToAutoDumpPath(driver, vm, VIR_DUMP_MEMORY_ONLY) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
|
||||||
/* fall through */
|
/* fall through */
|
||||||
|
|
||||||
case VIR_DOMAIN_LIFECYCLE_CRASH_RESTART:
|
case VIR_DOMAIN_LIFECYCLE_CRASH_RESTART:
|
||||||
@ -4955,9 +4950,8 @@ qemuDomainGetVcpuPinInfo(virDomainPtr dom,
|
|||||||
&targetDef) < 0)
|
&targetDef) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (flags & VIR_DOMAIN_AFFECT_LIVE) {
|
if (flags & VIR_DOMAIN_AFFECT_LIVE)
|
||||||
targetDef = vm->def;
|
targetDef = vm->def;
|
||||||
}
|
|
||||||
|
|
||||||
/* Coverity didn't realize that targetDef must be set if we got here. */
|
/* Coverity didn't realize that targetDef must be set if we got here. */
|
||||||
sa_assert(targetDef);
|
sa_assert(targetDef);
|
||||||
@ -4973,9 +4967,8 @@ qemuDomainGetVcpuPinInfo(virDomainPtr dom,
|
|||||||
if (ncpumaps > targetDef->vcpus)
|
if (ncpumaps > targetDef->vcpus)
|
||||||
ncpumaps = targetDef->vcpus;
|
ncpumaps = targetDef->vcpus;
|
||||||
|
|
||||||
if (ncpumaps < 1) {
|
if (ncpumaps < 1)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
|
||||||
|
|
||||||
/* initialize cpumaps */
|
/* initialize cpumaps */
|
||||||
memset(cpumaps, 0xff, maplen * ncpumaps);
|
memset(cpumaps, 0xff, maplen * ncpumaps);
|
||||||
@ -5233,9 +5226,8 @@ qemuDomainGetEmulatorPinInfo(virDomainPtr dom,
|
|||||||
|
|
||||||
/* initialize cpumaps */
|
/* initialize cpumaps */
|
||||||
memset(cpumaps, 0xff, maplen);
|
memset(cpumaps, 0xff, maplen);
|
||||||
if (maxcpu % 8) {
|
if (maxcpu % 8)
|
||||||
cpumaps[maplen - 1] &= (1 << maxcpu % 8) - 1;
|
cpumaps[maplen - 1] &= (1 << maxcpu % 8) - 1;
|
||||||
}
|
|
||||||
|
|
||||||
if (targetDef->cputune.emulatorpin) {
|
if (targetDef->cputune.emulatorpin) {
|
||||||
cpumask = targetDef->cputune.emulatorpin->cpumask;
|
cpumask = targetDef->cputune.emulatorpin->cpumask;
|
||||||
@ -9532,9 +9524,8 @@ qemuSetEmulatorBandwidthLive(virDomainObjPtr vm, virCgroupPtr cgroup,
|
|||||||
if (period == 0 && quota == 0)
|
if (period == 0 && quota == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (priv->nvcpupids == 0 || priv->vcpupids[0] == vm->pid) {
|
if (priv->nvcpupids == 0 || priv->vcpupids[0] == vm->pid)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
|
|
||||||
if (virCgroupNewEmulator(cgroup, false, &cgroup_emulator) < 0)
|
if (virCgroupNewEmulator(cgroup, false, &cgroup_emulator) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -10510,12 +10501,10 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
|
|||||||
/* average is mandatory, peak and burst are optional. So if no
|
/* average is mandatory, peak and burst are optional. So if no
|
||||||
* average is given, we free inbound/outbound here which causes
|
* average is given, we free inbound/outbound here which causes
|
||||||
* inbound/outbound to not be set. */
|
* inbound/outbound to not be set. */
|
||||||
if (!bandwidth->in->average) {
|
if (!bandwidth->in->average)
|
||||||
VIR_FREE(bandwidth->in);
|
VIR_FREE(bandwidth->in);
|
||||||
}
|
if (!bandwidth->out->average)
|
||||||
if (!bandwidth->out->average) {
|
|
||||||
VIR_FREE(bandwidth->out);
|
VIR_FREE(bandwidth->out);
|
||||||
}
|
|
||||||
|
|
||||||
if (flags & VIR_DOMAIN_AFFECT_LIVE) {
|
if (flags & VIR_DOMAIN_AFFECT_LIVE) {
|
||||||
if (VIR_ALLOC(newBandwidth) < 0)
|
if (VIR_ALLOC(newBandwidth) < 0)
|
||||||
@ -14860,9 +14849,8 @@ qemuDomainSnapshotReparentChildren(void *payload,
|
|||||||
virDomainSnapshotObjPtr snap = payload;
|
virDomainSnapshotObjPtr snap = payload;
|
||||||
virQEMUSnapReparentPtr rep = data;
|
virQEMUSnapReparentPtr rep = data;
|
||||||
|
|
||||||
if (rep->err < 0) {
|
if (rep->err < 0)
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
VIR_FREE(snap->def->parent);
|
VIR_FREE(snap->def->parent);
|
||||||
snap->parent = rep->parent;
|
snap->parent = rep->parent;
|
||||||
@ -15036,9 +15024,8 @@ static int qemuDomainQemuMonitorCommand(virDomainPtr domain, const char *cmd,
|
|||||||
qemuDomainObjExitMonitor(driver, vm);
|
qemuDomainObjExitMonitor(driver, vm);
|
||||||
|
|
||||||
endjob:
|
endjob:
|
||||||
if (!qemuDomainObjEndJob(driver, vm)) {
|
if (!qemuDomainObjEndJob(driver, vm))
|
||||||
vm = NULL;
|
vm = NULL;
|
||||||
}
|
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
if (vm)
|
if (vm)
|
||||||
@ -15905,9 +15892,8 @@ qemuDomainBlockCopyCommon(virDomainObjPtr vm,
|
|||||||
}
|
}
|
||||||
|
|
||||||
device = qemuDiskPathToAlias(vm, path, &idx);
|
device = qemuDiskPathToAlias(vm, path, &idx);
|
||||||
if (!device) {
|
if (!device)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
|
||||||
disk = vm->def->disks[idx];
|
disk = vm->def->disks[idx];
|
||||||
if (disk->mirror) {
|
if (disk->mirror) {
|
||||||
virReportError(VIR_ERR_BLOCK_COPY_ACTIVE,
|
virReportError(VIR_ERR_BLOCK_COPY_ACTIVE,
|
||||||
@ -17032,9 +17018,8 @@ qemuDomainGetBlockIoTune(virDomainPtr dom,
|
|||||||
}
|
}
|
||||||
|
|
||||||
device = qemuDiskPathToAlias(vm, disk, NULL);
|
device = qemuDiskPathToAlias(vm, disk, NULL);
|
||||||
if (!device) {
|
if (!device)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
|
||||||
|
|
||||||
if (flags & VIR_DOMAIN_AFFECT_LIVE) {
|
if (flags & VIR_DOMAIN_AFFECT_LIVE) {
|
||||||
qemuDomainObjEnterMonitor(driver, vm);
|
qemuDomainObjEnterMonitor(driver, vm);
|
||||||
|
@ -468,10 +468,9 @@ int qemuDomainAttachControllerDevice(virQEMUDriverPtr driver,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(devstr = qemuBuildControllerDevStr(vm->def, controller, priv->qemuCaps, NULL))) {
|
if (!(devstr = qemuBuildControllerDevStr(vm->def, controller, priv->qemuCaps, NULL)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (VIR_REALLOC_N(vm->def->controllers, vm->def->ncontrollers+1) < 0)
|
if (VIR_REALLOC_N(vm->def->controllers, vm->def->ncontrollers+1) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -3095,10 +3094,9 @@ qemuFindDisk(virDomainDefPtr def, const char *dst)
|
|||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
for (i = 0; i < def->ndisks; i++) {
|
for (i = 0; i < def->ndisks; i++) {
|
||||||
if (STREQ(def->disks[i]->dst, dst)) {
|
if (STREQ(def->disks[i]->dst, dst))
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -2853,9 +2853,8 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver,
|
|||||||
qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_FAILED, 0);
|
qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_FAILED, 0);
|
||||||
|
|
||||||
endjob:
|
endjob:
|
||||||
if (!qemuMigrationJobFinish(driver, vm)) {
|
if (!qemuMigrationJobFinish(driver, vm))
|
||||||
vm = NULL;
|
vm = NULL;
|
||||||
}
|
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -565,9 +565,8 @@ static void qemuMonitorJSONHandleWatchdog(qemuMonitorPtr mon, virJSONValuePtr da
|
|||||||
{
|
{
|
||||||
const char *action;
|
const char *action;
|
||||||
int actionID;
|
int actionID;
|
||||||
if (!(action = virJSONValueObjectGetString(data, "action"))) {
|
if (!(action = virJSONValueObjectGetString(data, "action")))
|
||||||
VIR_WARN("missing action in watchdog event");
|
VIR_WARN("missing action in watchdog event");
|
||||||
}
|
|
||||||
if (action) {
|
if (action) {
|
||||||
if ((actionID = qemuMonitorWatchdogActionTypeFromString(action)) < 0) {
|
if ((actionID = qemuMonitorWatchdogActionTypeFromString(action)) < 0) {
|
||||||
VIR_WARN("unknown action %s in watchdog event", action);
|
VIR_WARN("unknown action %s in watchdog event", action);
|
||||||
@ -602,9 +601,8 @@ qemuMonitorJSONHandleIOError(qemuMonitorPtr mon, virJSONValuePtr data)
|
|||||||
action = "ignore";
|
action = "ignore";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((device = virJSONValueObjectGetString(data, "device")) == NULL) {
|
if ((device = virJSONValueObjectGetString(data, "device")) == NULL)
|
||||||
VIR_WARN("missing device in disk io error event");
|
VIR_WARN("missing device in disk io error event");
|
||||||
}
|
|
||||||
|
|
||||||
if (virJSONValueObjectGetBoolean(data, "nospace", &nospc) == 0 && nospc)
|
if (virJSONValueObjectGetBoolean(data, "nospace", &nospc) == 0 && nospc)
|
||||||
reason = "enospc";
|
reason = "enospc";
|
||||||
@ -4451,9 +4449,8 @@ int qemuMonitorJSONGetBlockIoThrottle(qemuMonitorPtr mon,
|
|||||||
virJSONValuePtr result = NULL;
|
virJSONValuePtr result = NULL;
|
||||||
|
|
||||||
cmd = qemuMonitorJSONMakeCommand("query-block", NULL);
|
cmd = qemuMonitorJSONMakeCommand("query-block", NULL);
|
||||||
if (!cmd) {
|
if (!cmd)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
|
|
||||||
ret = qemuMonitorJSONCommand(mon, cmd, &result);
|
ret = qemuMonitorJSONCommand(mon, cmd, &result);
|
||||||
|
|
||||||
@ -4485,9 +4482,8 @@ int qemuMonitorJSONSystemWakeup(qemuMonitorPtr mon)
|
|||||||
virJSONValuePtr reply = NULL;
|
virJSONValuePtr reply = NULL;
|
||||||
|
|
||||||
cmd = qemuMonitorJSONMakeCommand("system_wakeup", NULL);
|
cmd = qemuMonitorJSONMakeCommand("system_wakeup", NULL);
|
||||||
if (!cmd) {
|
if (!cmd)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
|
|
||||||
ret = qemuMonitorJSONCommand(mon, cmd, &reply);
|
ret = qemuMonitorJSONCommand(mon, cmd, &reply);
|
||||||
|
|
||||||
|
@ -123,10 +123,9 @@ int qemuMonitorTextIOProcess(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
|
|||||||
*/
|
*/
|
||||||
if (msg->txLength > 0) {
|
if (msg->txLength > 0) {
|
||||||
char *tmp;
|
char *tmp;
|
||||||
if ((tmp = strchr(msg->txBuffer, '\r'))) {
|
if ((tmp = strchr(msg->txBuffer, '\r')))
|
||||||
*tmp = '\0';
|
*tmp = '\0';
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* QEMU echos the command back to us, full of control
|
/* QEMU echos the command back to us, full of control
|
||||||
* character junk that we don't want. We have to skip
|
* character junk that we don't want. We have to skip
|
||||||
@ -144,9 +143,8 @@ int qemuMonitorTextIOProcess(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
|
|||||||
skip = strstr(data + used, msg->txBuffer);
|
skip = strstr(data + used, msg->txBuffer);
|
||||||
|
|
||||||
/* After the junk we should have a line ending... */
|
/* After the junk we should have a line ending... */
|
||||||
if (skip) {
|
if (skip)
|
||||||
start = strstr(skip + strlen(msg->txBuffer), LINE_ENDING);
|
start = strstr(skip + strlen(msg->txBuffer), LINE_ENDING);
|
||||||
}
|
|
||||||
|
|
||||||
/* ... then our command reply data, following by a (qemu) prompt */
|
/* ... then our command reply data, following by a (qemu) prompt */
|
||||||
if (start) {
|
if (start) {
|
||||||
|
@ -627,9 +627,8 @@ qemuProcessFakeReboot(void *opaque)
|
|||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
if (vm) {
|
if (vm) {
|
||||||
if (ret == -1) {
|
if (ret == -1)
|
||||||
ignore_value(qemuProcessKill(vm, VIR_QEMU_PROCESS_KILL_FORCE));
|
ignore_value(qemuProcessKill(vm, VIR_QEMU_PROCESS_KILL_FORCE));
|
||||||
}
|
|
||||||
if (virObjectUnref(vm))
|
if (virObjectUnref(vm))
|
||||||
virObjectUnlock(vm);
|
virObjectUnlock(vm);
|
||||||
}
|
}
|
||||||
@ -1830,9 +1829,8 @@ qemuProcessExtractTTYPath(const char *haystack,
|
|||||||
|
|
||||||
VIR_FREE(*path);
|
VIR_FREE(*path);
|
||||||
/* First look for our magic string */
|
/* First look for our magic string */
|
||||||
if (!(tmp = strstr(haystack + *offset, needle))) {
|
if (!(tmp = strstr(haystack + *offset, needle)))
|
||||||
return 1;
|
return 1;
|
||||||
}
|
|
||||||
tmp += sizeof(needle);
|
tmp += sizeof(needle);
|
||||||
dev = tmp;
|
dev = tmp;
|
||||||
|
|
||||||
@ -3470,9 +3468,8 @@ qemuProcessReconnect(void *opaque)
|
|||||||
priv->agentError = true;
|
priv->agentError = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qemuUpdateActivePCIHostdevs(driver, obj->def) < 0) {
|
if (qemuUpdateActivePCIHostdevs(driver, obj->def) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
}
|
|
||||||
|
|
||||||
if (qemuUpdateActiveUSBHostdevs(driver, obj->def) < 0)
|
if (qemuUpdateActiveUSBHostdevs(driver, obj->def) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
@ -4511,9 +4508,8 @@ int qemuProcessStart(virConnectPtr conn,
|
|||||||
}
|
}
|
||||||
|
|
||||||
VIR_DEBUG("Writing early domain status to disk");
|
VIR_DEBUG("Writing early domain status to disk");
|
||||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0) {
|
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
|
||||||
|
|
||||||
VIR_DEBUG("Waiting for handshake from child");
|
VIR_DEBUG("Waiting for handshake from child");
|
||||||
if (virCommandHandshakeWait(cmd) < 0) {
|
if (virCommandHandshakeWait(cmd) < 0) {
|
||||||
@ -4562,9 +4558,8 @@ int qemuProcessStart(virConnectPtr conn,
|
|||||||
}
|
}
|
||||||
|
|
||||||
VIR_DEBUG("Labelling done, completing handshake to child");
|
VIR_DEBUG("Labelling done, completing handshake to child");
|
||||||
if (virCommandHandshakeNotify(cmd) < 0) {
|
if (virCommandHandshakeNotify(cmd) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
|
||||||
VIR_DEBUG("Handshake complete, child running");
|
VIR_DEBUG("Handshake complete, child running");
|
||||||
|
|
||||||
if (migrateFrom)
|
if (migrateFrom)
|
||||||
@ -4929,9 +4924,8 @@ void qemuProcessStop(virQEMUDriverPtr driver,
|
|||||||
|
|
||||||
/* Clear out dynamically assigned labels */
|
/* Clear out dynamically assigned labels */
|
||||||
for (i = 0; i < vm->def->nseclabels; i++) {
|
for (i = 0; i < vm->def->nseclabels; i++) {
|
||||||
if (vm->def->seclabels[i]->type == VIR_DOMAIN_SECLABEL_DYNAMIC) {
|
if (vm->def->seclabels[i]->type == VIR_DOMAIN_SECLABEL_DYNAMIC)
|
||||||
VIR_FREE(vm->def->seclabels[i]->label);
|
VIR_FREE(vm->def->seclabels[i]->label);
|
||||||
}
|
|
||||||
VIR_FREE(vm->def->seclabels[i]->imagelabel);
|
VIR_FREE(vm->def->seclabels[i]->imagelabel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user