[Pkg-libvirt-commits] [libvirt] 01/01: qemu: shared disks with cache=directsync should be safe for migration
Guido Guenther
agx at moszumanska.debian.org
Fri Dec 1 20:17:15 UTC 2017
This is an automated email from the git hooks/post-receive script.
agx pushed a commit to branch debian/stretch
in repository libvirt.
commit a6888799badf1c4fb7e2935d560ad8fc950cbfc5
Author: Guido Günther <agx at sigxcpu.org>
Date: Fri Dec 1 17:13:52 2017 +0100
qemu: shared disks with cache=directsync should be safe for migration
Closes: #883208
Thanks: Carsten Burkhardt
---
...s-with-cache-directsync-should-be-safe-fo.patch | 41 ++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 42 insertions(+)
diff --git a/debian/patches/qemu-shared-disks-with-cache-directsync-should-be-safe-fo.patch b/debian/patches/qemu-shared-disks-with-cache-directsync-should-be-safe-fo.patch
new file mode 100644
index 0000000..1a63ab5
--- /dev/null
+++ b/debian/patches/qemu-shared-disks-with-cache-directsync-should-be-safe-fo.patch
@@ -0,0 +1,41 @@
+From: Hao Peng <peng.hao2 at zte.com.cn>
+Date: Sat, 15 Jul 2017 23:01:25 +0800
+Subject: qemu: shared disks with cache=directsync should be safe for
+ migration
+
+At present shared disks can be migrated with either readonly or cache=none. But
+cache=directsync should be safe for migration, because both cache=directsync and cache=none
+don't use the host page cache, and cache=direct write through qemu block layer cache.
+
+Signed-off-by: Peng Hao <peng.hao2 at zte.com.cn>
+Reviewed-by: Wang Yechao <wang.yechao255 at zte.com.cn>
+---
+ src/qemu/qemu_migration.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
+index 0f4a6cf..dc69ea3 100644
+--- a/src/qemu/qemu_migration.c
++++ b/src/qemu/qemu_migration.c
+@@ -2375,9 +2375,10 @@ qemuMigrationIsSafe(virDomainDefPtr def,
+ const char *src = virDomainDiskGetSource(disk);
+
+ /* Our code elsewhere guarantees shared disks are either readonly (in
+- * which case cache mode doesn't matter) or used with cache=none */
++ * which case cache mode doesn't matter) or used with cache=none or used with cache=directsync */
+ 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 @@ qemuMigrationIsSafe(virDomainDefPtr def,
+
+ 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;
+ }
+ }
diff --git a/debian/patches/series b/debian/patches/series
index 64cdf94..439b72c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -23,3 +23,4 @@ CVE-2017-2635-qemu-Don-t-update-physical-storage-size-of-.patch
apparmor-allow-usr-lib-qemu-qemu-bridge-helper.patch
qemu-skip-QMP-probing-of-CPU-definitions-when-missing.patch
security/qemu-ensure-TLS-clients-always-verify-the-server-certific.patch
+qemu-shared-disks-with-cache-directsync-should-be-safe-fo.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libvirt.git
More information about the Pkg-libvirt-commits
mailing list