Re: [libvirt] [PATCH] qemu: remove panic device with model s390 when migrating

2016-07-28 Thread Boris Fiuczynski

On 07/27/2016 03:31 PM, Andrea Bolognani wrote:

On Tue, 2016-07-26 at 18:41 +0200, Ján Tomko wrote:

[cc-ing Andrea who auto-added panic for PPC64]

Should we do the same for PANIC_MODEL_PSERIES?


Thanks for the heads-up.

If we care about migrating guests to <= 1.2.16, then we
should indeed to the same for pSeries guests.

I don't see how it could hurt, either way: >= 1.2.17 will
automatically add the  element, and >= 1.3.0 will
include the model attribute as well, so I think we can
safely drop it from the migratable xml.

--
Andrea Bolognani / Red Hat / Virtualization


OK, I will include the pseries model in V2.

--
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

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] qemu: remove panic device with model s390 when migrating

2016-07-27 Thread Andrea Bolognani
On Tue, 2016-07-26 at 18:41 +0200, Ján Tomko wrote:
> [cc-ing Andrea who auto-added panic for PPC64]
> 
> Should we do the same for PANIC_MODEL_PSERIES?

Thanks for the heads-up.

If we care about migrating guests to <= 1.2.16, then we
should indeed to the same for pSeries guests.

I don't see how it could hurt, either way: >= 1.2.17 will
automatically add the  element, and >= 1.3.0 will
include the model attribute as well, so I think we can
safely drop it from the migratable xml.

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] qemu: remove panic device with model s390 when migrating

2016-07-26 Thread Ján Tomko

[cc-ing Andrea who auto-added panic for PPC64]

Should we do the same for PANIC_MODEL_PSERIES?

On Tue, Jul 26, 2016 at 09:52:59AM +0200, Boris Fiuczynski wrote:

The panic device with model s390 is autogenerated on domains with
S390 architecture since libvirt version 1.3.5.
For backwards compatibility reasons the device is to be removed
when migrating.

Signed-off-by: Boris Fiuczynski 
---
src/qemu/qemu_domain.c | 22 ++
1 file changed, 22 insertions(+)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index ceac22f..0d97ea6 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -3310,6 +3310,28 @@ qemuDomainDefFormatBuf(virQEMUDriverPtr driver,
virDomainControllerDefFree(usb);
}

+/* Remove the panic device with model s390 if present */
+for (i = 0; i < def->npanics; i++) {
+if (def->panics[i]->model == VIR_DOMAIN_PANIC_MODEL_S390) {
+virDomainPanicDefPtr *panics = def->panics;
+int npanics = def->npanics;
+size_t j;
+



+if (VIR_ALLOC_N(def->panics, npanics - 1) < 0) {
+def->panics = panics;
+goto cleanup;
+}
+
+def->npanics = 0;
+for (j = 0; j < npanics; j++) {
+if (j != i)
+def->panics[def->npanics++] = panics[j];
+}
+VIR_FREE(panics);


VIR_DELETE_ELEMENT can do all this for you.

Jan


+break; /* only one panic dev with model s390 can exist */
+}
+}
+
for (i = 0; i < def->nchannels; i++)
qemuDomainChrDefDropDefaultPath(def->channels[i], driver);
}


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH] qemu: remove panic device with model s390 when migrating

2016-07-26 Thread Boris Fiuczynski
The panic device with model s390 is autogenerated on domains with
S390 architecture since libvirt version 1.3.5.
For backwards compatibility reasons the device is to be removed
when migrating.

Signed-off-by: Boris Fiuczynski 
---
 src/qemu/qemu_domain.c | 22 ++
 1 file changed, 22 insertions(+)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index ceac22f..0d97ea6 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -3310,6 +3310,28 @@ qemuDomainDefFormatBuf(virQEMUDriverPtr driver,
 virDomainControllerDefFree(usb);
 }
 
+/* Remove the panic device with model s390 if present */
+for (i = 0; i < def->npanics; i++) {
+if (def->panics[i]->model == VIR_DOMAIN_PANIC_MODEL_S390) {
+virDomainPanicDefPtr *panics = def->panics;
+int npanics = def->npanics;
+size_t j;
+
+if (VIR_ALLOC_N(def->panics, npanics - 1) < 0) {
+def->panics = panics;
+goto cleanup;
+}
+
+def->npanics = 0;
+for (j = 0; j < npanics; j++) {
+if (j != i)
+def->panics[def->npanics++] = panics[j];
+}
+VIR_FREE(panics);
+break; /* only one panic dev with model s390 can exist */
+}
+}
+
 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