vcpus++;
}
- /* hotplug succeeded */
-
- ret = 0;
-
/* After hotplugging the CPUs we need to re-detect threads corresponding
* to the virtual CPUs. Some older versions don't provide the thread ID
* or don't have the "info cpus" command (and they don't support multiple
* fatal */
if ((ncpupids = qemuMonitorGetCPUInfo(priv->mon, &cpupids)) <= 0) {
virResetLastError();
+ ret = 0;
goto exit_monitor;
}
- if (qemuDomainObjExitMonitor(driver, vm) < 0) {
- ret = -1;
+
+ if (qemuDomainObjExitMonitor(driver, vm) < 0)
goto cleanup;
- }
if (ncpupids != vcpus) {
virReportError(VIR_ERR_INTERNAL_ERROR,
"got %d, wanted %d"),
ncpupids, vcpus);
vcpus = oldvcpus;
- ret = -1;
goto cleanup;
}
if (vm->def->cpumask) {
if (qemuDomainHotplugAddPin(vm->def->cpumask, i,
&vm->def->cputune.vcpupin,
- &vm->def->cputune.nvcpupin) < 0) {
- ret = -1;
+ &vm->def->cputune.nvcpupin) < 0)
goto cleanup;
- }
+
if (qemuDomainHotplugPinThread(vm->def->cpumask, i, cpupids[i],
- cgroup_vcpu) < 0) {
- ret = -1;
+ cgroup_vcpu) < 0)
goto cleanup;
- }
}
virCgroupFree(&cgroup_vcpu);
priv->vcpupids = cpupids;
cpupids = NULL;
+ ret = 0;
+
cleanup:
VIR_FREE(cpupids);
VIR_FREE(mem_mask);
vcpus--;
}
- ret = 0;
-
/* After hotplugging the CPUs we need to re-detect threads corresponding
* to the virtual CPUs. Some older versions don't provide the thread ID
* or don't have the "info cpus" command (and they don't support multiple
* fatal */
if ((ncpupids = qemuMonitorGetCPUInfo(priv->mon, &cpupids)) <= 0) {
virResetLastError();
+ ret = 0;
goto exit_monitor;
}
- if (qemuDomainObjExitMonitor(driver, vm) < 0) {
- ret = -1;
+ if (qemuDomainObjExitMonitor(driver, vm) < 0)
goto cleanup;
- }
/* check if hotunplug has failed */
if (ncpupids == oldvcpus) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("qemu didn't unplug the vCPUs properly"));
vcpus = oldvcpus;
- ret = -1;
goto cleanup;
}
"got %d, wanted %d"),
ncpupids, vcpus);
vcpus = oldvcpus;
- ret = -1;
goto cleanup;
}
priv->vcpupids = cpupids;
cpupids = NULL;
+ ret = 0;
+
cleanup:
VIR_FREE(cpupids);
if (virDomainObjIsActive(vm) &&