goto cleanup;
if (mon->json)
- rc = qemuMonitorJSONQueryCPUs(mon, &cpuentries, &ncpuentries);
+ rc = qemuMonitorJSONQueryCPUs(mon, &cpuentries, &ncpuentries, hotplug);
else
rc = qemuMonitorTextQueryCPUs(mon, &cpuentries, &ncpuentries);
if (rc < 0) {
- if (rc == -2) {
+ if (!hotplug && rc == -2) {
VIR_STEAL_PTR(*vcpus, info);
ret = 0;
}
QEMU_CHECK_MONITOR_NULL(mon);
if (mon->json)
- rc = qemuMonitorJSONQueryCPUs(mon, &cpuentries, &ncpuentries);
+ rc = qemuMonitorJSONQueryCPUs(mon, &cpuentries, &ncpuentries, false);
else
rc = qemuMonitorTextQueryCPUs(mon, &cpuentries, &ncpuentries);
int
qemuMonitorJSONQueryCPUs(qemuMonitorPtr mon,
struct qemuMonitorQueryCpusEntry **entries,
- size_t *nentries)
+ size_t *nentries,
+ bool force)
{
int ret = -1;
virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("query-cpus", NULL);
if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
goto cleanup;
+ if (force && qemuMonitorJSONCheckError(cmd, reply) < 0)
+ goto cleanup;
+
if (!(data = virJSONValueObjectGetArray(reply, "return"))) {
ret = -2;
goto cleanup;
int qemuMonitorJSONQueryCPUs(qemuMonitorPtr mon,
struct qemuMonitorQueryCpusEntry **entries,
- size_t *nentries);
+ size_t *nentries,
+ bool force);
int qemuMonitorJSONGetVirtType(qemuMonitorPtr mon,
virDomainVirtType *virtType);
int qemuMonitorJSONUpdateVideoMemorySize(qemuMonitorPtr mon,
goto cleanup;
if (qemuMonitorJSONQueryCPUs(qemuMonitorTestGetMonitor(test),
- &cpudata, &ncpudata) < 0)
+ &cpudata, &ncpudata, true) < 0)
goto cleanup;
if (ncpudata != 4) {