size_t maxvcpus = virDomainDefGetVcpusMax(vm->def);
size_t i, j;
bool hotplug;
- bool fast;
bool validTIDs = true;
int rc;
int ret = -1;
hotplug = qemuDomainSupportsNewVcpuHotplug(vm);
- fast = virQEMUCapsGet(QEMU_DOMAIN_PRIVATE(vm)->qemuCaps,
- QEMU_CAPS_QUERY_CPUS_FAST);
-
- VIR_DEBUG("Maxvcpus %zu hotplug %d fast query %d", maxvcpus, hotplug, fast);
+ VIR_DEBUG("Maxvcpus %zu hotplug %d", maxvcpus, hotplug);
if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
return -1;
rc = qemuMonitorGetCPUInfo(qemuDomainGetMonitor(vm), &info, maxvcpus,
- hotplug, fast);
+ hotplug);
qemuDomainObjExitMonitor(vm);
goto cleanup;
/*
- * The query-cpus[-fast] commands return information
+ * The query-cpus-fast commands return information
* about the vCPUs, including the OS level PID that
* is executing the vCPU.
*
size_t maxvcpus = virDomainDefGetVcpusMax(vm->def);
g_autoptr(virBitmap) haltedmap = NULL;
size_t i;
- bool fast;
/* Not supported currently for TCG, see qemuDomainRefreshVcpuInfo */
if (vm->def->virtType == VIR_DOMAIN_VIRT_QEMU)
/* The halted state is interesting only on s390(x). On other platforms
* the data would be stale at the time when it would be used.
- * Calling qemuMonitorGetCpuHalted() can adversely affect the running
- * VM's performance unless QEMU supports query-cpus-fast.
*/
- if (!ARCH_IS_S390(vm->def->os.arch) ||
- !virQEMUCapsGet(QEMU_DOMAIN_PRIVATE(vm)->qemuCaps,
- QEMU_CAPS_QUERY_CPUS_FAST))
+ if (!ARCH_IS_S390(vm->def->os.arch))
return 0;
if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
return -1;
- fast = virQEMUCapsGet(QEMU_DOMAIN_PRIVATE(vm)->qemuCaps,
- QEMU_CAPS_QUERY_CPUS_FAST);
- haltedmap = qemuMonitorGetCpuHalted(qemuDomainGetMonitor(vm), maxvcpus,
- fast);
+ haltedmap = qemuMonitorGetCpuHalted(qemuDomainGetMonitor(vm), maxvcpus);
qemuDomainObjExitMonitor(vm);
if (!haltedmap)
*
* This function stitches together data retrieved via query-hotpluggable-cpus
* which returns entities on the hotpluggable level (which may describe more
- * than one guest logical vcpu) with the output of query-cpus (or
- * query-cpus-fast), having an entry per enabled guest logical vcpu.
+ * than one guest logical vcpu) with the output of query-cpus-fast,
+ * having an entry per enabled guest logical vcpu.
*
* query-hotpluggable-cpus conveys following information:
* - topology information and number of logical vcpus this entry creates
* - device type name of the entry that needs to be used when hotplugging
* - qom path in qemu which can be used to map the entry against
- * query-cpus[-fast]
+ * query-cpus-fast
*
- * query-cpus[-fast] conveys following information:
+ * query-cpus-fast conveys following information:
* - thread id of a given guest logical vcpu
* - order in which the vcpus were inserted
* - qom path to allow mapping the two together
for (i = 0; i < nhotplugvcpus; i++)
totalvcpus += hotplugvcpus[i].vcpus;
- /* trim '/thread...' suffix from the data returned by query-cpus[-fast] */
+ /* trim '/thread...' suffix from the data returned by query-cpus-fast */
for (i = 0; i < ncpuentries; i++) {
if (cpuentries[i].qom_path &&
(tmp = strstr(cpuentries[i].qom_path, "/thread")))
}
/* Note the order in which the hotpluggable entities are inserted by
- * matching them to the query-cpus[-fast] entries */
+ * matching them to the query-cpus-fast entries */
for (i = 0; i < ncpuentries; i++) {
for (j = 0; j < nhotplugvcpus; j++) {
if (!cpuentries[i].qom_path ||
}
if (anyvcpu == maxvcpus) {
- VIR_DEBUG("too many query-cpus[-fast] entries for a given "
+ VIR_DEBUG("too many query-cpus-fast entries for a given "
"query-hotpluggable-cpus entry");
return -1;
}
* @vcpus: pointer filled by array of qemuMonitorCPUInfo structures
* @maxvcpus: total possible number of vcpus
* @hotplug: query data relevant for hotplug support
- * @fast: use QMP query-cpus-fast if supported
*
* Detects VCPU information. If qemu doesn't support or fails reporting
* information this function will return success as other parts of libvirt
qemuMonitorGetCPUInfo(qemuMonitor *mon,
qemuMonitorCPUInfo **vcpus,
size_t maxvcpus,
- bool hotplug,
- bool fast)
+ bool hotplug)
{
struct qemuMonitorQueryHotpluggableCpusEntry *hotplugcpus = NULL;
size_t nhotplugcpus = 0;
(qemuMonitorJSONGetHotpluggableCPUs(mon, &hotplugcpus, &nhotplugcpus)) < 0)
goto cleanup;
- rc = qemuMonitorJSONQueryCPUs(mon, &cpuentries, &ncpuentries, hotplug,
- fast);
+ rc = qemuMonitorJSONQueryCPUs(mon, &cpuentries, &ncpuentries, hotplug);
if (rc < 0) {
if (!hotplug && rc == -2) {
* qemuMonitorGetCpuHalted:
*
* Returns a bitmap of vcpu id's that are halted. The id's correspond to the
- * 'CPU' field as reported by query-cpus[-fast]'.
+ * 'CPU' field as reported by query-cpus-fast'.
*/
virBitmap *
qemuMonitorGetCpuHalted(qemuMonitor *mon,
- size_t maxvcpus,
- bool fast)
+ size_t maxvcpus)
{
struct qemuMonitorQueryCpusEntry *cpuentries = NULL;
size_t ncpuentries = 0;
QEMU_CHECK_MONITOR_NULL(mon);
- rc = qemuMonitorJSONQueryCPUs(mon, &cpuentries, &ncpuentries, false,
- fast);
+ rc = qemuMonitorJSONQueryCPUs(mon, &cpuentries, &ncpuentries, false);
if (rc < 0)
goto cleanup;
int qemuMonitorGetCPUInfo(qemuMonitor *mon,
qemuMonitorCPUInfo **vcpus,
size_t maxvcpus,
- bool hotplug,
- bool fast);
+ bool hotplug);
virBitmap *qemuMonitorGetCpuHalted(qemuMonitor *mon,
- size_t maxvcpus,
- bool fast);
+ size_t maxvcpus);
int qemuMonitorGetBalloonInfo(qemuMonitor *mon,
unsigned long long *currmem);
* @data: JSON response data
* @entries: filled with detected cpu entries on success
* @nentries: number of entries returned
- * @fast: true if this is a response from query-cpus-fast
*
* The JSON response @data will have the following format
- * in case @fast == false
- * [{ "arch": "x86",
- * "current": true,
- * "CPU": 0,
- * "qom_path": "/machine/unattached/device[0]",
- * "pc": -2130415978,
- * "halted": true,
- * "thread_id": 2631237,
- * ...},
- * {...}
- * ]
- * and for @fast == true
* [{ "arch": "x86",
* "cpu-index": 0,
* "props": {
static int
qemuMonitorJSONExtractCPUInfo(virJSONValue *data,
struct qemuMonitorQueryCpusEntry **entries,
- size_t *nentries,
- bool fast)
+ size_t *nentries)
{
const char *arch = NULL;
struct qemuMonitorQueryCpusEntry *cpus = NULL;
* non-fatal, simply returning no data.
* The return data of query-cpus-fast has different field names
*/
- if (fast) {
- if (!(arch = virJSONValueObjectGetString(entry, "target")))
- arch = virJSONValueObjectGetString(entry, "arch");
- ignore_value(virJSONValueObjectGetNumberInt(entry, "cpu-index", &cpuid));
- ignore_value(virJSONValueObjectGetNumberInt(entry, "thread-id", &thread));
- qom_path = virJSONValueObjectGetString(entry, "qom-path");
- } else {
+ if (!(arch = virJSONValueObjectGetString(entry, "target")))
arch = virJSONValueObjectGetString(entry, "arch");
- ignore_value(virJSONValueObjectGetNumberInt(entry, "CPU", &cpuid));
- ignore_value(virJSONValueObjectGetNumberInt(entry, "thread_id", &thread));
- ignore_value(virJSONValueObjectGetBoolean(entry, "halted", &halted));
- qom_path = virJSONValueObjectGetString(entry, "qom_path");
- }
+ ignore_value(virJSONValueObjectGetNumberInt(entry, "cpu-index", &cpuid));
+ ignore_value(virJSONValueObjectGetNumberInt(entry, "thread-id", &thread));
+ qom_path = virJSONValueObjectGetString(entry, "qom-path");
cpus[i].qemu_id = cpuid;
cpus[i].tid = thread;
* @entries: filled with detected entries on success
* @nentries: number of entries returned
* @force: force exit on error
- * @fast: use query-cpus-fast
*
* Queries qemu for cpu-related information. Failure to execute the command or
* extract results does not produce an error as libvirt can continue without
qemuMonitorJSONQueryCPUs(qemuMonitor *mon,
struct qemuMonitorQueryCpusEntry **entries,
size_t *nentries,
- bool force,
- bool fast)
+ bool force)
{
g_autoptr(virJSONValue) cmd = NULL;
g_autoptr(virJSONValue) reply = NULL;
virJSONValue *data;
- if (fast)
- cmd = qemuMonitorJSONMakeCommand("query-cpus-fast", NULL);
- else
- cmd = qemuMonitorJSONMakeCommand("query-cpus", NULL);
-
+ cmd = qemuMonitorJSONMakeCommand("query-cpus-fast", NULL);
if (!cmd)
return -1;
if (!(data = virJSONValueObjectGetArray(reply, "return")))
return -2;
- return qemuMonitorJSONExtractCPUInfo(data, entries, nentries, fast);
+ return qemuMonitorJSONExtractCPUInfo(data, entries, nentries);
}
qemuMonitorJSONQueryCPUs(qemuMonitor *mon,
struct qemuMonitorQueryCpusEntry **entries,
size_t *nentries,
- bool force,
- bool fast);
+ bool force);
int
qemuMonitorJSONUpdateVideoMemorySize(qemuMonitor *mon,
virDomainVideoDef *video,
int ret = -1;
if (qemuMonitorJSONQueryCPUs(qemuMonitorTestGetMonitor(test),
- &cpudata, &ncpudata, true, true) < 0)
+ &cpudata, &ncpudata, true) < 0)
goto cleanup;
if (ncpudata != num) {
goto cleanup;
rc = qemuMonitorGetCPUInfo(qemuMonitorTestGetMonitor(test),
- &vcpus, data->maxvcpus, true, true);
+ &vcpus, data->maxvcpus, true);
if (rc < 0)
goto cleanup;