From nobody Sat May 18 05:04:53 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1706812253; cv=none; d=zohomail.com; s=zohoarc; b=JC8c6aflesarLTrcPVXbTq/CjqLfCJ3Db5v5ERU7VFCAxGmxwZRL7WXATJ4/Eue1DDhObhRsrW1HTS93hNdk6kkLIqxGl71ASDh0T2xUfVt9aH3z6kG5VhZBN/0MamTR8nQr0N/09dHYdipWtn/l6HvEvYl1Kgrzukc3oYLYDdQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706812253; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+F33WLb8SsbhR8svkMBYfGDsCEmngZ8q/7ZaljEVS3M=; b=L7zuhUT+Twl8ftTF5H9Pxv/wkzhrCsSGKBK9CBhe4EMad42iBuTDkTyOjfztVjWnzYLyvrdIcnP5J6EbCm2HYBvNitdY9jraFLbKMZQeo/hkfFBfg0BogjWSwvSoXzVL1m8niq7NRDAmObJO+U6r/IZJU7nbiAXk/4yeVHhqlKI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1706812253552585.83846103313; Thu, 1 Feb 2024 10:30:53 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.674669.1049740 (Exim 4.92) (envelope-from ) id 1rVbph-0002Fe-6I; Thu, 01 Feb 2024 18:30:41 +0000 Received: by outflank-mailman (output) from mailman id 674669.1049740; Thu, 01 Feb 2024 18:30:41 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rVbph-0002FV-3R; Thu, 01 Feb 2024 18:30:41 +0000 Received: by outflank-mailman (input) for mailman id 674669; Thu, 01 Feb 2024 18:30:40 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rVbpg-00020T-Im for xen-devel@lists.xenproject.org; Thu, 01 Feb 2024 18:30:40 +0000 Received: from mail-qv1-xf32.google.com (mail-qv1-xf32.google.com [2607:f8b0:4864:20::f32]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id ffd0bc85-c12f-11ee-8a43-1f161083a0e0; Thu, 01 Feb 2024 19:30:40 +0100 (CET) Received: by mail-qv1-xf32.google.com with SMTP id 6a1803df08f44-6818a9fe380so7291216d6.2 for ; Thu, 01 Feb 2024 10:30:40 -0800 (PST) Received: from pm2-ws13.praxislan02.com (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com. [207.172.141.204]) by smtp.gmail.com with ESMTPSA id pf8-20020a056214498800b0068c75141e73sm25824qvb.2.2024.02.01.10.30.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 10:30:37 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: ffd0bc85-c12f-11ee-8a43-1f161083a0e0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706812238; x=1707417038; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+F33WLb8SsbhR8svkMBYfGDsCEmngZ8q/7ZaljEVS3M=; b=UwPIDUq10isCpumWgi97FEc+KPHMV/lzjQUdUJom8FKLNOJFrxvg3FpDxy5n1gp0SE ILP/i+JESIXyEntN9bZ7ZnT0kSF9Lghvd2zwS+Ry47cSDo81pHYekxtpC4VRgBVOFAK/ a1Yld2ffKmAMfgyouFIDep2M93QDSeBunhSO4rlgMxWgc3obZ0v6hJoL3n1Xv7GSDkMi OPccFDprcDcMguOjOwAyltWBf8EWXT58S4poeFpQKBBALojtDoGsdS2+p8gToes8vzkC uPGaBEHFBmakozTIu8ss+w5px7ICfrjYndxV+xBhNnPn2AQScBW7p7OEV2VSRyJHvWF4 S6tA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706812238; x=1707417038; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+F33WLb8SsbhR8svkMBYfGDsCEmngZ8q/7ZaljEVS3M=; b=u0KzJ0SFsLvWzqhs/El9QLGfcKEqRfX3qbSny+BaEjNoJdGm3O6rFscApUIUTrpQzg W6G5pQPE6ih1PCBMbbVG/K/gvZT67NSCah02mii74/K2cP4Pn1Vq9zpm3lXgq+gyCSAG XPT+z45wV1qjxAu0suGPhimK1LBdPDCB3DRcHFC3M4loetB6+/5KfsDfdG8FSGQ7uZoT 8cEfIPWkkk+BUwrX29FLYmXHB6X8bSyzUky0xN5IBYJTLxpum/KtzPWWzNTFJCYyO6PF HgSfdW8teWeWgdW77qbHMfiuaUTc9vUyG/kXH3eKcwC0FMt+KjUJ3EzdUfqYKwaRF8Gs 3Ahw== X-Gm-Message-State: AOJu0YygHjLqaUkQdraYAfzk38lBy+7c1hE0yaC5XANj1aZlbcEJKohG 3rdjr2+ZCagm4bTxfzDClSljNQ3KCgQtJzOsaqj3mGIhsikuCBauWSv//0im X-Google-Smtp-Source: AGHT+IEShpw6JudIZoJMi92UdXTK/nz8GoPmUq8wT+imB1lMTJxLIqgl6uF2XZHxabDNwONIF0UnIA== X-Received: by 2002:ad4:5746:0:b0:686:a472:1205 with SMTP id q6-20020ad45746000000b00686a4721205mr6139692qvx.0.1706812238079; Thu, 01 Feb 2024 10:30:38 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCVCqkg7ZSjgpD/6/3COlNsVpzNskT++aPAlEYlQcK/J6/X50n8ZfzMbMgXQu2IqIT3VJLJ2pWTsNJ/JK/rhpjASjcHk5PBWTPpYhRO3amEmvhZkTGv+ From: Jason Andryuk To: xen-devel@lists.xenproject.org Cc: Jason Andryuk , Wei Liu , Anthony PERARD Subject: [PATCH 1/4] block-common: Fix same_vm for no targets Date: Thu, 1 Feb 2024 13:30:21 -0500 Message-ID: <20240201183024.145424-2-jandryuk@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240201183024.145424-1-jandryuk@gmail.com> References: <20240201183024.145424-1-jandryuk@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1706812254176100001 Content-Type: text/plain; charset="utf-8" same_vm is broken when the two main domains do not have targets. otvm and targetvm are both missing, which means they get set to -1 and then converted to empty strings: ++10697+ local targetvm=3D-1 ++10697+ local otvm=3D-1 ++10697+ otvm=3D ++10697+ othervm=3D/vm/cc97bc2f-3a91-43f7-8fbc-4cb92f90b4e4 ++10697+ targetvm=3D ++10697+ local frontend_uuid=3D/vm/844dea4e-44f8-4e3e-8145-325132a31ca5 The final comparison returns true since the two empty strings match: ++10697+ '[' /vm/844dea4e-44f8-4e3e-8145-325132a31ca5 =3D /vm/cc97bc2f-3a91= -43f7-8fbc-4cb92f90b4e4 -o '' =3D /vm/cc97bc2f-3a91-43f7-8fbc-4cb92f90b4e4 = -o /vm/844dea4e-44f8-4e3e-8145-325132a31ca5 =3D '' -o '' =3D '' ']' Replace -1 with distinct strings indicating the lack of a value and remove the collescing to empty stings. The strings themselves will no longer match, and that is correct. ++12364+ '[' /vm/844dea4e-44f8-4e3e-8145-325132a31ca5 =3D /vm/cc97bc2f-3a91= -43f7-8fbc-4cb92f90b4e4 -o 'No target' =3D /vm/cc97bc2f-3a91-43f7-8fbc-4cb9= 2f90b4e4 -o /vm/844dea4e-44f8-4e3e-8145-325132a31ca5 =3D 'No other target' = -o 'No target' =3D 'No other target' ']' Signed-off-by: Jason Andryuk Reviewed-by: Anthony PERARD --- tools/hotplug/Linux/block-common.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tools/hotplug/Linux/block-common.sh b/tools/hotplug/Linux/bloc= k-common.sh index f86a88c4eb..5c80237d99 100644 --- a/tools/hotplug/Linux/block-common.sh +++ b/tools/hotplug/Linux/block-common.sh @@ -112,14 +112,12 @@ same_vm() "$FRONTEND_UUID") local target=3D$(xenstore_read_default "/local/domain/$FRONTEND_ID/targ= et" \ "-1") - local targetvm=3D$(xenstore_read_default "/local/domain/$target/vm" "-1") + local targetvm=3D$(xenstore_read_default "/local/domain/$target/vm" "No = Target") local otarget=3D$(xenstore_read_default "/local/domain/$otherdom/target= " \ "-1") local otvm=3D$(xenstore_read_default "/local/domain/$otarget/vm" \ - "-1") - otvm=3D${otvm%-1} - othervm=3D${othervm%-1} - targetvm=3D${targetvm%-1} + "No Other Target") + local frontend_uuid=3D${FRONTEND_UUID%-1} =20 [ "$frontend_uuid" =3D "$othervm" -o "$targetvm" =3D "$othervm" -o \ --=20 2.43.0 From nobody Sat May 18 05:04:53 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1706812262; cv=none; d=zohomail.com; s=zohoarc; b=D0pn/rb0ZBSKLR7n4bhuXFe8RMtD/y08o/u13F6ZTiTKhBicEsjima15bDw8V/qgfEMiGrqk0u2FKUj1eygVUCRGdpfY7bH8sC21skmBMOIv+EiE395g2bgH90j2T88CRBg7kpxzpyclP3QAOFM8lJeLD5Xv5ZzkH6xAHIQ5tAA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706812262; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=PjjeoKX1m7W13o8Y7ZaEmX1lMzcVrUhBaLtbtuWZOxs=; b=jcc3Dnu6MXvixxTXTnErxJmjcsuvPSjPnM2sr6mUjJYdjzdCq52mmheogMe5Ep1d/B0P7xsGXtbciJbFS6rmD/Qn6AVPjxGpHrHQilw/FSmf2BIqyiEzWcxE1DxwOFNikAHLJ2SPsyLf8cfRV827czJwkaFRdz7LP2ILcLsLrdU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1706812262152221.2282178086217; Thu, 1 Feb 2024 10:31:02 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.674670.1049750 (Exim 4.92) (envelope-from ) id 1rVbpm-0002Xv-Du; Thu, 01 Feb 2024 18:30:46 +0000 Received: by outflank-mailman (output) from mailman id 674670.1049750; Thu, 01 Feb 2024 18:30:46 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rVbpm-0002Xm-Al; Thu, 01 Feb 2024 18:30:46 +0000 Received: by outflank-mailman (input) for mailman id 674670; Thu, 01 Feb 2024 18:30:45 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rVbpl-0002Wb-2Q for xen-devel@lists.xenproject.org; Thu, 01 Feb 2024 18:30:45 +0000 Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [2607:f8b0:4864:20::730]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 017bb2e7-c130-11ee-98f5-efadbce2ee36; Thu, 01 Feb 2024 19:30:42 +0100 (CET) Received: by mail-qk1-x730.google.com with SMTP id af79cd13be357-783d8e09a1cso73034085a.3 for ; Thu, 01 Feb 2024 10:30:42 -0800 (PST) Received: from pm2-ws13.praxislan02.com (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com. [207.172.141.204]) by smtp.gmail.com with ESMTPSA id pf8-20020a056214498800b0068c75141e73sm25824qvb.2.2024.02.01.10.30.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 10:30:40 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 017bb2e7-c130-11ee-98f5-efadbce2ee36 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706812241; x=1707417041; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=PjjeoKX1m7W13o8Y7ZaEmX1lMzcVrUhBaLtbtuWZOxs=; b=WIQ8by9wMw2KvMGH49gSyXd36QEqZQA622acQ002jIMFMIxVWuGZul50oDt7i5ScWX VGBX8r3MhGIaeVc6xObwGA/QW+RORrZD9kH2tI7O+ujnhC9wZzu1BqQMBaPV0VHWEVlb hF5iTcRLKum26F2Qj6HhKkqsJf0v79pPU+9V48t/KcBMy2SlGUYKCKKoPOWJbXxRmZMZ v77EMJtgugJ0+G9Qd4aH8H5403vFnAXf/mNE5ahd8gINEbJ42b21gq4WEkpI7nkIi3aj SS0y37/8HIay1vvm2sEaAWPJ4c6tzXWR+4gnta7HyJE1tLGxJjRkNJcYvACCPh8LA/74 EF+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706812241; x=1707417041; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PjjeoKX1m7W13o8Y7ZaEmX1lMzcVrUhBaLtbtuWZOxs=; b=LgMm/hph4edgBqGNgiJnXrh9mdiOpUFAJcWLUbieDmZbCsoDUKBQa/+Iu/yojkN9nw M2BLVh7RXypRDDoWUnTQ2dlJZFmm+gMDf20iwvfgI2BylIc/qdsAKIuYsecLMNCjjhxO ip+H95wwFFhgRgnEgBvP27LHzwvxAb796hfiHBWHgv06QSR+/J8HBRjOXMpOzsW7LTKr cafheP6xhrP5CHgJX4ek3Ysoo0/J77Mzw0Vcq6950MF83GOpl1EvbxOoYs2H/lQW5U2o FNR1qW24WI9ESyFaLfrLY4qubAc7ImTkCNXz4IDwEfWnPq6jf4ceJD0LNOCM8bmfOlwE PG8g== X-Gm-Message-State: AOJu0YxuhG1zHXVPq4o3Dcyk3AGkGDmg3WxkRUwoGOSz04gPJvUy/FhZ N94oPdX7qO9Nceh/KFNazy3QbvGzhXQ4h/lZttweBuJ1U5nTVb61jVQyqDGC X-Google-Smtp-Source: AGHT+IFHvs1BSlxFAbLomRF+WK4BCyWVl6PudvCCCdULyTh8v4FtjY//z2fGun7qgHHPllbSX1rsxg== X-Received: by 2002:ad4:4ea4:0:b0:68c:61bd:7765 with SMTP id ed4-20020ad44ea4000000b0068c61bd7765mr6903583qvb.45.1706812240849; Thu, 01 Feb 2024 10:30:40 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCUYh1WG/ROL1iDB4lPXW50gxnr9Y/V7AJ3B0CY7+Ub0PhR7RfgTo5nnJIcli8/j7t8CiihQDJFiPSft5ZniYYiK7NPm1J2tGxvtsXgRUsFt6+hfcP8Zy4Ivq4HcVhDdMpnJHprtF7g= From: Jason Andryuk To: xen-devel@lists.xenproject.org Cc: Jason Andryuk , Wei Liu , Anthony PERARD , Juergen Gross Subject: [PATCH 2/4] libxl: Add support for blktap vbd3 Date: Thu, 1 Feb 2024 13:30:22 -0500 Message-ID: <20240201183024.145424-3-jandryuk@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240201183024.145424-1-jandryuk@gmail.com> References: <20240201183024.145424-1-jandryuk@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1706812264028100001 Content-Type: text/plain; charset="utf-8" This patch re-introduces blktap support to libxl. Unlike earlier versions, it does not link against any blktap library. libxl changes are needed to write to the vbd3 backend XenStore nodes. blktap has three components. tapdisk is a daemon implementing the disk IO, NBD (Network Block Device), and Xen PV interfaces. tap-ctl is a tool to control tapdisks - creating, starting, stopping and freeing. tapback manages the XenStore operations and instructs tapdisk to connect. It is notable that tapdisk performs the grant and event channel ops, but doesn't interact with XenStore. tapback performs XenStore operations and notifies tapdisks of values and changes. The flow is: libxl writes to the "vbd3" XenStore nodes and runs the block-tap script. The block-tap script runs tap-ctl to create a tapdisk instance as the physical device. tapback then sees the tapdisk and instructs the tapdisk to connect up the PV blkif interface. This is expected to work without the kernel blktap driver, so the block-tap script is modified accordingly to write the UNIX NBD path. backendtype=3Dtap was not fully removed previously, but it would never succeed since it would hit the hardcoded error in disk_try_backend(). It is reused now. An example command to attach a vhd: xl block-attach vm 'vdev=3Dxvdf,backendtype=3Dtap,format=3Dvhd,target=3D/sr= v/target.vhd' Format raw also works to run an "aio:" tapdisk. Signed-off-by: Jason Andryuk Reviewed-by: Anthony PERARD --- VHD support is important for OpenXT since there are lots of existing VHDs which still need supporting. tapdisk also supports encrypting VHDs which is not available in QEMU. --- docs/man/xl-disk-configuration.5.pod.in | 4 +++- tools/libs/light/libxl_device.c | 14 ++++++++++---- tools/libs/light/libxl_disk.c | 20 +++++++++++++++----- tools/libs/light/libxl_linux.c | 1 + tools/libs/light/libxl_types_internal.idl | 1 + tools/libs/light/libxl_utils.c | 2 ++ 6 files changed, 32 insertions(+), 10 deletions(-) diff --git a/docs/man/xl-disk-configuration.5.pod.in b/docs/man/xl-disk-con= figuration.5.pod.in index bc945cc517..cb442bd5b4 100644 --- a/docs/man/xl-disk-configuration.5.pod.in +++ b/docs/man/xl-disk-configuration.5.pod.in @@ -232,7 +232,7 @@ Specifies the backend implementation to use =20 =3Ditem Supported values =20 -phy, qdisk, standalone +phy, qdisk, standalone, tap =20 =3Ditem Mandatory =20 @@ -254,6 +254,8 @@ and "standalone" does not support specifications other = than "virtio". Normally this option should not be specified, in which case libxl will automatically determine the most suitable backend. =20 +"tap" needs blktap's tapback to be running. + =20 =3Ditem B