From nobody Thu May 16 09:10:26 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622036173; cv=none; d=zohomail.com; s=zohoarc; b=LryxKaUHI1jbFfFNUdLaHsdEQ0uGJD79+AuxYZ3RM37abTt/qQo43oVr9R2t4EC3jknu3n49CMpAqCpcVNg5GeENiNjVXbvWrRHPPWsKpSG6r2Nt5YTsOhUK2VO/u+IHut+bzN35ERoNPDrjAZTz2dfdT7FMgoDSqN5dybXbHmQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622036173; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=B6Y+VGG7/05+l9AI4q8InnaO89s1e+zcuH/5F/HnBt4=; b=k33HxJTZy5/16yw0F0S4X/23fdxM3rZoPyMFyrvcnUhDGRJJR7lWirgGF5Vz5tlHxZzBZiv91997zj9fxM426go2eqHaYGHE9ctC8kx8g0o0lavwBt8WrSc/n3Ww5WMSHIBt2SQrInvoqPP4XKksSG6c+ujfyzeYwbRnf57oJPE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1622036173600799.1690165948725; Wed, 26 May 2021 06:36:13 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-530-0BcEWvcEP7qRw29kaU0uCg-1; Wed, 26 May 2021 09:35:53 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 360BD107ACC7; Wed, 26 May 2021 13:35:45 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EBF3819D9D; Wed, 26 May 2021 13:35:44 +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 9CC7589D0; Wed, 26 May 2021 13:35:43 +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 14QDZWEt024969 for ; Wed, 26 May 2021 09:35:32 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0C6165D9CC; Wed, 26 May 2021 13:35:32 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-12-100.pek2.redhat.com [10.72.12.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id C8FB65D9D3; Wed, 26 May 2021 13:35:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622036172; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=B6Y+VGG7/05+l9AI4q8InnaO89s1e+zcuH/5F/HnBt4=; b=AVlLJXJIeNuvfjRldmRmzLdGa3GZ1CCPfTQMOGge1TI9fRHyNP1FRtG8PrJSUnfzG5Fi5d Z5/v8b/NJp1oYNK28uwM06h319GHBmD3FVd+sd+pi5QkO6UgRnsGjwmx+1gll7p3JD5G99 L81ZkfHRu37OkDdFKaGGnqfzS0/K404= X-MC-Unique: 0BcEWvcEP7qRw29kaU0uCg-1 From: Han Han To: libvir-list@redhat.com Subject: [PATCH v8 1/3] qemu_capabilities: Add QEMU_CAPS_RBD_NAMESPACE Date: Wed, 26 May 2021 21:35:10 +0800 Message-Id: <20210526133512.467843-2-hhan@redhat.com> In-Reply-To: <20210526133512.467843-1-hhan@redhat.com> References: <20210526133512.467843-1-hhan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Han Han 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The capability flag will be used for rbd namespace option. The rbd namespace is introduced since ceph Nautilus and qemu v5.0.0. Signed-off-by: Han Han --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_5.0.0.aarch64.xml | 1 + tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml | 1 + tests/qemucapabilitiesdata/caps_5.0.0.riscv64.xml | 1 + tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_5.1.0.sparc.xml | 1 + tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_5.2.0.aarch64.xml | 1 + tests/qemucapabilitiesdata/caps_5.2.0.ppc64.xml | 1 + tests/qemucapabilitiesdata/caps_5.2.0.riscv64.xml | 1 + tests/qemucapabilitiesdata/caps_5.2.0.s390x.xml | 1 + tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_6.0.0.s390x.xml | 1 + tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml | 1 + 16 files changed, 17 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 75dd01f06e..ea6c3648ea 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -630,6 +630,7 @@ VIR_ENUM_IMPL(virQEMUCaps, "compat-deprecated", "acpi-index", "input-linux", + "rbd.namespace", ); =20 =20 @@ -1571,6 +1572,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsQMPSc= hemaQueries[] =3D { QEMU_CAPS_MIGRATION_PARAM_BLOCK_BITMAP_MAPPING }, { "blockdev-backup", QEMU_CAPS_BLOCKDEV_BACKUP }, { "object-add/arg-type/qom-type/^secret", QEMU_CAPS_OBJECT_QAPIFIED }, + { "blockdev-add/arg-type/+rbd/namespace", QEMU_CAPS_RBD_NAMESPACE }, }; =20 typedef struct _virQEMUCapsObjectTypeProps virQEMUCapsObjectTypeProps; diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 94f2fad05a..0d0dc52c1c 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -610,6 +610,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for = syntax-check */ QEMU_CAPS_COMPAT_DEPRECATED, /* -compat deprecated-(input|output) is s= upported */ QEMU_CAPS_ACPI_INDEX, /* PCI device 'acpi-index' property */ QEMU_CAPS_INPUT_LINUX, /* -object input-linux */ + QEMU_CAPS_RBD_NAMESPACE, /* -blockdev '{"driver":"rbd",...,"namespace"= :str}' */ =20 QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_5.0.0.aarch64.xml b/tests/qemu= capabilitiesdata/caps_5.0.0.aarch64.xml index 331309bbe3..7a2214c3b9 100644 --- a/tests/qemucapabilitiesdata/caps_5.0.0.aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_5.0.0.aarch64.xml @@ -202,6 +202,7 @@ + 5000000 0 61700241 diff --git a/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml b/tests/qemuca= pabilitiesdata/caps_5.0.0.ppc64.xml index 444b7a222f..1b5c1f9025 100644 --- a/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml @@ -210,6 +210,7 @@ + 5000000 0 42900241 diff --git a/tests/qemucapabilitiesdata/caps_5.0.0.riscv64.xml b/tests/qemu= capabilitiesdata/caps_5.0.0.riscv64.xml index 84a57d1e0d..8e239d4ec7 100644 --- a/tests/qemucapabilitiesdata/caps_5.0.0.riscv64.xml +++ b/tests/qemucapabilitiesdata/caps_5.0.0.riscv64.xml @@ -196,6 +196,7 @@ + 5000000 0 0 diff --git a/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_5.0.0.x86_64.xml index a3d9338e86..5a1b333b6b 100644 --- a/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml @@ -247,6 +247,7 @@ + 5000000 0 43100241 diff --git a/tests/qemucapabilitiesdata/caps_5.1.0.sparc.xml b/tests/qemuca= pabilitiesdata/caps_5.1.0.sparc.xml index 3075172082..0fd9f1bd39 100644 --- a/tests/qemucapabilitiesdata/caps_5.1.0.sparc.xml +++ b/tests/qemucapabilitiesdata/caps_5.1.0.sparc.xml @@ -111,6 +111,7 @@ + 5001000 0 0 diff --git a/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_5.1.0.x86_64.xml index 0dae0ad892..d232da4d6c 100644 --- a/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml @@ -249,6 +249,7 @@ + 5001000 0 43100242 diff --git a/tests/qemucapabilitiesdata/caps_5.2.0.aarch64.xml b/tests/qemu= capabilitiesdata/caps_5.2.0.aarch64.xml index 7615bd9cb6..b08a64f0ff 100644 --- a/tests/qemucapabilitiesdata/caps_5.2.0.aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_5.2.0.aarch64.xml @@ -206,6 +206,7 @@ + 5002000 0 61700243 diff --git a/tests/qemucapabilitiesdata/caps_5.2.0.ppc64.xml b/tests/qemuca= pabilitiesdata/caps_5.2.0.ppc64.xml index ac5667c1a9..2c56c37f29 100644 --- a/tests/qemucapabilitiesdata/caps_5.2.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_5.2.0.ppc64.xml @@ -212,6 +212,7 @@ + 5002000 0 42900243 diff --git a/tests/qemucapabilitiesdata/caps_5.2.0.riscv64.xml b/tests/qemu= capabilitiesdata/caps_5.2.0.riscv64.xml index 192f9bc7d4..20051da150 100644 --- a/tests/qemucapabilitiesdata/caps_5.2.0.riscv64.xml +++ b/tests/qemucapabilitiesdata/caps_5.2.0.riscv64.xml @@ -198,6 +198,7 @@ + 5002000 0 0 diff --git a/tests/qemucapabilitiesdata/caps_5.2.0.s390x.xml b/tests/qemuca= pabilitiesdata/caps_5.2.0.s390x.xml index db72107a0d..5c68251c1b 100644 --- a/tests/qemucapabilitiesdata/caps_5.2.0.s390x.xml +++ b/tests/qemucapabilitiesdata/caps_5.2.0.s390x.xml @@ -160,6 +160,7 @@ + 5002000 0 39100243 diff --git a/tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_5.2.0.x86_64.xml index 7cfbebe323..ccbc6007d0 100644 --- a/tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_5.2.0.x86_64.xml @@ -250,6 +250,7 @@ + 5002000 0 43100243 diff --git a/tests/qemucapabilitiesdata/caps_6.0.0.s390x.xml b/tests/qemuca= pabilitiesdata/caps_6.0.0.s390x.xml index 3c07e7159b..e4ea351af6 100644 --- a/tests/qemucapabilitiesdata/caps_6.0.0.s390x.xml +++ b/tests/qemucapabilitiesdata/caps_6.0.0.s390x.xml @@ -165,6 +165,7 @@ + 6000000 0 39100242 diff --git a/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_6.0.0.x86_64.xml index 80ec2e77c1..a38d1f0b5e 100644 --- a/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_6.0.0.x86_64.xml @@ -255,6 +255,7 @@ + 6000000 0 43100242 diff --git a/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_6.1.0.x86_64.xml index 4df3200219..5a38ba4fcd 100644 --- a/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_6.1.0.x86_64.xml @@ -254,6 +254,7 @@ + 6000050 0 43100243 --=20 2.31.1 From nobody Thu May 16 09:10:26 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622036157; cv=none; d=zohomail.com; s=zohoarc; b=HybDc7YtMxHghw5Fo+lIoIr8Kx2gzgY0S+piW3yWnQTDls3DV40AH005rrkFZmshnT/+kovwskvW+FNnxX2Vdcg/55HZmIwCsBSAB4ipVbcp/Wa60inIf1/rmS1yaXStX/SIaawzDFlsJY2PcX641r/BbknyuenDtxPf1GpSbLM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622036157; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=OMUBYNmu70ppyE4/B+6vnhQbr91RJP2DOPxvIDR+3bA=; b=WR3NncvTVeQji/N0Wdtmtpsd4xtgsDVAfLdX1kLgqxaq7eF9Ct7Ao+X64PyU0K6zzN51/Z/DPBqfdzEsqB2M1lmGIf3nBITK9ex04CsjWh3eJEy07ds0Q6YZ4Pdu8g/a/uSGqmxfLt//DWSQ9AElb1mnOpFo56Hq8cSgZXGeLR0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 162203615708878.26500498364032; Wed, 26 May 2021 06:35:57 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-283-PY8D2CQgMhW0Z-zn1h_AcA-1; Wed, 26 May 2021 09:35:51 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2635E107ACCA; Wed, 26 May 2021 13:35:40 +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 EF7F550DD2; Wed, 26 May 2021 13:35:37 +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 DD20F180B465; Wed, 26 May 2021 13:35:34 +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 14QDZXhv024980 for ; Wed, 26 May 2021 09:35:33 -0400 Received: by smtp.corp.redhat.com (Postfix) id B11F15D9DE; Wed, 26 May 2021 13:35:33 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-12-100.pek2.redhat.com [10.72.12.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 94A5F5D9CC; Wed, 26 May 2021 13:35:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622036153; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=OMUBYNmu70ppyE4/B+6vnhQbr91RJP2DOPxvIDR+3bA=; b=TlquzVBiXBXaH6QsKGRJCGKjB+/B60qqjHoH4Yw/M4w8b8vyZ+jVRAwBfFbmMxVhmSjj3Q qMxCGZ2OSlmRAJRpGD/wyRUJy8I3CXQGV7HS93NGMSxRKF6pCxZFXOzFLsu+9YnTG1KpGX H/FK56VDOC1/2qYaUbv9nTzaMPdUTRk= X-MC-Unique: PY8D2CQgMhW0Z-zn1h_AcA-1 From: Han Han To: libvir-list@redhat.com Subject: [PATCH v8 2/3] conf: Support to parse rbd namespace from source name Date: Wed, 26 May 2021 21:35:11 +0800 Message-Id: <20210526133512.467843-3-hhan@redhat.com> In-Reply-To: <20210526133512.467843-1-hhan@redhat.com> References: <20210526133512.467843-1-hhan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Han Han 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Han Han --- docs/formatdomain.rst | 16 ++++++++++++ src/conf/domain_conf.c | 47 +++++++++++++++++++++++++++++++--- src/conf/storage_source_conf.c | 2 ++ src/conf/storage_source_conf.h | 1 + 4 files changed, 62 insertions(+), 4 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index aa7bb8da14..cb3914d1bb 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -2479,6 +2479,16 @@ paravirtualized driver is specified via the ``disk``= element. + + + + + + + + + + ... =20 @@ -2570,6 +2580,12 @@ paravirtualized driver is specified via the ``disk``= element. the host by the ``nbd_tls`` and ``nbd_tls_x509_cert_dir`` in /etc/libvirt/qemu.conf. ('tls' :since:`Since 4.5.0` ) =20 + For "rbd", the ``name`` attribute could be two formats: the format of + ``pool_name/image_name`` includes the rbd pool name and image name w= ith + default rbd pool namespace; for the customized namespace, the format= is + ``pool_name/namespace/image_name`` ( :since:`Since 6.9.0 and QEMU 5.= 0` ). + The pool name, namespace and image are separated by slash. + For protocols ``http`` and ``https`` an optional attribute ``query`` specifies the query string. ( :since:`Since 6.2.0` ) =20 diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 6d90041bf8..eac59dd00e 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -8197,6 +8197,7 @@ virDomainDiskSourceNetworkParse(xmlNodePtr node, { virStorageNetProtocol protocol; xmlNodePtr tmpnode; + char **tmp_split_paths; =20 if (virXMLPropEnum(node, "protocol", virStorageNetProtocolTypeFromStri= ng, VIR_XML_PROP_REQUIRED, &protocol) < 0) @@ -8226,8 +8227,7 @@ virDomainDiskSourceNetworkParse(xmlNodePtr node, /* for historical reasons we store the volume and image name in one XML * element although it complicates thing when attempting to access the= m. */ if (src->path && - (src->protocol =3D=3D VIR_STORAGE_NET_PROTOCOL_GLUSTER || - src->protocol =3D=3D VIR_STORAGE_NET_PROTOCOL_RBD)) { + src->protocol =3D=3D VIR_STORAGE_NET_PROTOCOL_GLUSTER) { char *tmp; if (!(tmp =3D strchr(src->path, '/')) || tmp =3D=3D src->path) { @@ -8244,6 +8244,41 @@ virDomainDiskSourceNetworkParse(xmlNodePtr node, tmp[0] =3D '\0'; } =20 + /* the name of rbd could be / or // */ + if (src->path && + src->protocol =3D=3D VIR_STORAGE_NET_PROTOCOL_RBD && + (tmp_split_paths =3D g_strsplit(src->path, "/", 3))) { + if (virStringIsEmpty(tmp_split_paths[0]) || + !tmp_split_paths[1] || + STREQ_NULLABLE(tmp_split_paths[2], "") || + (virStringIsEmpty(tmp_split_paths[1]) && + !tmp_split_paths[2])) { + virStringListFreeCount(tmp_split_paths, 3); + virReportError(VIR_ERR_XML_ERROR, + _("can't split path '%s' into pool name, pool " + "namespace, image name OR pool name, image na= me"), + src->path); + return -1; + } + + VIR_FREE(src->path); + src->volume =3D g_strdup(tmp_split_paths[0]); + /* the format of / */ + if (!tmp_split_paths[2]) + src->path =3D g_strdup(tmp_split_paths[1]); + + if (tmp_split_paths[2]) { + /* the format of // */ + if (STRNEQ_NULLABLE(tmp_split_paths[1], "")) + src->ns =3D g_strdup(tmp_split_paths[1]); + + /* the format of // */ + src->path =3D g_strdup(tmp_split_paths[2]); + } + + virStringListFreeCount(tmp_split_paths, 3); + } + /* snapshot currently works only for remote disks */ src->snapshot =3D virXPathString("string(./snapshot/@name)", ctxt); =20 @@ -22948,8 +22983,12 @@ virDomainDiskSourceFormatNetwork(virBuffer *attrBu= f, virBufferAsprintf(attrBuf, " protocol=3D'%s'", virStorageNetProtocolTypeToString(src->protocol)); =20 - if (src->volume) - path =3D g_strdup_printf("%s/%s", src->volume, src->path); + if (src->volume) { + if (src->ns) + path =3D g_strdup_printf("%s/%s/%s", src->volume, src->ns, src= ->path); + else + path =3D g_strdup_printf("%s/%s", src->volume, src->path); + } =20 virBufferEscapeString(attrBuf, " name=3D'%s'", path ? path : src->path= ); virBufferEscapeString(attrBuf, " query=3D'%s'", src->query); diff --git a/src/conf/storage_source_conf.c b/src/conf/storage_source_conf.c index 5ca06fa30a..7b765d0d81 100644 --- a/src/conf/storage_source_conf.c +++ b/src/conf/storage_source_conf.c @@ -829,6 +829,7 @@ virStorageSourceCopy(const virStorageSource *src, =20 def->path =3D g_strdup(src->path); def->volume =3D g_strdup(src->volume); + def->ns =3D g_strdup(src->ns); def->relPath =3D g_strdup(src->relPath); def->backingStoreRaw =3D g_strdup(src->backingStoreRaw); def->backingStoreRawFormat =3D src->backingStoreRawFormat; @@ -1115,6 +1116,7 @@ virStorageSourceClear(virStorageSource *def) =20 VIR_FREE(def->path); VIR_FREE(def->volume); + VIR_FREE(def->ns); VIR_FREE(def->snapshot); VIR_FREE(def->configFile); VIR_FREE(def->query); diff --git a/src/conf/storage_source_conf.h b/src/conf/storage_source_conf.h index 389c7b56d1..dcc643ceba 100644 --- a/src/conf/storage_source_conf.h +++ b/src/conf/storage_source_conf.h @@ -275,6 +275,7 @@ struct _virStorageSource { char *snapshot; /* for storage systems supporting internal snapshots */ char *configFile; /* some storage systems use config file as part of the source definition */ + char *ns; /* for the storage systems supporting namespace */ char *query; /* query string for HTTP based protocols */ size_t nhosts; virStorageNetHostDef *hosts; --=20 2.31.1 From nobody Thu May 16 09:10:26 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622036168; cv=none; d=zohomail.com; s=zohoarc; b=hG1XDDHjEXgCOESevJlza8MyU7vaTliy1hwe5njjAhR04ZvVser8iAOThzhjPnu6RIzoAWGeSDyWcpRBQ2GO4t9gesvDIaWs9X0QuvS4cd9Hd2rhfHet/BkVo7lvf/2ON9yPsd1JAYiSvEyzvPVVCYXrpSMMtByYnlFPyCtTAkA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622036168; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=aeId8setq3FOAF15CBL0PAwr3AmLi1pNpVpXMGqfg58=; b=b2HZ1lY/sHlkNEOVHHMNMu7WZqxuW2FJAdzJ29d/W1q/GII0IU58SWFg0xYnkZwph2y33zdEMs8QsmR1fTvtFSntsmmMfJA6P1FnlXgYT7gAAXdlsyBhqqJeuuEHPQM0Uug1Ydkysnatau3//2LV+Nhf3MkSEp61Hd8XHqJxY0k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 162203616867721.69047673660259; Wed, 26 May 2021 06:36:08 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-27-DvhTTeLdPCiDWAmvKaDFhA-1; Wed, 26 May 2021 09:36:04 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 035BA10CE780; Wed, 26 May 2021 13:35:53 +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 8A19B19D9D; Wed, 26 May 2021 13:35:51 +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 38E0B180102B; Wed, 26 May 2021 13:35:50 +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 14QDZZa2024989 for ; Wed, 26 May 2021 09:35:35 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9DCDD5D9E2; Wed, 26 May 2021 13:35:35 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-12-100.pek2.redhat.com [10.72.12.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5CF695D9CC; Wed, 26 May 2021 13:35:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622036167; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=aeId8setq3FOAF15CBL0PAwr3AmLi1pNpVpXMGqfg58=; b=Lk4SA9sBW4DYvfmmfUJMStcJdJEeMBjAvDfmJx+6EZKsuoL38BhMRdlol3FpZAKy9m7LPy L+f3SrU43vv8actj7PNVSBbJwKSuAMweuyYienjcq40lHUnQJ9LU2BxmGEm3IRW7hCwghV M2bWqUrzyC02/fqKi6N7zU9iX5U+Jrk= X-MC-Unique: DvhTTeLdPCiDWAmvKaDFhA-1 From: Han Han To: libvir-list@redhat.com Subject: [PATCH v8 3/3] qemu: Implement rbd namespace to the source name attribute Date: Wed, 26 May 2021 21:35:12 +0800 Message-Id: <20210526133512.467843-4-hhan@redhat.com> In-Reply-To: <20210526133512.467843-1-hhan@redhat.com> References: <20210526133512.467843-1-hhan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Han Han 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Since Nautilus ceph supports separate image namespaces within a pool for tenant isolation and QEMU adds it as a rbd blockdev options from 5.0.0. The source name with format "//" could be used to access a rbd image with namespace. Add unit tests for this attribute. https://bugzilla.redhat.com/show_bug.cgi?id=3D1816909 Signed-off-by: Han Han --- src/qemu/qemu_block.c | 1 + src/qemu/qemu_domain.c | 8 +++ ...k-network-rbd-namespace.x86_64-latest.args | 38 ++++++++++++++ .../disk-network-rbd-namespace.xml | 40 +++++++++++++++ tests/qemuxml2argvtest.c | 1 + ...sk-network-rbd-namespace.x86_64-latest.xml | 50 +++++++++++++++++++ tests/qemuxml2xmltest.c | 1 + 7 files changed, 139 insertions(+) create mode 100644 tests/qemuxml2argvdata/disk-network-rbd-namespace.x86_6= 4-latest.args create mode 100644 tests/qemuxml2argvdata/disk-network-rbd-namespace.xml create mode 100644 tests/qemuxml2xmloutdata/disk-network-rbd-namespace.x86= _64-latest.xml diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 6627d044cd..59230101fd 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -916,6 +916,7 @@ qemuBlockStorageSourceGetRBDProps(virStorageSource *src, "s:pool", src->volume, "s:image", src->path, "S:snapshot", src->snapshot, + "S:namespace", src->ns, "S:conf", src->configFile, "A:server", &servers, "S:user", username, diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 7f57cae00e..b298f4b841 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4895,6 +4895,14 @@ qemuDomainValidateStorageSource(virStorageSource *sr= c, } } =20 + if (src->protocol =3D=3D VIR_STORAGE_NET_PROTOCOL_RBD && + src->ns && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_RBD_NAMESPACE)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("rbd namespace is not supported by this QEMU")); + return -1; + } + return 0; } =20 diff --git a/tests/qemuxml2argvdata/disk-network-rbd-namespace.x86_64-lates= t.args b/tests/qemuxml2argvdata/disk-network-rbd-namespace.x86_64-latest.ar= gs new file mode 100644 index 0000000000..f89773e3e1 --- /dev/null +++ b/tests/qemuxml2argvdata/disk-network-rbd-namespace.x86_64-latest.args @@ -0,0 +1,38 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-QEMUGuest1 \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tm= p/lib/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine pc,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff,memory-backend=3Dp= c.ram \ +-cpu qemu64 \ +-m 214 \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'= \ +-overcommit mem-lock=3Doff \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server=3Don,wait=3Doff \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot strict=3Don \ +-device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ +-blockdev '{"driver":"rbd","pool":"pool","image":"image","namespace":"ns",= "server":[{"host":"mon1.example.org","port":"6321"},{"host":"mon2.example.o= rg","port":"6322"},{"host":"mon3.example.org","port":"6322"}],"node-name":"= libvirt-2-storage","auto-read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-2-format","read-only":false,"driver":"raw= ","file":"libvirt-2-storage"}' \ +-device virtio-blk-pci,bus=3Dpci.0,addr=3D0x2,drive=3Dlibvirt-2-format,id= =3Dvirtio-disk0,bootindex=3D1 \ +-blockdev '{"driver":"rbd","pool":"pool","image":"image","server":[{"host"= :"mon1.example.org","port":"6321"}],"node-name":"libvirt-1-storage","auto-r= ead-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw= ","file":"libvirt-1-storage"}' \ +-device virtio-blk-pci,bus=3Dpci.0,addr=3D0x3,drive=3Dlibvirt-1-format,id= =3Dvirtio-disk1 \ +-audiodev id=3Daudio1,driver=3Dnone \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/disk-network-rbd-namespace.xml b/tests/= qemuxml2argvdata/disk-network-rbd-namespace.xml new file mode 100644 index 0000000000..5389cbda2f --- /dev/null +++ b/tests/qemuxml2argvdata/disk-network-rbd-namespace.xml @@ -0,0 +1,40 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index f9ec81eb8e..ab805a2bd1 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1392,6 +1392,7 @@ mymain(void) DO_TEST_CAPS_LATEST("disk-network-gluster"); DO_TEST_CAPS_VER("disk-network-rbd", "2.12.0"); DO_TEST_CAPS_LATEST("disk-network-rbd"); + DO_TEST_CAPS_LATEST("disk-network-rbd-namespace"); DO_TEST_FAILURE("disk-network-rbd-no-colon", NONE); DO_TEST("disk-network-sheepdog", NONE); DO_TEST_CAPS_VER("disk-network-sheepdog", "2.12.0"); diff --git a/tests/qemuxml2xmloutdata/disk-network-rbd-namespace.x86_64-lat= est.xml b/tests/qemuxml2xmloutdata/disk-network-rbd-namespace.x86_64-latest= .xml new file mode 100644 index 0000000000..710938e9ee --- /dev/null +++ b/tests/qemuxml2xmloutdata/disk-network-rbd-namespace.x86_64-latest.xml @@ -0,0 +1,50 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + qemu64 + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + + + + + + +
+ + + + + + + +
+ + +
+ + +
+ + + + +