From nobody Thu May 9 13:09:06 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=yahoo-corp.jp Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1707888700187718.7757159164796; Tue, 13 Feb 2024 21:31:40 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 203B719DE; Wed, 14 Feb 2024 00:31:39 -0500 (EST) Received: from lists.libvirt.org.85.43.8.in-addr.arpa (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id D9CDF1B20; Wed, 14 Feb 2024 00:28:31 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 7B9BD199B; Wed, 14 Feb 2024 00:28:16 -0500 (EST) Received: from corp-ob10.yahoo-corp.jp (corp-ob10.yahoo-corp.jp [182.22.125.210]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 4FED519A1 for ; Wed, 14 Feb 2024 00:28:14 -0500 (EST) Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01lp2168.outbound.protection.outlook.com [104.47.23.168]) by corp-ob10.yahoo-corp.jp (Postfix) with ESMTPS id C59A519FB182; Wed, 14 Feb 2024 14:18:21 +0900 (JST) Received: from TY3PR01MB11283.jpnprd01.prod.outlook.com (2603:1096:400:36e::13) by OS0PR01MB5634.jpnprd01.prod.outlook.com (2603:1096:604:b8::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.26; Wed, 14 Feb 2024 05:18:21 +0000 Received: from TY3PR01MB11283.jpnprd01.prod.outlook.com ([fe80::48b5:b00d:f202:50f2]) by TY3PR01MB11283.jpnprd01.prod.outlook.com ([fe80::48b5:b00d:f202:50f2%5]) with mapi id 15.20.7270.036; Wed, 14 Feb 2024 05:18:21 +0000 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W1BgDkL6jbAGWTEteWR9OJ5RUegATuCsGhChZY4eb8UKuFLU4vw7klzMzmH3plj1UcMTP673BuxN7RjxGRSXs7kG4auLvrJBE/wX9tommbdBui4dDBOkGfVGUxFvbQw2rhmQR9gCryxvRBuKCv1jrxiq4dbGSqgGELPudMidgFLeI4ShhGJNWTgwaGFHgbw4bSOq7/2hZ39MGj4UkXZCZgmYi00yqMW1/T6yUwN/QMZ07yz5FYs3L6kFZutTltQ0qr/CxXZPzFqHzh0N54HP6p7+oCc95/BVWS2Ux/hkTq6QPMp20jFaNl62Xo8xhfK4gmUtfnIpqx3m+jzJ50jyMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KjUb240ZHUHuYyOBXZB7ajGiwpCARsDkhz7rDCfDXNk=; b=RCHq2M/yKCVYpM9PlgZibKyLAcBSNPUTK6NllUAvsPAgbmLvjF4O5myj/ae8nhs9cMXUuoULy38m5PqwYoXIUqmYxPz5fpJ3krvZmWTQNGOjMlwI7yYAt7MWYC4Qk/gK/ZoGEpygjPj0Wvr4ExrAckls64oJXg8YEXnuWrPH7WLKxu9iaoMK5xMmXj4vbyVuv8Pk/+nZFC5o3Q1tphdfaTGv6kf34nXtXZyqNPHP5E0aC2QZFhqOlA8x+Tvgk0lmnCi2WVjU5HGLNaT2CU5CyxTtfAfKc/PqPNLQcQ/wOgNndkDNghZpgvfY5Uy2rKfeH2Z4VoCMbmJi72DNpsMMaA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=yahoo-corp.jp; dmarc=pass action=none header.from=yahoo-corp.jp; dkim=pass header.d=yahoo-corp.jp; arc=none From: Hiroki Narukawa To: devel@lists.libvirt.org Subject: [PATCH 1/2] conf: add locking option to disk source Date: Wed, 14 Feb 2024 14:17:57 +0900 Message-Id: <20240214051758.4611-2-hnarukaw@yahoo-corp.jp> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240214051758.4611-1-hnarukaw@yahoo-corp.jp> References: <20240214051758.4611-1-hnarukaw@yahoo-corp.jp> X-ClientProxiedBy: OSTPR01CA0017.jpnprd01.prod.outlook.com (2603:1096:604:221::14) To TY3PR01MB11283.jpnprd01.prod.outlook.com (2603:1096:400:36e::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TY3PR01MB11283:EE_|OS0PR01MB5634:EE_ X-MS-Office365-Filtering-Correlation-Id: efe46fe8-5ce2-49d7-faac-08dc2d1c5c2f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cbsAm6ksaLDlzRi1qp6SaYm7OB9DV9m5+R49A7ePQfDhv526IF1uPgywd/sOsoc9KhxfmhZpElu4/ysIHnS+hWqZnnfZ7rRey1Ke1GlYDR9CnLQqn2oCNsrqpO71SXmwblXjHY0rPFX0O9ssw4R7YA7/zRlMofUzNEibb1CX8MWxPQHiuU1i/p984kG/747HVBxQJgMAKxC3XPI0A+8aOMOgHBw6oHuJvzSYiAuIG7ZdxZEJ6lY5P5eGx/n4WPzi8wSS7zscyjvQ0A4x53z9w2T38H56WhcSWvERPJM50DJLRL3ck5MRFyp1aSsN4EenNkPCsbYAj7WkYwd/OMwxCpPXbG96+6nHm4ofdFjDDX3uP9+MDsBS5+JieUbF6TpeIhTF7ijrX3Td8zu/XTL6ysh4aEC17rfaejwSy5xZ0hK9eA6Ln0i8UtvDABRoYZmRbrKWS7+kCy09cIL8zpey8R7qO51SeV2jBasbZrYJha1R8dD6QKPo3BVroN6diRPQ8nzvZuKt7PScLGv8LRcZb6u4I4IpLk1L0rKPksMCi/xLcO9Y++zNM2aardHmcGmW3XKVrea3XjCE0J3gHNR3HhW/1Q1Ojl2FbksmASz0sOZD0pX219D9k2I3fArBGPd/ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TY3PR01MB11283.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366004)(39860400002)(376002)(136003)(346002)(396003)(230922051799003)(64100799003)(451199024)(1800799012)(186009)(2906002)(5660300002)(38100700002)(478600001)(6506007)(6512007)(6486002)(52116002)(86362001)(83380400001)(41300700001)(36756003)(26005)(2616005)(1076003)(38350700005)(4326008)(66556008)(8936002)(8676002)(66946007)(6916009)(66476007)(6666004)(316002)(82960400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?e2BeE8tmnPm05vCyBP5J+onvysvr9Wz2Vb5xNFeG0SsVzqg8ToT4rikFHo4p?= =?us-ascii?Q?5zP8y3qWRVWJrGPRIlTJ9SQKCg+2XNcBIx/0eZRMeFp/FLHUT/aFwjUSxhZM?= =?us-ascii?Q?B/eHdpLUZmwBYHwWLQ/XqTh3nmEJkNytxy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FD2b3BcSw3lmfvW5XiQE28VwCghvCWdFNrjhPrVlmCBqUy3dssVVlZJMd7?= =?us-ascii?Q?XkdIZtUakyqltKUlUCEh19wiQLLbWyWsTtEmGHkVvDIH/5Lizu9nWXjg/fy1?= =?us-ascii?Q?08sBP+eptWmvWwhXODq3IXBRnRz7Tvt3UAF4gz6/WCetfxtZTF+GOryH30F1?= =?us-ascii?Q?ZZ4OWLNBZIeLu6JKnT52yLvw0gUkAwlIwnxkNjaP0MVgoX26Eil86iuxQGBX?= =?us-ascii?Q?i0iLDr5S3XDqQmdpJCnADwjmn2aFgOcpIKQuhUWg3KRv1TQvm7s7JFCIiyWH?= =?us-ascii?Q?yQStTPNixH+OyphYcJzM+6WQkRjTUGVWKqRPkwYnjPtwT7wtnKjIHj5/jDOL?= =?us-ascii?Q?PeKYpNlyK5AwYMgrY4pobJobmg7uh3U99ChHs9JppdXJ5Ezc9BMwSPsqTWMD?= =?us-ascii?Q?oXlwlKSCi1/0jLpo/bW3OPN3c1dhdmo1GiZjaP/DV/59+F8tvZ90BgIpV3V9?= =?us-ascii?Q?wZIPl6zAJ3wKae4/xkOGuezLHVNe/Bn2znaFSugSNp8E6sQQ0yh3mnjyl802?= =?us-ascii?Q?ZCey67KC6Uuc9TA04Jaql+uCfO3B3fLMNP5PsxBVIfVZPGvczZlbqJQlZnR1?= =?us-ascii?Q?sA=3D=3D?= X-OriginatorOrg: yahoo-corp.jp X-MS-Exchange-CrossTenant-Network-Message-Id: efe46fe8-5ce2-49d7-faac-08dc2d1c5c2f X-MS-Exchange-CrossTenant-AuthSource: TY3PR01MB11283.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Feb 2024 05:18:20.9868 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a208d369-cd4e-4f87-b119-98eaf31df2c3 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Ne3MRabE6wqJNdLq5xz423U8s/AWGhMgljlXXiyK47ky5z43thzuWS8+JtYEwnpOpq3WIV0wyUZubB9W0PBSPQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS0PR01MB5634 Message-ID-Hash: AV7MHL2SWX2SD375FGF76S4K63PKJBQM X-Message-ID-Hash: AV7MHL2SWX2SD375FGF76S4K63PKJBQM X-MailFrom: hnarukaw@yahoo-corp.jp X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: aoiwa@lycorp.co.jp X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1707888701386100001 There is a case that locking hits a bug and users wants to disable locking like bug in Linux kernel. This commit adds option to configure locking for file source. Signed-off-by: Hiroki Narukawa --- docs/formatdomain.rst | 5 +++++ src/conf/domain_conf.c | 8 ++++++++ src/conf/schemas/domaincommon.rng | 5 +++++ src/conf/storage_source_conf.h | 3 +++ 4 files changed, 21 insertions(+) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 0a4f9d9000..95869d573c 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -2782,6 +2782,11 @@ paravirtualized driver is specified via the ``disk``= element. via the filesystem. The filename passed via ``file`` can still be us= ed to generate paths to write into image metadata when doing block oper= ations but libvirt will not access these natively. + + :since:`Since 10.1.0` a new optional attribute ``locking`` can be ad= ded + which can take "on" or "off". Basically this option should be kept + default, but it can be used explicitly for workaround about bug in + locking. ``block`` The ``dev`` attribute specifies the fully-qualified path to the host device to serve as the disk. :since:`Since 0.0.3` diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 3597959e33..b7cefffc7c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -7563,6 +7563,10 @@ virDomainStorageSourceParse(xmlNodePtr node, ctxt, flags) < 0) return -1; =20 + if (virXMLPropTristateSwitch(node, "locking", VIR_XML_PROP_NONE, + &src->locking) < 0) + return -1; + /* People sometimes pass a bogus '' source path when they mean to omit= the * source element completely (e.g. CDROM without media). This is just a * little compatibility check to help those broken apps */ @@ -22544,6 +22548,10 @@ virDomainDiskSourceFormat(virBuffer *buf, if (attrIndex && src->id !=3D 0) virBufferAsprintf(&attrBuf, " index=3D'%u'", src->id); =20 + if (src->locking) + virBufferEscapeString(&attrBuf, " locking=3D'%s'", + virTristateSwitchTypeToString(src->locking)); + if (virDomainDiskSourceFormatPrivateData(&childBuf, src, flags, xmlopt= ) < 0) return -1; =20 diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincom= mon.rng index df44cd9857..8ccb1dd162 100644 --- a/src/conf/schemas/domaincommon.rng +++ b/src/conf/schemas/domaincommon.rng @@ -1789,6 +1789,11 @@ + + + + + diff --git a/src/conf/storage_source_conf.h b/src/conf/storage_source_conf.h index 05b4bda16c..3984614a3d 100644 --- a/src/conf/storage_source_conf.h +++ b/src/conf/storage_source_conf.h @@ -356,6 +356,9 @@ struct _virStorageSource { /* image is shared across hosts */ bool shared; =20 + /* intended to use for workaround */ + virTristateSwitch locking; + /* backing chain of the storage source */ virStorageSource *backingStore; =20 --=20 2.25.1 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org From nobody Thu May 9 13:09:06 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=yahoo-corp.jp Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1707888442007508.96383082376155; Tue, 13 Feb 2024 21:27:22 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 959EF19A3; Wed, 14 Feb 2024 00:27:20 -0500 (EST) Received: from lists.libvirt.org.85.43.8.in-addr.arpa (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id AE48819A5; Wed, 14 Feb 2024 00:25:48 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 0035B19A3; Wed, 14 Feb 2024 00:25:44 -0500 (EST) Received: from corp-ob09.yahoo-corp.jp (corp-ob09.yahoo-corp.jp [182.22.125.216]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id D7F1A19A1 for ; Wed, 14 Feb 2024 00:25:42 -0500 (EST) Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01lp2169.outbound.protection.outlook.com [104.47.23.169]) by corp-ob09.yahoo-corp.jp (Postfix) with ESMTPS id DC38419FB181; Wed, 14 Feb 2024 14:18:22 +0900 (JST) Received: from TY3PR01MB11283.jpnprd01.prod.outlook.com (2603:1096:400:36e::13) by OS0PR01MB5634.jpnprd01.prod.outlook.com (2603:1096:604:b8::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.26; Wed, 14 Feb 2024 05:18:21 +0000 Received: from TY3PR01MB11283.jpnprd01.prod.outlook.com ([fe80::48b5:b00d:f202:50f2]) by TY3PR01MB11283.jpnprd01.prod.outlook.com ([fe80::48b5:b00d:f202:50f2%5]) with mapi id 15.20.7270.036; Wed, 14 Feb 2024 05:18:21 +0000 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-Greylist: delayed 437 seconds by postgrey-1.37 at lists.libvirt.org; Wed, 14 Feb 2024 00:25:42 EST ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TpiR9/7moEW6sWwPtB1gUxFs54ebc6fxmrjtCOK8cGXudwbkdlSDKW7Ot+R1/reknznokfyuVgwF8tSaCTsd+IesqMubYRaCA67aRk9JjMdeSy0jR7NLLLIZUGA+QpXPCRRfld+VUr0iiwxnZWgxswyYxHSfJGvAQjSuGt89EGo3gltK8D4O0WB9nE+88Ykjtx2roaUwiAfuUGPyZAX3tXDr0lb2pR+96O9gl8fOXHSq6CpBuhwAexHeAOxGTICsIySCninrH9+yRrlpTD+w9AtRvd4KcR2tNCg43LeEMNT8GGD6VQU8u9HIMp0lzdcduCtZWwyvGxUnkTM5E9dGGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=x68lOwSVDj4tWh9pB1uU7qkVjzlRqGJynG4CSCjkqgc=; b=iqEfF7ffdnSN3RhfhUKNBiAar4rrpQlMe7w5p0EzBDup/oQ0Im+0OIeb5rX87YTb5ULU7SHXVbFUv+VxkKcX3rPXbO5B4LUl+xfMPfHmaT6PZ4gTlK9sDbF3jOjFlI89hBTjfnZoQGpm6x7rUS3+tM1Psj7OWklvKLF5HZJI2iEihXqUzE31CQffd5+BC5Wvz6kho6q3c38I9hocYCmDVLMWpfcD3XkHMtwv0GVEz6B1MhvYs7QNR/cC+khVfgpesPot/d9ljFjRNOZAOejxEBvpepDp8UfDl9rS7bsBaZ/ZbPj+yR9yQ1Kp4WrhrUtiZw+xfrRWMPocbI1DDbkv/Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=yahoo-corp.jp; dmarc=pass action=none header.from=yahoo-corp.jp; dkim=pass header.d=yahoo-corp.jp; arc=none From: Hiroki Narukawa To: devel@lists.libvirt.org Subject: [PATCH 2/2] qemu_block: add locking option Date: Wed, 14 Feb 2024 14:17:58 +0900 Message-Id: <20240214051758.4611-3-hnarukaw@yahoo-corp.jp> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240214051758.4611-1-hnarukaw@yahoo-corp.jp> References: <20240214051758.4611-1-hnarukaw@yahoo-corp.jp> X-ClientProxiedBy: OSTPR01CA0017.jpnprd01.prod.outlook.com (2603:1096:604:221::14) To TY3PR01MB11283.jpnprd01.prod.outlook.com (2603:1096:400:36e::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TY3PR01MB11283:EE_|OS0PR01MB5634:EE_ X-MS-Office365-Filtering-Correlation-Id: 28997fb3-9dea-4709-c6b1-08dc2d1c5c6d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zIWmdshKtobwSDV71wRoDPI2tfKf0I6DCEx/gihx5w+7iH5MrU6Da27A7gRmTNo8bdSiJBDo3sEM86crB/x4C4lUCcFkToq4kBIEGVxJq2lBEa8n5NsfWwWPQEyb8SEdvO4GvyoN9c5UTky+pEKqte4LQq348aihug377gzyZg+/FZ5LAEhQ6mVe3VJ2X60vGwr49Hjp6IViIoEoV05ZRxyJOa8E1bhIILP1XmLYG555UQmb/5RhhyT4iPm5tIbmjkUcKJ4RFRxeOqDPKcbOezuBxus43qHfRQ7fcBupJQAMg4yAgW8XJBw70rcIhCuDbibElJXTTgzNfw7y76uqLPAiKHxVK2od+TMMZmXKYQfiXX6AnzTq/emo2jAH6WjO/fpOiHoIqw8KsO/hJ7GDu+7oM0GFPYG+S0mkNW/kc7MziRg52sL0vbqboyROGiv0VicbhiwWT2aYbljtij53vZ8veSc37q9R0VpiiuherTHdY1cIAlpyGDuzaH2nm0jXENN8jIL4P28wum9LPyQ0jQ7ivvHbFXsvO2rKH08nfAnCKyPBmIi541vq95770X2RNfEZ5hNE6sCl0Kr8Ia7k9x8g6jM3Rsvg2wTOSRvtFB5tUmAJuogQwPfPsJaAZbak X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TY3PR01MB11283.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366004)(39860400002)(376002)(136003)(346002)(396003)(230922051799003)(64100799003)(451199024)(1800799012)(186009)(2906002)(5660300002)(38100700002)(478600001)(6506007)(6512007)(6486002)(52116002)(86362001)(83380400001)(41300700001)(36756003)(26005)(2616005)(1076003)(38350700005)(4326008)(66556008)(8936002)(8676002)(66946007)(6916009)(66476007)(6666004)(316002)(82960400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?c5o/ShHOURRo6JWUDcLf4KXlkBPDqr82JgZH2A0Ddy8xU2xR3OAwHQLAo5Dw?= =?us-ascii?Q?9Er6/rIOooVsn2ju3YyWMX30EJboevBXMKJ/NdyReWuQsmQjR6/pffNdVxTW?= =?us-ascii?Q?IloDMK+IsqRVzhtH9YQ+OJwfslmwsLetbwD4LiGCELCU/0Nsn2DnEZbfH/et?= =?us-ascii?Q?k9EWcdE+heGqDt021IgbJbb8ZnfiSSws3l3hsoXhW1zbc0zm+2VWDAYKWdo9?= =?us-ascii?Q?RD5r+mJg2TJZ3copQa3hhJW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?us-ascii?Q?dqOwrjhBCEthG4aOg0W1ouwNQ1Pb6Ojldte+Iuqss5m4jzI9aFu7goCHSsd1?= =?us-ascii?Q?7ox2cT9GrULTGohWAzH4e8PFqn9sbJHBXDr5cR86Cwq9tYfM5aP5PI2r4giX?= =?us-ascii?Q?5cAvKyD/zlRtBvmr0GcQNXhA1fL5xpj7V2aIWq4ikFLu2REzYQcDXz8bicI5?= =?us-ascii?Q?pO1iN0gmsxjNoxc6J3eyVdXoRHVg1N6bZOpV8/5xDYBTG5XapdyrQ94No6Q/?= =?us-ascii?Q?xwZpSkx9s82u/u0SL6B+FmjoEe8mfDFFO2ecG7oTJwHzBPRjlwI/6yhhiCdy?= =?us-ascii?Q?TAKXsoQFwGCbcSIKM4oQBUJy1nL+iw3N6IKE7NDtAALPNXydDVkr/ejCACdN?= =?us-ascii?Q?a9kHTAWMqPiJJJlO8pJOn1NaA/ZSTaz3FK1ivcscjfxMzQ7FF3gLP4yXWU/z?= =?us-ascii?Q?8LtTCSRMDvpPF69UYypX54aIjQLFNT7A16I0Qnj1/gKhjfIO9yzxhP6jGXH7?= =?us-ascii?Q?sw=3D=3D?= X-OriginatorOrg: yahoo-corp.jp X-MS-Exchange-CrossTenant-Network-Message-Id: 28997fb3-9dea-4709-c6b1-08dc2d1c5c6d X-MS-Exchange-CrossTenant-AuthSource: TY3PR01MB11283.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Feb 2024 05:18:21.3860 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a208d369-cd4e-4f87-b119-98eaf31df2c3 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: B3hxRp8LujqY8iNxrmKJK+KMg5T3eZla7L1dGIM4bNqSnWHMYFk7lyt9BUa6gZaMvLikQDZk8xD4veiPWi1PNw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS0PR01MB5634 Message-ID-Hash: ZFBYTCTNQZYLKS2OCQIQJ4CMTJP5YSVL X-Message-ID-Hash: ZFBYTCTNQZYLKS2OCQIQJ4CMTJP5YSVL X-MailFrom: hnarukaw@yahoo-corp.jp X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: aoiwa@lycorp.co.jp X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1707888444033100001 There is a case that locking hits a bug and users wants to disable locking like bug in Linux kernel. This commit adds actual qemu option to the domain conf added in previous commit. Signed-off-by: Hiroki Narukawa --- src/qemu/qemu_block.c | 7 ++++++ tests/qemublocktest.c | 1 + ...le-raw-aio_native-locking-off-srconly.json | 10 ++++++++ .../file-raw-aio_native-locking-off.json | 23 +++++++++++++++++++ .../file-raw-aio_native-locking-off.xml | 12 ++++++++++ 5 files changed, 53 insertions(+) create mode 100644 tests/qemublocktestdata/xml2json/file-raw-aio_native-lo= cking-off-srconly.json create mode 100644 tests/qemublocktestdata/xml2json/file-raw-aio_native-lo= cking-off.json create mode 100644 tests/qemublocktestdata/xml2json/file-raw-aio_native-lo= cking-off.xml diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 738b72d7ea..5905898b38 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -852,6 +852,13 @@ qemuBlockStorageSourceGetFileProps(virStorageSource *s= rc, "S:aio", iomode, "S:pr-manager", prManagerAlias, NULL) < 0); + + if (src->locking) { + const char *lockingStr =3D virTristateSwitchTypeToString(src->lock= ing); + if (virJSONValueObjectAdd(&ret, "S:locking", lockingStr, NULL) < 0) + return NULL; + } + return ret; } =20 diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index c581bd1748..3b005cb475 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -1116,6 +1116,7 @@ mymain(void) TEST_DISK_TO_JSON("dir-fat-readonly"); TEST_DISK_TO_JSON("dir-fat-floppy"); TEST_DISK_TO_JSON("file-raw-aio_native"); + TEST_DISK_TO_JSON("file-raw-aio_native-locking-off"); TEST_DISK_TO_JSON("file-backing_basic-aio_threads"); TEST_DISK_TO_JSON("file-backing_basic-aio_io_uring"); TEST_DISK_TO_JSON("file-raw-luks"); diff --git a/tests/qemublocktestdata/xml2json/file-raw-aio_native-locking-o= ff-srconly.json b/tests/qemublocktestdata/xml2json/file-raw-aio_native-lock= ing-off-srconly.json new file mode 100644 index 0000000000..88c9970ccf --- /dev/null +++ b/tests/qemublocktestdata/xml2json/file-raw-aio_native-locking-off-srco= nly.json @@ -0,0 +1,10 @@ +( + source only properties: + { + "driver": "file", + "filename": "/path/to/i.img", + "locking": "off" + } + backing store string: + /path/to/i.img +) diff --git a/tests/qemublocktestdata/xml2json/file-raw-aio_native-locking-o= ff.json b/tests/qemublocktestdata/xml2json/file-raw-aio_native-locking-off.= json new file mode 100644 index 0000000000..aeb483e4b4 --- /dev/null +++ b/tests/qemublocktestdata/xml2json/file-raw-aio_native-locking-off.json @@ -0,0 +1,23 @@ +{ + "node-name": "test1", + "read-only": false, + "cache": { + "direct": true, + "no-flush": false + }, + "driver": "raw", + "file": "test2" +} +{ + "driver": "file", + "filename": "/path/to/i.img", + "aio": "native", + "locking": "off", + "node-name": "test2", + "auto-read-only": true, + "discard": "unmap", + "cache": { + "direct": true, + "no-flush": false + } +} diff --git a/tests/qemublocktestdata/xml2json/file-raw-aio_native-locking-o= ff.xml b/tests/qemublocktestdata/xml2json/file-raw-aio_native-locking-off.x= ml new file mode 100644 index 0000000000..9e6a9d26bc --- /dev/null +++ b/tests/qemublocktestdata/xml2json/file-raw-aio_native-locking-off.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + --=20 2.25.1 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org