[Pkg-libvirt-maintainers] Bug#883208: libvirt0 version 3.0.0-4+deb9u1 fails to migrate qemu guests that use disks with cache='directsync'

Carsten Burkhardt c.burkhardt at b-c-s.de
Thu Nov 30 17:16:15 UTC 2017


Package: libvirt0
Version: 3.0.0-4+deb9u1

libvirt0 version 3.0.0-4+deb9u1 fails to migrate qemu guests that use disks with cache='directsync'

Directsync is necessary for us to maintain drbd data integrity. However, libvirt in the stable debian release prevents us from using that cache mode for live migration.

This has been fixed in the git version:

https://github.com/libvirt/libvirt/commit/fed9cc85eaff6f75e3d232e350d78a53f314815f#diff-6ec6f76d45ea0e7e9e53e36eac65a923

Here is my attempt at backporting that change:


--- qemu_migration.c.orig    2017-11-30 15:58:34.143882478 +0100
+++ qemu_migration.c    2017-11-30 16:26:27.801361294 +0100
@@ -2377,7 +2377,8 @@
          /* Our code elsewhere guarantees shared disks are either readonly (in
           * which case cache mode doesn't matter) or used with cache=none */
          if (qemuMigrateDisk(disk, nmigrate_disks, migrate_disks) &&
-            disk->cachemode != VIR_DOMAIN_DISK_CACHE_DISABLE) {
+            disk->cachemode != VIR_DOMAIN_DISK_CACHE_DISABLE &&
+            disk->cachemode != VIR_DOMAIN_DISK_CACHE_DIRECTSYNC) {
              int rc;

              if (virDomainDiskGetType(disk) == VIR_STORAGE_TYPE_FILE) {
@@ -2396,7 +2397,7 @@

              virReportError(VIR_ERR_MIGRATE_UNSAFE, "%s",
                             _("Migration may lead to data corruption if disks"
-                             " use cache != none"));
+                             " use cache != none or cache != directsync"));
              return false;
          }
      }


Mit freundlichen Grüßen

Carsten Burkhardt

-- 
Dipl. Ing.Carsten Burkhardt | c.burkhardt at b-c-s.de
bcs kommunikationslösungen
Inh. Dipl. Ing. Carsten Burkhardt
Harz 51 | 06108 Halle (Saale) | Germany
tel +49 345 29849-0 | fax +49 345 29849-22
www.b-c-s.de | www.halle.it | www.wivewa.de

SIE MÖCHTEN EINFACH IHRE ADRESSEN, GEBURTSTAGE UND DOKUMENTE VERWALTEN UND TROTZDEM IHRE DATEN SICHER WISSEN. DANN ÜBERZEUGEN SIE SICH VON WIVEWA unter: www.wivewa.de

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3512 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-libvirt-maintainers/attachments/20171130/48f45c9a/attachment.bin>


More information about the Pkg-libvirt-maintainers mailing list