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 | 2 ++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_command.c | 5 ++++ src/qemu/qemu_domain.c | 1 + tests/qemuxml2argvdata/pseries-features-ibs.args | 19 +++++++++++++++ tests/qemuxml2argvdata/pseries-features-ibs.xml | 28 +++++++++++++++++++++++ tests/qemuxml2argvtest.c | 5 ++++ tests/qemuxml2xmloutdata/pseries-features-ibs.xml | 1 + tests/qemuxml2xmltest.c | 3 +++ 12 files changed, 75 insertions(+) create mode 100644 tests/qemuxml2argvdata/pseries-features-ibs.args create mode 100644 tests/qemuxml2argvdata/pseries-features-ibs.xml create mode 120000 tests/qemuxml2xmloutdata/pseries-features-ibs.xml diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 8c918ec0c..b9a5add3c 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -4812,6 +4812,11 @@ <ref name="hwbugstate"/> </element> </optional> + <optional> + <element name="ibs"> + <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 f894fce18..515d035ec 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -155,6 +155,7 @@ VIR_ENUM_IMPL(virDomainFeature, VIR_DOMAIN_FEATURE_LAST, "htm", "sbbc", "cfpc", + "ibs", ); VIR_ENUM_IMPL(virDomainCapabilitiesPolicy, VIR_DOMAIN_CAPABILITIES_POLICY_LAST, @@ -19280,6 +19281,7 @@ virDomainDefParseXML(xmlDocPtr xml, case VIR_DOMAIN_FEATURE_SBBC: case VIR_DOMAIN_FEATURE_CFPC: + case VIR_DOMAIN_FEATURE_IBS: if (!(tmp = virXMLPropString(nodes[i], "state"))) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("missing state attribute '%s' of feature '%s'"), @@ -21463,6 +21465,7 @@ virDomainDefFeaturesCheckABIStability(virDomainDefPtr src, case VIR_DOMAIN_FEATURE_SBBC: case VIR_DOMAIN_FEATURE_CFPC: + case VIR_DOMAIN_FEATURE_IBS: if (src->features[i] != dst->features[i]) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("State of feature '%s:%s' differs: " @@ -27013,6 +27016,7 @@ virDomainDefFormatInternal(virDomainDefPtr def, case VIR_DOMAIN_FEATURE_SBBC: case VIR_DOMAIN_FEATURE_CFPC: + case VIR_DOMAIN_FEATURE_IBS: if (def->features[i] == VIR_DOMAIN_HWBUG_NONE) break; diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 13ac63cf2..a0b553d6e 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1744,6 +1744,7 @@ typedef enum { VIR_DOMAIN_FEATURE_HTM, VIR_DOMAIN_FEATURE_SBBC, VIR_DOMAIN_FEATURE_CFPC, + VIR_DOMAIN_FEATURE_IBS, VIR_DOMAIN_FEATURE_LAST } virDomainFeature; diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 32ad58036..a520394d3 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -464,6 +464,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, /* 285 */ "machine.pseries.cap-cfpc", + "machine.pseries.cap-ibs", ); @@ -4909,6 +4910,7 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps, virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACHINE_PSERIES_CAP_HTM); virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC); virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC); + virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACHINE_PSERIES_CAP_IBS); } if (virQEMUCapsProbeQMPCommands(qemuCaps, mon) < 0) diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 226c5e3af..509d9d3a0 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -449,6 +449,7 @@ typedef enum { /* 285 */ QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC , /* -machine pseries,cap-cfpc= */ + QEMU_CAPS_MACHINE_PSERIES_CAP_IBS , /* -machine pseries,cap-ibs= */ 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 7ce6dfa77..2f1aa803b 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7070,6 +7070,8 @@ virDomainFeatureToQEMUCaps(int feature) return QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC; case VIR_DOMAIN_FEATURE_CFPC: return QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC; + case VIR_DOMAIN_FEATURE_IBS: + return QEMU_CAPS_MACHINE_PSERIES_CAP_IBS; case VIR_DOMAIN_FEATURE_ACPI: case VIR_DOMAIN_FEATURE_APIC: case VIR_DOMAIN_FEATURE_PAE: @@ -7104,6 +7106,8 @@ virDomainFeatureToMachineOption(int feature) return "cap-sbbc"; case VIR_DOMAIN_FEATURE_CFPC: return "cap-cfpc"; + case VIR_DOMAIN_FEATURE_IBS: + return "cap-ibs"; case VIR_DOMAIN_FEATURE_ACPI: case VIR_DOMAIN_FEATURE_APIC: case VIR_DOMAIN_FEATURE_PAE: @@ -7416,6 +7420,7 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, case VIR_DOMAIN_FEATURE_SBBC: case VIR_DOMAIN_FEATURE_CFPC: + case VIR_DOMAIN_FEATURE_IBS: if (def->features[i] == VIR_DOMAIN_HWBUG_NONE) break; diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index eefea56fb..bd9857b26 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3275,6 +3275,7 @@ qemuDomainDefValidateFeatures(const virDomainDef *def) case VIR_DOMAIN_FEATURE_SBBC: case VIR_DOMAIN_FEATURE_CFPC: + case VIR_DOMAIN_FEATURE_IBS: if (def->features[i] != VIR_DOMAIN_HWBUG_NONE && !qemuDomainIsPSeries(def)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, diff --git a/tests/qemuxml2argvdata/pseries-features-ibs.args b/tests/qemuxml2argvdata/pseries-features-ibs.args new file mode 100644 index 000000000..cf1ae92c9 --- /dev/null +++ b/tests/qemuxml2argvdata/pseries-features-ibs.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-ibs=fixed \ +-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-ibs.xml b/tests/qemuxml2argvdata/pseries-features-ibs.xml new file mode 100644 index 000000000..4aac368e2 --- /dev/null +++ b/tests/qemuxml2argvdata/pseries-features-ibs.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> + <ibs state='fixed'/> + </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 649598c22..0faa1d4fa 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1911,6 +1911,11 @@ mymain(void) QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC); DO_TEST_FAILURE("pseries-features-cfpc", QEMU_CAPS_MACHINE_OPT); + DO_TEST("pseries-features-ibs", + QEMU_CAPS_MACHINE_OPT, + QEMU_CAPS_MACHINE_PSERIES_CAP_IBS); + DO_TEST_FAILURE("pseries-features-ibs", + 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-ibs.xml b/tests/qemuxml2xmloutdata/pseries-features-ibs.xml new file mode 120000 index 000000000..278c88e48 --- /dev/null +++ b/tests/qemuxml2xmloutdata/pseries-features-ibs.xml @@ -0,0 +1 @@ +../qemuxml2argvdata/pseries-features-ibs.xml \ No newline at end of file diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index e5ff51867..095792a64 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -775,6 +775,9 @@ mymain(void) DO_TEST("pseries-features-cfpc", QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC); + DO_TEST("pseries-features-ibs", + QEMU_CAPS_MACHINE_OPT, + QEMU_CAPS_MACHINE_PSERIES_CAP_IBS); 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