On 04/27/2016 05:54 PM, Andrea Bolognani wrote:
On Fri, 2016-04-15 at 10:20 +0200, Boris Fiuczynski wrote:
> This patch adds by default a panic device with model s390 to S390 guests.
>
> Signed-off-by: Boris Fiuczynski <fiuczy(a)linux.vnet.ibm.com>
> ---
> src/qemu/qemu_domain.c | 7 ++++++-
> .../qemuargv2xmldata/qemuargv2xml-machine-aeskeywrap-off-argv.xml | 1 +
> tests/qemuargv2xmldata/qemuargv2xml-machine-aeskeywrap-on-argv.xml | 1 +
> .../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 +
> .../qemuxml2xmlout-iothreads-disk-virtio-ccw.xml | 1 +
> tests/qemuxml2xmloutdata/qemuxml2xmlout-s390-defaultconsole.xml | 1 +
> 8 files changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
> index d3d7c11..a83b43c 100644
> --- a/src/qemu/qemu_domain.c
> +++ b/src/qemu/qemu_domain.c
> @@ -1505,9 +1505,11 @@ qemuDomainDefAddDefaultDevices(virDomainDefPtr def,
> break;
> case VIR_ARCH_S390:
> addDefaultUSB = false;
> + addPanicDevice = true;
> break;
> case VIR_ARCH_S390X:
> addDefaultUSB = false;
> + addPanicDevice = true;
> break;
Maybe merge these two cases into one, just like eg. SPARC and
SPARC64 below? As a separate commit, of course.
I will merge it.
> case VIR_ARCH_SPARC:
> @@ -1586,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;
> }
The checks on os.arch are kinda redundant - we reject panic
models 'pseries' and 's390' if the arch is wrong - but being
explicit about that can't possibly hurt :)
:)
ACK
--
Andrea Bolognani
Software Engineer - Virtualization Team
--
Mit freundlichen Grüßen/Kind regards
Boris Fiuczynski
IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martina Köderitz
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294