/**
- * qemuMonitorJSONGetGuestCPU:
+ * qemuMonitorJSONGetGuestCPUx86:
* @mon: Pointer to the monitor
- * @arch: arch of the guest
* @data: returns the cpu data
* @disabled: returns the CPU data for features which were disabled by QEMU
*
* -1 on other errors.
*/
int
-qemuMonitorGetGuestCPU(qemuMonitorPtr mon,
- virArch arch,
- virCPUDataPtr *data,
- virCPUDataPtr *disabled)
+qemuMonitorGetGuestCPUx86(qemuMonitorPtr mon,
+ virCPUDataPtr *data,
+ virCPUDataPtr *disabled)
{
- VIR_DEBUG("arch=%s data=%p disabled=%p",
- virArchToString(arch), data, disabled);
+ VIR_DEBUG("data=%p disabled=%p", data, disabled);
QEMU_CHECK_MONITOR(mon);
if (disabled)
*disabled = NULL;
- return qemuMonitorJSONGetGuestCPU(mon, arch, data, disabled);
+ return qemuMonitorJSONGetGuestCPUx86(mon, data, disabled);
}
void *opaque,
virFreeCallback destroy);
-int qemuMonitorGetGuestCPU(qemuMonitorPtr mon,
- virArch arch,
- virCPUDataPtr *data,
- virCPUDataPtr *disabled);
+int qemuMonitorGetGuestCPUx86(qemuMonitorPtr mon,
+ virCPUDataPtr *data,
+ virCPUDataPtr *disabled);
int qemuMonitorRTCResetReinjection(qemuMonitorPtr mon);
/**
- * qemuMonitorJSONGetGuestCPU:
+ * qemuMonitorJSONGetGuestCPUx86:
* @mon: Pointer to the monitor
- * @arch: arch of the guest
* @data: returns the cpu data of the guest
* @disabled: returns the CPU data for features which were disabled by QEMU
*
* -1 on other errors.
*/
int
-qemuMonitorJSONGetGuestCPU(qemuMonitorPtr mon,
- virArch arch,
- virCPUDataPtr *data,
- virCPUDataPtr *disabled)
+qemuMonitorJSONGetGuestCPUx86(qemuMonitorPtr mon,
+ virCPUDataPtr *data,
+ virCPUDataPtr *disabled)
{
virCPUDataPtr cpuEnabled = NULL;
virCPUDataPtr cpuDisabled = NULL;
int rc;
- if (ARCH_IS_X86(arch)) {
- if ((rc = qemuMonitorJSONCheckCPUx86(mon)) < 0)
- return -1;
- else if (!rc)
- return -2;
-
- if (qemuMonitorJSONGetCPUx86Data(mon, "feature-words",
- &cpuEnabled) < 0)
- goto error;
+ if ((rc = qemuMonitorJSONCheckCPUx86(mon)) < 0)
+ return -1;
+ else if (!rc)
+ return -2;
- if (disabled &&
- qemuMonitorJSONGetCPUx86Data(mon, "filtered-features",
- &cpuDisabled) < 0)
- goto error;
+ if (qemuMonitorJSONGetCPUx86Data(mon, "feature-words",
+ &cpuEnabled) < 0)
+ goto error;
- *data = cpuEnabled;
- if (disabled)
- *disabled = cpuDisabled;
- return 0;
- }
+ if (disabled &&
+ qemuMonitorJSONGetCPUx86Data(mon, "filtered-features",
+ &cpuDisabled) < 0)
+ goto error;
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("CPU definition retrieval isn't supported for '%s'"),
- virArchToString(arch));
- return -1;
+ *data = cpuEnabled;
+ if (disabled)
+ *disabled = cpuDisabled;
+ return 0;
error:
virCPUDataFree(cpuEnabled);
const char *property,
virCPUDataPtr *cpudata);
-int qemuMonitorJSONGetGuestCPU(qemuMonitorPtr mon,
- virArch arch,
- virCPUDataPtr *data,
- virCPUDataPtr *disabled);
+int qemuMonitorJSONGetGuestCPUx86(qemuMonitorPtr mon,
+ virCPUDataPtr *data,
+ virCPUDataPtr *disabled);
int qemuMonitorJSONRTCResetReinjection(qemuMonitorPtr mon);
if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
goto error;
- rc = qemuMonitorGetGuestCPU(priv->mon, vm->def->os.arch,
- &dataEnabled, &dataDisabled);
+ rc = qemuMonitorGetGuestCPUx86(priv->mon, &dataEnabled, &dataDisabled);
if (qemuDomainObjExitMonitor(driver, vm) < 0)
goto error;
if (qemuMonitorTestAddItem(test, "qom-get", jsonStr) < 0)
goto cleanup;
- if (qemuMonitorJSONGetGuestCPU(qemuMonitorTestGetMonitor(test),
- VIR_ARCH_X86_64,
- &cpuData, NULL) < 0)
+ if (qemuMonitorJSONGetGuestCPUx86(qemuMonitorTestGetMonitor(test),
+ &cpuData, NULL) < 0)
goto cleanup;
if (!(actual = virCPUDataFormat(cpuData)))
"}") < 0)
goto cleanup;
- rv = qemuMonitorJSONGetGuestCPU(qemuMonitorTestGetMonitor(test),
- VIR_ARCH_X86_64,
- &cpuData, NULL);
+ rv = qemuMonitorJSONGetGuestCPUx86(qemuMonitorTestGetMonitor(test),
+ &cpuData, NULL);
if (rv != -2) {
virReportError(VIR_ERR_INTERNAL_ERROR,
"Unexpected return value %d, expecting -2", rv);