From nobody Fri Apr 26 10:59:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1499427770446300.37808052863386; Fri, 7 Jul 2017 04:42:50 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2940885543; Fri, 7 Jul 2017 11:42:48 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7CFAA7E911; Fri, 7 Jul 2017 11:42:47 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 44C141803B26; Fri, 7 Jul 2017 11:42:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v67BYswI029235 for ; Fri, 7 Jul 2017 07:34:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id E36C66C95C; Fri, 7 Jul 2017 11:34:54 +0000 (UTC) Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DF6445E261 for ; Fri, 7 Jul 2017 11:34:51 +0000 (UTC) Received: from mx7.zte.com.cn (mx7.zte.com.cn [202.103.147.169]) by mx1.redhat.com (Postfix) with ESMTP id 7FB743B714 for ; Fri, 7 Jul 2017 11:34:49 +0000 (UTC) Received: from unknown (HELO mse01.zte.com.cn) (10.30.3.20) by localhost with (AES256-SHA encrypted) SMTP; 7 Jul 2017 10:57:03 -0000 Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id v67B97Db027934 for ; Fri, 7 Jul 2017 19:09:07 +0800 (GMT-8) (envelope-from peng.hao2@zte.com.cn) Received: from localhost.localdomain ([10.74.120.59]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2017070719091402-3403619 ; Fri, 7 Jul 2017 19:09:14 +0800 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2940885543 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=zte.com.cn Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 2940885543 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7FB743B714 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=zte.com.cn Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=peng.hao2@zte.com.cn DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 7FB743B714 X-scanvirus: By SEG_CYREN AntiVirus Engine X-scanresult: CLEAN X-MAILFROM: X-RCPTTO: X-FROMIP: 10.30.3.20 X-SEG-Scaned: 1 X-Received: unknown,10.30.3.20,20170707185703 From: Peng Hao To: libvir-list@redhat.com Date: Sat, 8 Jul 2017 03:23:45 +0800 Message-Id: <1499455425-46366-1-git-send-email-peng.hao2@zte.com.cn> X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2017-07-07 19:09:14, Serialize by Router on notes_smtp/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2017-07-07 19:08:51, Serialize complete at 2017-07-07 19:08:51 X-MAIL: mse01.zte.com.cn v67B97Db027934 X-HQIP: 127.0.0.1 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 203 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 07 Jul 2017 11:34:50 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 07 Jul 2017 11:34:50 +0000 (UTC) for IP:'202.103.147.169' DOMAIN:'mx7.zte.com.cn' HELO:'mx7.zte.com.cn' FROM:'peng.hao2@zte.com.cn' RCPT:'' X-RedHat-Spam-Score: 0.425 (BAYES_50, DATE_IN_FUTURE_06_12, RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RP_MATCHES_RCVD, SPF_PASS) 202.103.147.169 mx7.zte.com.cn 202.103.147.169 mx7.zte.com.cn X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com X-Mailman-Approved-At: Fri, 07 Jul 2017 07:42:45 -0400 Cc: peng.hao2@zte.com.cn, wang.yechao255@zte.com.cn Subject: [libvirt] [PATCH] qemu: shared disks with cache=directsync should be safe for migration X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 07 Jul 2017 11:42:49 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Hao Peng At present shared disks can be migrated with either readonly or cache=3Dnon= e. But cache=3Ddirectsync should be safe for migration, because both cache=3Ddirec= tsync and cache=3Dnone don't use the host page cache, and cache=3Ddirect write through qemu block = layer cache. Signed-off-by: Peng Hao Reviewed-by: Wang Yechao --- 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 c23fffe..9d509dd 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -1160,11 +1160,12 @@ qemuMigrationIsSafe(virDomainDefPtr def, const char *src =3D virDomainDiskGetSource(disk); =20 /* Our code elsewhere guarantees shared disks are either readonly = (in - * which case cache mode doesn't matter) or used with cache=3Dnone= */ + * which case cache mode doesn't matter) or used with cache=3Dnone= or used with cache=3Ddirectsync */ if (virStorageSourceIsEmpty(disk->src) || disk->src->readonly || disk->src->shared || - disk->cachemode =3D=3D VIR_DOMAIN_DISK_CACHE_DISABLE) + disk->cachemode =3D=3D VIR_DOMAIN_DISK_CACHE_DISABLE || + disk->cachemode =3D=3D VIR_DOMAIN_DISK_CACHE_DIRECTSYNC) continue; =20 /* disks which are migrated by qemu are safe too */ @@ -1188,7 +1189,7 @@ qemuMigrationIsSafe(virDomainDefPtr def, =20 virReportError(VIR_ERR_MIGRATE_UNSAFE, "%s", _("Migration may lead to data corruption if disks" - " use cache !=3D none")); + " use cache !=3D none or cache !=3D directsync")); return false; } =20 --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list