[libvirt] [PATCH v3 0/6] Add panic device support for S390

S390 architecture inherently provides a crash detection capability which has not been reflected in the domain xml. This series adds an s390 model to the panic device which does not allow an address to be specified and is by default created on S390 guests unless already provided. v3: * Merged S390 and S390X in the add default device function * Changed and added tests * Split out ISA panic device message into separate patch * Adjusted documentation v2: * Grouped default panic device creation and required test code changes into one patch. * Added an s390 model instead of using default model for toleration. Boris Fiuczynski (6): qemu: add panic device support for S390 qemu: add default panic device to S390 guests tests: add tests for panic device model s390 docs: align spelling of S390 qemu: merge S390 and S390X default device creation qemu: fix error message for default panic device docs/formatdomain.html.in | 26 ++++++++++++------- docs/schemas/domaincommon.rng | 1 + src/conf/domain_conf.c | 3 ++- src/conf/domain_conf.h | 1 + src/qemu/qemu_command.c | 21 +++++++++++++++- src/qemu/qemu_domain.c | 11 +++++--- .../qemuargv2xml-machine-aeskeywrap-off-argv.xml | 1 + .../qemuargv2xml-machine-aeskeywrap-on-argv.xml | 1 + .../qemuargv2xml-machine-deakeywrap-off-argv.xml | 1 + .../qemuargv2xml-machine-deakeywrap-on-argv.xml | 1 + .../qemuargv2xml-machine-keywrap-none-argv.xml | 1 + .../qemuxml2argv-s390-panic-address.xml | 26 +++++++++++++++++++ .../qemuxml2argv-s390-panic-missing.args | 25 +++++++++++++++++++ .../qemuxml2argv-s390-panic-missing.xml | 23 +++++++++++++++++ .../qemuxml2argv-s390-panic-no-address.args | 25 +++++++++++++++++++ .../qemuxml2argv-s390-panic-no-address.xml | 22 ++++++++++++++++ tests/qemuxml2argvdata/qemuxml2argv-s390-panic.xml | 22 ++++++++++++++++ tests/qemuxml2argvtest.c | 11 +++++++- .../qemuxml2xmlout-iothreads-disk-virtio-ccw.xml | 1 + .../qemuxml2xmlout-s390-defaultconsole.xml | 1 + .../qemuxml2xmlout-s390-panic-missing.xml | 29 ++++++++++++++++++++++ .../qemuxml2xmlout-s390-panic-no-address.xml | 28 +++++++++++++++++++++ .../qemuxml2xmlout-s390-panic.xml | 28 +++++++++++++++++++++ tests/qemuxml2xmltest.c | 6 +++++ 24 files changed, 300 insertions(+), 15 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-panic-address.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-panic-missing.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-panic-missing.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-panic-no-address.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-panic-no-address.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-panic.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-panic-missing.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-panic-no-address.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-panic.xml -- 2.3.0

If a panic device is being defined without a model in a domain the default value is always overwritten with model ISA. An ISA bus does not exist on S390 and therefore specifying a panic device results in an unsupported configuration. Since the S390 architecture inherently provides a crash detection capability the panic device should be defined in the domain xml. This patch adds an s390 panic device model and prevents setting a device address on it. Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> --- docs/formatdomain.html.in | 16 ++++++++++++---- docs/schemas/domaincommon.rng | 1 + src/conf/domain_conf.c | 3 ++- src/conf/domain_conf.h | 1 + src/qemu/qemu_command.c | 19 +++++++++++++++++++ src/qemu/qemu_domain.c | 2 ++ 6 files changed, 37 insertions(+), 5 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index d2db53b..81f4d48 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -6365,9 +6365,15 @@ qemu-kvm -net nic,model=? /dev/null <span class="since">Since 1.2.1, QEMU and KVM only</span> </p> <p> - For pSeries guests, this feature is always enabled since it's - implemented by the guest firmware, thus libvirt automatically - adds the <code>panic</code> element to the domain XML. + This feature is always enabled for: + </p> + <ul> + <li>pSeries guests since it's implemented by the guest firmware.</li> + <li>S390 guest since it's an integral part of the S390 architecture.</li> + </ul> + <p> + Thus libvirt automatically adds the <code>panic</code> element to the + domain XML. </p> <p> Example: usage of panic configuration @@ -6395,6 +6401,8 @@ qemu-kvm -net nic,model=? /dev/null <li>'pseries' — default and valid only for pSeries guests.</li> <li>'hyperv' — for Hyper-V crash CPU feature. <span class="since">Since 1.3.0, QEMU and KVM only</span></li> + <li>'s390' — default for S390 guests. + <span class="since">Since 1.3.5</span></li> </ul> </dd> <dt><code>address</code></dt> @@ -6402,7 +6410,7 @@ qemu-kvm -net nic,model=? /dev/null <p> address of panic. The default ioport is 0x505. Most users don't need to specify an address, and doing so is forbidden - altogether for pseries and hyperv models. + altogether for s390, pseries and hyperv models. </p> </dd> </dl> diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index f77bbcf..ce4f551 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -5523,6 +5523,7 @@ <value>isa</value> <value>pseries</value> <value>hyperv</value> + <value>s390</value> </choice> </attribute> </optional> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index d8bed67..b99c00c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -525,7 +525,8 @@ VIR_ENUM_IMPL(virDomainPanicModel, VIR_DOMAIN_PANIC_MODEL_LAST, "default", "isa", "pseries", - "hyperv") + "hyperv", + "s390") VIR_ENUM_IMPL(virDomainVideo, VIR_DOMAIN_VIDEO_TYPE_LAST, "vga", diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 31e7a86..ce40aa8 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2082,6 +2082,7 @@ typedef enum { VIR_DOMAIN_PANIC_MODEL_ISA, VIR_DOMAIN_PANIC_MODEL_PSERIES, VIR_DOMAIN_PANIC_MODEL_HYPERV, + VIR_DOMAIN_PANIC_MODEL_S390, VIR_DOMAIN_PANIC_MODEL_LAST } virDomainPanicModel; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 6fbfe21..05071f0 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -9046,6 +9046,25 @@ qemuBuildPanicCommandLine(virCommandPtr cmd, for (i = 0; i < def->npanics; i++) { switch ((virDomainPanicModel) def->panics[i]->model) { + case VIR_DOMAIN_PANIC_MODEL_S390: + /* For s390 guests, the hardware provides the same + * functionality as the pvpanic device. The address + * cannot be configured by the user */ + if (!ARCH_IS_S390(def->os.arch)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("only S390 guests support " + "panic device of model 's390'")); + return -1; + } + if (def->panics[i]->info.type != + VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("setting the panic device address is not " + "supported for model 's390'")); + return -1; + } + break; + case VIR_DOMAIN_PANIC_MODEL_HYPERV: /* Panic with model 'hyperv' is not a device, it should * be configured in cpu commandline. The address diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 6262bfe..6897fe0 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1909,6 +1909,8 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, if (ARCH_IS_PPC64(def->os.arch) && STRPREFIX(def->os.machine, "pseries")) dev->data.panic->model = VIR_DOMAIN_PANIC_MODEL_PSERIES; + else if (ARCH_IS_S390(def->os.arch)) + dev->data.panic->model = VIR_DOMAIN_PANIC_MODEL_S390; else dev->data.panic->model = VIR_DOMAIN_PANIC_MODEL_ISA; } -- 2.3.0

This patch adds by default a panic device with model s390 to S390 guests. Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> --- src/qemu/qemu_domain.c | 6 +++++- tests/qemuargv2xmldata/qemuargv2xml-machine-aeskeywrap-off-argv.xml | 1 + tests/qemuargv2xmldata/qemuargv2xml-machine-aeskeywrap-on-argv.xml | 1 + tests/qemuargv2xmldata/qemuargv2xml-machine-deakeywrap-off-argv.xml | 1 + tests/qemuargv2xmldata/qemuargv2xml-machine-deakeywrap-on-argv.xml | 1 + tests/qemuargv2xmldata/qemuargv2xml-machine-keywrap-none-argv.xml | 1 + .../qemuxml2xmloutdata/qemuxml2xmlout-iothreads-disk-virtio-ccw.xml | 1 + tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-defaultconsole.xml | 1 + 8 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 6897fe0..4384c26 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1509,6 +1509,7 @@ qemuDomainDefAddDefaultDevices(virDomainDefPtr def, break; case VIR_ARCH_S390X: addDefaultUSB = false; + addPanicDevice = true; break; case VIR_ARCH_SPARC: @@ -1587,7 +1588,10 @@ qemuDomainDefAddDefaultDevices(virDomainDefPtr def, size_t j; for (j = 0; j < def->npanics; j++) { if (def->panics[j]->model == VIR_DOMAIN_PANIC_MODEL_DEFAULT || - def->panics[j]->model == VIR_DOMAIN_PANIC_MODEL_PSERIES) + (ARCH_IS_PPC64(def->os.arch) && + def->panics[j]->model == VIR_DOMAIN_PANIC_MODEL_PSERIES) || + (ARCH_IS_S390(def->os.arch) && + def->panics[j]->model == VIR_DOMAIN_PANIC_MODEL_S390)) break; } diff --git a/tests/qemuargv2xmldata/qemuargv2xml-machine-aeskeywrap-off-argv.xml b/tests/qemuargv2xmldata/qemuargv2xml-machine-aeskeywrap-off-argv.xml index 1658e12..7ccdc67 100644 --- a/tests/qemuargv2xmldata/qemuargv2xml-machine-aeskeywrap-off-argv.xml +++ b/tests/qemuargv2xmldata/qemuargv2xml-machine-aeskeywrap-off-argv.xml @@ -20,6 +20,7 @@ <target dev='vda' bus='virtio'/> </disk> <memballoon model='none'/> + <panic model='s390'/> </devices> <keywrap> <cipher name='aes' state='off'/> diff --git a/tests/qemuargv2xmldata/qemuargv2xml-machine-aeskeywrap-on-argv.xml b/tests/qemuargv2xmldata/qemuargv2xml-machine-aeskeywrap-on-argv.xml index 3d676aa..a02523d 100644 --- a/tests/qemuargv2xmldata/qemuargv2xml-machine-aeskeywrap-on-argv.xml +++ b/tests/qemuargv2xmldata/qemuargv2xml-machine-aeskeywrap-on-argv.xml @@ -20,6 +20,7 @@ <target dev='vda' bus='virtio'/> </disk> <memballoon model='none'/> + <panic model='s390'/> </devices> <keywrap> <cipher name='aes' state='on'/> diff --git a/tests/qemuargv2xmldata/qemuargv2xml-machine-deakeywrap-off-argv.xml b/tests/qemuargv2xmldata/qemuargv2xml-machine-deakeywrap-off-argv.xml index f3bc8af..7f0c871 100644 --- a/tests/qemuargv2xmldata/qemuargv2xml-machine-deakeywrap-off-argv.xml +++ b/tests/qemuargv2xmldata/qemuargv2xml-machine-deakeywrap-off-argv.xml @@ -20,6 +20,7 @@ <target dev='vda' bus='virtio'/> </disk> <memballoon model='none'/> + <panic model='s390'/> </devices> <keywrap> <cipher name='dea' state='off'/> diff --git a/tests/qemuargv2xmldata/qemuargv2xml-machine-deakeywrap-on-argv.xml b/tests/qemuargv2xmldata/qemuargv2xml-machine-deakeywrap-on-argv.xml index 1e0660f..d4721dc 100644 --- a/tests/qemuargv2xmldata/qemuargv2xml-machine-deakeywrap-on-argv.xml +++ b/tests/qemuargv2xmldata/qemuargv2xml-machine-deakeywrap-on-argv.xml @@ -20,6 +20,7 @@ <target dev='vda' bus='virtio'/> </disk> <memballoon model='none'/> + <panic model='s390'/> </devices> <keywrap> <cipher name='dea' state='on'/> diff --git a/tests/qemuargv2xmldata/qemuargv2xml-machine-keywrap-none-argv.xml b/tests/qemuargv2xmldata/qemuargv2xml-machine-keywrap-none-argv.xml index 6acee07..5483040 100644 --- a/tests/qemuargv2xmldata/qemuargv2xml-machine-keywrap-none-argv.xml +++ b/tests/qemuargv2xmldata/qemuargv2xml-machine-keywrap-none-argv.xml @@ -20,5 +20,6 @@ <target dev='vda' bus='virtio'/> </disk> <memballoon model='none'/> + <panic model='s390'/> </devices> </domain> diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-disk-virtio-ccw.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-disk-virtio-ccw.xml index b6f7d30..f6d1039 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-disk-virtio-ccw.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-iothreads-disk-virtio-ccw.xml @@ -31,5 +31,6 @@ <memballoon model='virtio'> <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x000a'/> </memballoon> + <panic model='s390'/> </devices> </domain> diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-defaultconsole.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-defaultconsole.xml index 3f349b2..42ad4e4 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-defaultconsole.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-defaultconsole.xml @@ -20,5 +20,6 @@ <target type='virtio' port='0'/> </console> <memballoon model='none'/> + <panic model='s390'/> </devices> </domain> -- 2.3.0

Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> --- .../qemuxml2argv-s390-panic-address.xml | 26 +++++++++++++++++++ .../qemuxml2argv-s390-panic-missing.args | 25 +++++++++++++++++++ .../qemuxml2argv-s390-panic-missing.xml | 23 +++++++++++++++++ .../qemuxml2argv-s390-panic-no-address.args | 25 +++++++++++++++++++ .../qemuxml2argv-s390-panic-no-address.xml | 22 ++++++++++++++++ tests/qemuxml2argvdata/qemuxml2argv-s390-panic.xml | 22 ++++++++++++++++ tests/qemuxml2argvtest.c | 11 +++++++- .../qemuxml2xmlout-s390-panic-missing.xml | 29 ++++++++++++++++++++++ .../qemuxml2xmlout-s390-panic-no-address.xml | 28 +++++++++++++++++++++ .../qemuxml2xmlout-s390-panic.xml | 28 +++++++++++++++++++++ tests/qemuxml2xmltest.c | 6 +++++ 11 files changed, 244 insertions(+), 1 deletion(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-panic-address.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-panic-missing.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-panic-missing.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-panic-no-address.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-panic-no-address.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-s390-panic.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-panic-missing.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-panic-no-address.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-panic.xml diff --git a/tests/qemuxml2argvdata/qemuxml2argv-s390-panic-address.xml b/tests/qemuxml2argvdata/qemuxml2argv-s390-panic-address.xml new file mode 100644 index 0000000..94521d0 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-s390-panic-address.xml @@ -0,0 +1,26 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>9aa4b45c-b9dd-45ef-91fe-862b27b4231f</uuid> + <memory>262144</memory> + <currentMemory>262144</currentMemory> + <os> + <type arch='s390x' machine='s390-ccw-virtio'>hvm</type> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-s390x</emulator> + <controller type='virtio-serial' index='0'> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> + </controller> + <console type='pty'> + <target type='virtio'/> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/> + </console> + <panic model='s390'> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0005'/> + </panic> + </devices> +</domain> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-s390-panic-missing.args b/tests/qemuxml2argvdata/qemuxml2argv-s390-panic-missing.args new file mode 100644 index 0000000..f2eec5b --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-s390-panic-missing.args @@ -0,0 +1,25 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/home/test \ +USER=test \ +LOGNAME=test \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu-system-s390x \ +-name QEMUGuest1 \ +-S \ +-M s390-ccw-virtio \ +-m 256 \ +-smp 1 \ +-uuid 9aa4b45c-b9dd-45ef-91fe-862b27b4231f \ +-nographic \ +-nodefconfig \ +-nodefaults \ +-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ +server,nowait \ +-mon chardev=charmonitor,id=monitor,mode=readline \ +-no-acpi \ +-boot c \ +-device virtio-serial-ccw,id=virtio-serial0,devno=fe.0.0000 \ +-chardev pty,id=charconsole0 \ +-device virtconsole,chardev=charconsole0,id=console0 \ +-device virtio-balloon-ccw,id=balloon0,devno=fe.0.0002 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-s390-panic-missing.xml b/tests/qemuxml2argvdata/qemuxml2argv-s390-panic-missing.xml new file mode 100644 index 0000000..8955433 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-s390-panic-missing.xml @@ -0,0 +1,23 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>9aa4b45c-b9dd-45ef-91fe-862b27b4231f</uuid> + <memory>262144</memory> + <currentMemory>262144</currentMemory> + <os> + <type arch='s390x' machine='s390-ccw-virtio'>hvm</type> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-s390x</emulator> + <controller type='virtio-serial' index='0'> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> + </controller> + <console type='pty'> + <target type='virtio'/> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/> + </console> + </devices> +</domain> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-s390-panic-no-address.args b/tests/qemuxml2argvdata/qemuxml2argv-s390-panic-no-address.args new file mode 100644 index 0000000..811991d --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-s390-panic-no-address.args @@ -0,0 +1,25 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/home/test \ +USER=test \ +LOGNAME=test \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu-system-s390x \ +-name QEMUGuest1 \ +-S \ +-M s390-ccw-virtio \ +-m 256 \ +-smp 1 \ +-uuid 9aa4b45c-b9dd-45ef-91fe-862b27b4231f \ +-nographic \ +-nodefconfig \ +-nodefaults \ +-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ +server,nowait \ +-mon chardev=charmonitor,id=monitor,mode=readline \ +-no-acpi \ +-boot c \ +-device virtio-serial-ccw,id=virtio-serial0,devno=fe.0.0000 \ +-chardev pty,id=charconsole0 \ +-device virtconsole,chardev=charconsole0,id=console0 \ +-device virtio-balloon-ccw,id=balloon0,devno=fe.0.0001 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-s390-panic-no-address.xml b/tests/qemuxml2argvdata/qemuxml2argv-s390-panic-no-address.xml new file mode 100644 index 0000000..b698d27 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-s390-panic-no-address.xml @@ -0,0 +1,22 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>9aa4b45c-b9dd-45ef-91fe-862b27b4231f</uuid> + <memory>262144</memory> + <currentMemory>262144</currentMemory> + <os> + <type arch='s390x' machine='s390-ccw-virtio'>hvm</type> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-s390x</emulator> + <controller type='virtio-serial' index='0'> + </controller> + <console type='pty'> + <target type='virtio'/> + </console> + <panic/> + </devices> +</domain> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-s390-panic.xml b/tests/qemuxml2argvdata/qemuxml2argv-s390-panic.xml new file mode 100644 index 0000000..432a04c --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-s390-panic.xml @@ -0,0 +1,22 @@ +<domain type='kvm'> + <name>test</name> + <uuid>9aa4b45c-b9dd-45ef-91fe-862b27b4231f</uuid> + <memory>262144</memory> + <currentMemory>262144</currentMemory> + <os> + <type arch='s390x' machine='s390-ccw-virtio'>hvm</type> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-kvm</emulator> + <controller type='virtio-serial' index='0'> + </controller> + <console type='pty'> + <target type='virtio'/> + </console> + <panic/> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 8842b2f..1d13c05 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1461,12 +1461,21 @@ mymain(void) QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_BOOTINDEX, QEMU_CAPS_VIRTIO_S390, QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_RANDOM); - DO_TEST("s390-allow-bogus-usb-controller", QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_BOOTINDEX, QEMU_CAPS_VIRTIO_S390, QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_RANDOM); + DO_TEST("s390-panic-no-address", + QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390); + DO_TEST_FAILURE("s390-panic-address", + QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390); + DO_TEST("s390-panic-missing", + QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG, + QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390); + DO_TEST("ppc-dtb", QEMU_CAPS_KVM, QEMU_CAPS_DTB); DO_TEST("ppce500-serial", QEMU_CAPS_KVM, QEMU_CAPS_CHARDEV); diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-panic-missing.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-panic-missing.xml new file mode 100644 index 0000000..8864157 --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-panic-missing.xml @@ -0,0 +1,29 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>9aa4b45c-b9dd-45ef-91fe-862b27b4231f</uuid> + <memory unit='KiB'>262144</memory> + <currentMemory unit='KiB'>262144</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='s390x' machine='s390-ccw-virtio'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-s390x</emulator> + <controller type='virtio-serial' index='0'> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> + </controller> + <console type='pty'> + <target type='virtio' port='0'/> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/> + </console> + <memballoon model='virtio'> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0002'/> + </memballoon> + <panic model='s390'/> + </devices> +</domain> diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-panic-no-address.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-panic-no-address.xml new file mode 100644 index 0000000..3ae36ba --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-panic-no-address.xml @@ -0,0 +1,28 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>9aa4b45c-b9dd-45ef-91fe-862b27b4231f</uuid> + <memory unit='KiB'>262144</memory> + <currentMemory unit='KiB'>262144</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='s390x' machine='s390-ccw-virtio'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-s390x</emulator> + <controller type='virtio-serial' index='0'> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> + </controller> + <console type='pty'> + <target type='virtio' port='0'/> + </console> + <memballoon model='virtio'> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/> + </memballoon> + <panic model='s390'/> + </devices> +</domain> diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-panic.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-panic.xml new file mode 100644 index 0000000..12fc687 --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-panic.xml @@ -0,0 +1,28 @@ +<domain type='kvm'> + <name>test</name> + <uuid>9aa4b45c-b9dd-45ef-91fe-862b27b4231f</uuid> + <memory unit='KiB'>262144</memory> + <currentMemory unit='KiB'>262144</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='s390x' machine='s390-ccw-virtio'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-kvm</emulator> + <controller type='virtio-serial' index='0'> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> + </controller> + <console type='pty'> + <target type='virtio' port='0'/> + </console> + <memballoon model='virtio'> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/> + </memballoon> + <panic model='s390'/> + </devices> +</domain> diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 62f8f96..a68bd25 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -699,6 +699,12 @@ mymain(void) DO_TEST_FULL("s390-defaultconsole", WHEN_ACTIVE, QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390); + DO_TEST_FULL("s390-panic", WHEN_BOTH, + QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390); + DO_TEST_FULL("s390-panic-missing", WHEN_BOTH, + QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390); + DO_TEST_FULL("s390-panic-no-address", WHEN_BOTH, + QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390); DO_TEST("pcihole64"); DO_TEST("pcihole64-gib"); -- 2.3.0

Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> --- docs/formatdomain.html.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 81f4d48..936f2de 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -2966,7 +2966,7 @@ 0.9.9.</span> </dd> <dt><code>ccw</code></dt> - <dd>s390 guests with a <code>machine</code> value of + <dd>S390 guests with a <code>machine</code> value of s390-ccw-virtio use the native CCW bus for I/O devices. CCW bus addresses have the following additional attributes: <code>cssid</code> (a hex value between 0 and 0xfe, inclusive), @@ -3028,7 +3028,7 @@ <span class="since">since 0.10.0</span>, if the USB bus needs to be explicitly disabled for the guest, <code>model='none'</code> may be used. <span class="since">Since 1.0.5</span>, no default USB controller - will be built on s390. The PowerPC64 "spapr-vio" addresses do not have an + will be built on S390. The PowerPC64 "spapr-vio" addresses do not have an associated controller. </p> @@ -5549,9 +5549,9 @@ qemu-kvm -net nic,model=? /dev/null <li>Only the first <code>console</code> element may use a <code>targetType</code> of <code>serial</code>. Secondary consoles must all be paravirtualized. </li> - <li>On s390, the <code>console</code> element may use a + <li>On S390, the <code>console</code> element may use a <code>targetType</code> of <code>sclp</code> or <code>sclplm</code> - (line mode). SCLP is the native console type for s390. There's no + (line mode). SCLP is the native console type for S390. There's no controller associated to SCLP consoles. <span class="since">Since 1.0.2</span> </li> @@ -5583,7 +5583,7 @@ qemu-kvm -net nic,model=? /dev/null <pre> ... <devices> - <!-- KVM s390 sclp console --> + <!-- KVM S390 sclp console --> <console type='pty'> <source path='/dev/pts/1'/> <target type='sclp' port='0'/> -- 2.3.0

Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> --- src/qemu/qemu_domain.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 4384c26..db58019 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1504,9 +1504,8 @@ qemuDomainDefAddDefaultDevices(virDomainDefPtr def, case VIR_ARCH_SH4EB: addPCIRoot = true; break; + case VIR_ARCH_S390: - addDefaultUSB = false; - break; case VIR_ARCH_S390X: addDefaultUSB = false; addPanicDevice = true; -- 2.3.0

Adding the default bus type ISA to the message. Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> --- src/qemu/qemu_command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 05071f0..916ae36 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -9108,7 +9108,7 @@ qemuBuildPanicCommandLine(virCommandPtr cmd, if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_PANIC)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("the QEMU binary does not support the " - "panic device")); + "ISA panic device")); return -1; } -- 2.3.0

On Fri, 2016-04-29 at 15:23 +0200, Boris Fiuczynski wrote:
S390 architecture inherently provides a crash detection capability which has not been reflected in the domain xml. This series adds an s390 model to the panic device which does not allow an address to be specified and is by default created on S390 guests unless already provided. v3: * Merged S390 and S390X in the add default device function * Changed and added tests * Split out ISA panic device message into separate patch * Adjusted documentation v2: * Grouped default panic device creation and required test code changes into one patch. * Added an s390 model instead of using default model for toleration. Boris Fiuczynski (6): qemu: add panic device support for S390 qemu: add default panic device to S390 guests tests: add tests for panic device model s390 docs: align spelling of S390 qemu: merge S390 and S390X default device creation qemu: fix error message for default panic device
ACK series and pushed. I have shuffled patches around a bit before doing so: patch 5/6 made much more sense if applied before patch 2/6, and just like it patches 4/6 and 6/6 did not depend on the new feature, so I've moved all of them at the beginning of the series. I've also adjusted the documentation slightly. Test cases were still not perfect, but I didn't feel like it was worth asking you to tweak the series again. I'll prepare a follow-up commit shortly. Thank you for your contribution :) -- Andrea Bolognani Software Engineer - Virtualization Team
participants (2)
-
Andrea Bolognani
-
Boris Fiuczynski