[libvirt] [PATCH v2] qemu: remove panic dev models s390 and pseries when migrating

The panic devices with models s390 and pseries are autogenerated. For backwards compatibility reasons the devices are to be removed when migrating. Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> --- src/qemu/qemu_domain.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index ceac22f..82fa817 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3310,6 +3310,15 @@ qemuDomainDefFormatBuf(virQEMUDriverPtr driver, virDomainControllerDefFree(usb); } + /* Remove the panic device for selected models if present */ + for (i = 0; i < def->npanics; i++) { + if (def->panics[i]->model == VIR_DOMAIN_PANIC_MODEL_S390 || + def->panics[i]->model == VIR_DOMAIN_PANIC_MODEL_PSERIES) { + VIR_DELETE_ELEMENT(def->panics, i, def->npanics); + i--; + } + } + for (i = 0; i < def->nchannels; i++) qemuDomainChrDefDropDefaultPath(def->channels[i], driver); } -- 2.9.0

On Thu, Jul 28, 2016 at 03:15:49PM +0200, Boris Fiuczynski wrote:
The panic devices with models s390 and pseries are autogenerated. For backwards compatibility reasons the devices are to be removed when migrating.
Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> --- src/qemu/qemu_domain.c | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index ceac22f..82fa817 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3310,6 +3310,15 @@ qemuDomainDefFormatBuf(virQEMUDriverPtr driver, virDomainControllerDefFree(usb); }
+ /* Remove the panic device for selected models if present */ + for (i = 0; i < def->npanics; i++) { + if (def->panics[i]->model == VIR_DOMAIN_PANIC_MODEL_S390 || + def->panics[i]->model == VIR_DOMAIN_PANIC_MODEL_PSERIES) { + VIR_DELETE_ELEMENT(def->panics, i, def->npanics);
+ i--;
I think we can break; here. We only auto-add one panic device. A domain XML with multiple implicit panic devices would have to be generated by the user and also does not make sense. ACK regardless, I will push it with the proposed change in a few hours if there are no objections. Jan
+ } + } + for (i = 0; i < def->nchannels; i++) qemuDomainChrDefDropDefaultPath(def->channels[i], driver); } -- 2.9.0
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

On Thu, Jul 28, 2016 at 03:15:49PM +0200, Boris Fiuczynski wrote:
The panic devices with models s390 and pseries are autogenerated. For backwards compatibility reasons the devices are to be removed when migrating.
Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> --- src/qemu/qemu_domain.c | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index ceac22f..82fa817 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3310,6 +3310,15 @@ qemuDomainDefFormatBuf(virQEMUDriverPtr driver, virDomainControllerDefFree(usb); }
+ /* Remove the panic device for selected models if present */ + for (i = 0; i < def->npanics; i++) { + if (def->panics[i]->model == VIR_DOMAIN_PANIC_MODEL_S390 || + def->panics[i]->model == VIR_DOMAIN_PANIC_MODEL_PSERIES) { + VIR_DELETE_ELEMENT(def->panics, i, def->npanics);
+ i--;
I think we can break; here.
We only auto-add one panic device. A domain XML with multiple implicit panic devices would have to be generated by the user and also does not make sense.
ACK regardless,
I will push it with the proposed change in a few hours if there are no objections.
Jan Jan, I agree. Autogeneration only adds one panic device per architecture and it is only manually possible to define multiple panic devices in a domain which would not be able to be started successfully. In case someone calls dumpxml --migratable on this domain only the s390 or
On 08/01/2016 11:57 AM, Ján Tomko wrote: pseries device (whichever comes first) would be removed.... but that is just theory. If you insert the break please also delete the line "i--;". Thanks.
+ } + } + for (i = 0; i < def->nchannels; i++) qemuDomainChrDefDropDefaultPath(def->channels[i], driver); } -- 2.9.0
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
-- 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
participants (2)
-
Boris Fiuczynski
-
Ján Tomko