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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <fiuczy@xxxxxxxxxxxxxxxxxx>
---
 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@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]