提交 6514c04c 编写于 作者: M Martin Kletzander

qemu: Add support for enabling/disabling PMU

This is used as a boolean parameter for the '-cpu' option.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1178853Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
上级 19939011
/*
* qemu_command.c: QEMU command generation
*
* Copyright (C) 2006-2014 Red Hat, Inc.
* Copyright (C) 2006-2015 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
......@@ -6420,6 +6420,16 @@ qemuBuildCpuArgStr(virQEMUDriverPtr driver,
}
}
if (def->features[VIR_DOMAIN_FEATURE_PMU]) {
virTristateSwitch pmu = def->features[VIR_DOMAIN_FEATURE_PMU];
if (!have_cpu)
virBufferAdd(&buf, default_model, -1);
virBufferAsprintf(&buf, ",pmu=%s",
virTristateSwitchTypeToString(pmu));
have_cpu = true;
}
if (virBufferCheckError(&buf) < 0)
goto cleanup;
......
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
/usr/bin/qemu -S -M pc \
-cpu qemu32,pmu=off -m 214 -smp 6 -nographic -monitor \
unix:/tmp/test-monitor,server,nowait -boot n -usb -net none -serial none \
-parallel none
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
/usr/bin/qemu -S -M pc \
-cpu qemu32,pmu=on -m 214 -smp 6 -nographic -monitor \
unix:/tmp/test-monitor,server,nowait -boot n -usb -net none -serial none \
-parallel none
......@@ -698,6 +698,9 @@ mymain(void)
DO_TEST("kvm-features", NONE);
DO_TEST("kvm-features-off", NONE);
DO_TEST("pmu-feature", NONE);
DO_TEST("pmu-feature-off", NONE);
DO_TEST("hugepages", QEMU_CAPS_MEM_PATH);
DO_TEST_LINUX("hugepages-pages", QEMU_CAPS_MEM_PATH,
QEMU_CAPS_OBJECT_MEMORY_RAM,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册