From nobody Sat May 4 08:06:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1558536828; cv=none; d=zoho.com; s=zohoarc; b=oWEt3mNG+Dpj+GkOKskJdDfaizBWHTHi7l2rPPZccpLDn9Da8taOEy9Y0bgeMd2zcvEDnIj+FQRbsW0TlqMbux1Us2bw1YjSSzWrzOTnML+MToXIwkSIqKCvPwjwrPecTGXJsjTZcBS7mtlpo0xLW4OupSefE/9/3/vSi3zeCaU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558536828; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=euQatmEjQHXI00a68DLBvXDdQPS7n4gu2ATLmiUq6DI=; b=AL39hp9fbMBR57ZvlWELv8kuY1zk8nJDjim3t9JKwuc7swYsJ5JXbFaZF/Kt6Sp0d6YLvIRCcZaEk5gKc4QVMbLcMeUM9ZlChGY3Ndh0K2ZxNCIgvOsE6bThpP0BqYf44CvjfWyJh6ETs5BCqNQkczKYhSfP8pY0NLANa2exasI= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1558536828848517.8446256118483; Wed, 22 May 2019 07:53:48 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hTSbH-0006tv-S7; Wed, 22 May 2019 14:52:15 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hTSbG-0006tq-3z for xen-devel@lists.xenproject.org; Wed, 22 May 2019 14:52:14 +0000 Received: from esa3.hc3370-68.iphmx.com (unknown [216.71.145.155]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 2d8e82f4-7ca1-11e9-bc90-f35a84c7d611; Wed, 22 May 2019 14:52:11 +0000 (UTC) X-Inumbo-ID: 2d8e82f4-7ca1-11e9-bc90-f35a84c7d611 Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@citrix.com; spf=Pass smtp.mailfrom=anthony.perard@citrix.com; spf=None smtp.helo=postmaster@MIAPEX02MSOL02.citrite.net Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=23.29.105.83; receiver=esa3.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa3.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 23.29.105.83 as permitted sender) identity=mailfrom; client-ip=23.29.105.83; receiver=esa3.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:23.29.105.83 ip4:162.221.156.83 ~all" Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@MIAPEX02MSOL02.citrite.net) identity=helo; client-ip=23.29.105.83; receiver=esa3.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@MIAPEX02MSOL02.citrite.net"; x-conformance=sidf_compatible IronPort-SDR: 8KztN3V2gd9am0NFC/sQeoBbMmR5PGYKQE9WfY1uevOmaVqXgOQ+9mPg60yQhgnCdPXkPtMmRp N6Eq6CGKlUfoBjBwt1+xptHw+iI0F0GXFSEpMKbRH77j1kqOAv10Ui4DDhD0yHAejmZbPxF/DL V6mGVINyuw/tsGzkT5z0X7dq7xNcQkSfJKRAa6iPIJXR1WzDXL0/R0ypqV2uRtI9HvvnDzEEZ6 z+aRVPuKin/GfWESO6cglWgB6yFBEPEYGEz0ecgjCCGXU/aedFGI6dCKgTIo1bIwlcmfOEhD/5 NoE= X-SBRS: 2.7 X-MesageID: 783595 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 23.29.105.83 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.60,499,1549947600"; d="scan'208";a="783595" From: Anthony PERARD To: Date: Wed, 22 May 2019 15:51:40 +0100 Message-ID: <20190522145140.12943-1-anthony.perard@citrix.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH qemu-xen 4.10 & 4.11] xen_disk: Disable file locking for the PV disk backend X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD , Olaf Hering , Wei Liu , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Since QEMU 2.10 (or qemu-xen-4.10), qemu locks disk images to avoid them been re-opened in a different qemu process. With Xen, there are two issues: - For HVM guests, a disk image can be open twice! One by the emulation driver, and one by the PV backend. - During migration, the qemu process of the newly spawned domain may attempt to access the disk image before the domain been migrated and the qemu process are been completely destroyed. Migration of HVM guest as been taken care of in libxl, but migration of PV guest with qdisk and HVM guest attempting to access the PV disk before unplugging the emulated disk are still an issue. For these reasons, we don't want to have QEMU use a locking mechanism with the PV backend. This is already done by db9ff46eeb in QEMU upstream, or QEMU 4.0. Affected version of QEMU are: - qemu-xen of Xen 4.10 and 4.11 - QEMU 2.10, 2.11, 2.12, 3.0 and 3.1 Signed-off-by: Anthony PERARD --- Hi Olaf, Roger, Wei, Instead of a fix in libxl (with the reverted patch "libxl: fix migration of PV and PVH domUs with and without qemu"), what do you think of this QEMU patch? It is much simpler that trying to work around the issue in libxl, and it fix one more problem that still exist. This patch is only for stable branches as Xen unstable already have a qemu with a similar patch. Can you give it a try with one of the affected qemu? (qemu-xen-4.10 or qemu-xen-4.11) Thanks, --- hw/block/xen_disk.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c index e431bd89e8..cbff174a98 100644 --- a/hw/block/xen_disk.c +++ b/hw/block/xen_disk.c @@ -1084,11 +1084,18 @@ static int blk_connect(struct XenDevice *xendev) Error *local_err =3D NULL; QDict *options =3D NULL; =20 + options =3D qdict_new(); + if (strcmp(blkdev->fileproto, "")) { - options =3D qdict_new(); qdict_put_str(options, "driver", blkdev->fileproto); } =20 + /* + * It is necessary to turn file locking off as an emulated device + * may have already opened the same image file. + */ + qdict_put_str(options, "file.locking", "off"); + /* setup via xenbus -> create new block driver instance */ xen_pv_printf(&blkdev->xendev, 2, "create new bdrv (xenbus setup)\= n"); blkdev->blk =3D blk_new_open(blkdev->filename, NULL, options, --=20 Anthony PERARD _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel