Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx> --- docs/schemas/domaincommon.rng | 5 ++++ src/conf/domain_conf.c | 4 ++++ src/conf/domain_conf.h | 1 + src/qemu/qemu_capabilities.c | 4 ++++ src/qemu/qemu_capabilities.h | 3 +++ src/qemu/qemu_command.c | 5 ++++ src/qemu/qemu_domain.c | 1 + tests/qemuxml2argvdata/pseries-features-cfpc.args | 19 +++++++++++++++ tests/qemuxml2argvdata/pseries-features-cfpc.xml | 28 ++++++++++++++++++++++ tests/qemuxml2argvtest.c | 5 ++++ tests/qemuxml2xmloutdata/pseries-features-cfpc.xml | 1 + tests/qemuxml2xmltest.c | 3 +++ 12 files changed, 79 insertions(+) create mode 100644 tests/qemuxml2argvdata/pseries-features-cfpc.args create mode 100644 tests/qemuxml2argvdata/pseries-features-cfpc.xml create mode 120000 tests/qemuxml2xmloutdata/pseries-features-cfpc.xml diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 8e19a687a..8c918ec0c 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -4807,6 +4807,11 @@ <ref name="hwbugstate"/> </element> </optional> + <optional> + <element name="cfpc"> + <ref name="hwbugstate"/> + </element> + </optional> <optional> <ref name="vmcoreinfo"/> </optional> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index fcc84dc95..f894fce18 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -154,6 +154,7 @@ VIR_ENUM_IMPL(virDomainFeature, VIR_DOMAIN_FEATURE_LAST, "vmcoreinfo", "htm", "sbbc", + "cfpc", ); VIR_ENUM_IMPL(virDomainCapabilitiesPolicy, VIR_DOMAIN_CAPABILITIES_POLICY_LAST, @@ -19278,6 +19279,7 @@ virDomainDefParseXML(xmlDocPtr xml, break; case VIR_DOMAIN_FEATURE_SBBC: + case VIR_DOMAIN_FEATURE_CFPC: if (!(tmp = virXMLPropString(nodes[i], "state"))) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("missing state attribute '%s' of feature '%s'"), @@ -21460,6 +21462,7 @@ virDomainDefFeaturesCheckABIStability(virDomainDefPtr src, break; case VIR_DOMAIN_FEATURE_SBBC: + case VIR_DOMAIN_FEATURE_CFPC: if (src->features[i] != dst->features[i]) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("State of feature '%s:%s' differs: " @@ -27009,6 +27012,7 @@ virDomainDefFormatInternal(virDomainDefPtr def, break; case VIR_DOMAIN_FEATURE_SBBC: + case VIR_DOMAIN_FEATURE_CFPC: if (def->features[i] == VIR_DOMAIN_HWBUG_NONE) break; diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index ab106e900..13ac63cf2 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1743,6 +1743,7 @@ typedef enum { VIR_DOMAIN_FEATURE_VMCOREINFO, VIR_DOMAIN_FEATURE_HTM, VIR_DOMAIN_FEATURE_SBBC, + VIR_DOMAIN_FEATURE_CFPC, VIR_DOMAIN_FEATURE_LAST } virDomainFeature; diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index be216bccf..32ad58036 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -461,6 +461,9 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, "dump-completed", "machine.pseries.cap-htm", "machine.pseries.cap-sbbc", + + /* 285 */ + "machine.pseries.cap-cfpc", ); @@ -4905,6 +4908,7 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps, ARCH_IS_PPC64(qemuCaps->arch)) { virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACHINE_PSERIES_CAP_HTM); virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC); + virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC); } if (virQEMUCapsProbeQMPCommands(qemuCaps, mon) < 0) diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 8fbfc94d5..226c5e3af 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -447,6 +447,9 @@ typedef enum { QEMU_CAPS_MACHINE_PSERIES_CAP_HTM, /* -machine pseries,cap-htm= */ QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC, /* -machine pseries,cap-sbbc= */ + /* 285 */ + QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC , /* -machine pseries,cap-cfpc= */ + QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index c83758b77..7ce6dfa77 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7068,6 +7068,8 @@ virDomainFeatureToQEMUCaps(int feature) return QEMU_CAPS_MACHINE_PSERIES_CAP_HTM; case VIR_DOMAIN_FEATURE_SBBC: return QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC; + case VIR_DOMAIN_FEATURE_CFPC: + return QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC; case VIR_DOMAIN_FEATURE_ACPI: case VIR_DOMAIN_FEATURE_APIC: case VIR_DOMAIN_FEATURE_PAE: @@ -7100,6 +7102,8 @@ virDomainFeatureToMachineOption(int feature) return "cap-htm"; case VIR_DOMAIN_FEATURE_SBBC: return "cap-sbbc"; + case VIR_DOMAIN_FEATURE_CFPC: + return "cap-cfpc"; case VIR_DOMAIN_FEATURE_ACPI: case VIR_DOMAIN_FEATURE_APIC: case VIR_DOMAIN_FEATURE_PAE: @@ -7411,6 +7415,7 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, break; case VIR_DOMAIN_FEATURE_SBBC: + case VIR_DOMAIN_FEATURE_CFPC: if (def->features[i] == VIR_DOMAIN_HWBUG_NONE) break; diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index d7ce6ed65..eefea56fb 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3274,6 +3274,7 @@ qemuDomainDefValidateFeatures(const virDomainDef *def) break; case VIR_DOMAIN_FEATURE_SBBC: + case VIR_DOMAIN_FEATURE_CFPC: if (def->features[i] != VIR_DOMAIN_HWBUG_NONE && !qemuDomainIsPSeries(def)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, diff --git a/tests/qemuxml2argvdata/pseries-features-cfpc.args b/tests/qemuxml2argvdata/pseries-features-cfpc.args new file mode 100644 index 000000000..c1ed0c1dc --- /dev/null +++ b/tests/qemuxml2argvdata/pseries-features-cfpc.args @@ -0,0 +1,19 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/home/test \ +USER=test \ +LOGNAME=test \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu-system-ppc64 \ +-name guest \ +-S \ +-machine pseries,accel=tcg,cap-cfpc=workaround \ +-m 512 \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-nographic \ +-nodefaults \ +-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-guest/monitor.sock,\ +server,nowait \ +-mon chardev=charmonitor,id=monitor,mode=readline \ +-boot c diff --git a/tests/qemuxml2argvdata/pseries-features-cfpc.xml b/tests/qemuxml2argvdata/pseries-features-cfpc.xml new file mode 100644 index 000000000..f30bad7f9 --- /dev/null +++ b/tests/qemuxml2argvdata/pseries-features-cfpc.xml @@ -0,0 +1,28 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory unit='KiB'>524288</memory> + <currentMemory unit='KiB'>524288</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='ppc64' machine='pseries'>hvm</type> + <boot dev='hd'/> + </os> + <features> + <cfpc state='workaround'/> + </features> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-ppc64</emulator> + <controller type='usb' index='0' model='none'/> + <controller type='pci' index='0' model='pci-root'> + <model name='spapr-pci-host-bridge'/> + <target index='0'/> + </controller> + <memballoon model='none'/> + <panic model='pseries'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 0aa4145f2..649598c22 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1906,6 +1906,11 @@ mymain(void) QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC); DO_TEST_FAILURE("pseries-features-sbbc", QEMU_CAPS_MACHINE_OPT); + DO_TEST("pseries-features-cfpc", + QEMU_CAPS_MACHINE_OPT, + QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC); + DO_TEST_FAILURE("pseries-features-cfpc", + QEMU_CAPS_MACHINE_OPT); DO_TEST_PARSE_ERROR("pseries-features-invalid-machine", NONE); DO_TEST("pseries-serial-native", diff --git a/tests/qemuxml2xmloutdata/pseries-features-cfpc.xml b/tests/qemuxml2xmloutdata/pseries-features-cfpc.xml new file mode 120000 index 000000000..fb3b1f05a --- /dev/null +++ b/tests/qemuxml2xmloutdata/pseries-features-cfpc.xml @@ -0,0 +1 @@ +../qemuxml2argvdata/pseries-features-cfpc.xml \ No newline at end of file diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 05610a273..e5ff51867 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -772,6 +772,9 @@ mymain(void) DO_TEST("pseries-features-sbbc", QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC); + DO_TEST("pseries-features-cfpc", + QEMU_CAPS_MACHINE_OPT, + QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC); DO_TEST("pseries-serial-native", QEMU_CAPS_NODEFCONFIG, -- 2.14.3 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list