From nobody Sat May 4 03:04:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1596793780; cv=none; d=zohomail.com; s=zohoarc; b=g0k0qrzFoU8jpowfoKrTGTSM8I7rKgTS62KV/sgQi03+XR/8XYtlI7+nFXwH4F/Ip1XuiOaHkvrpWo+DeWqhHRz50LOuL9pFmUzgeHFQTfRjaq2WlLIV8nhGb5GbN/mcvAS33lXZo370pN+djupsfvLf2u0twRWA6U4ClyZqkJI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596793780; 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=Z7JGzzHnnWRDeosl1pfXY/0HFdlhQJslDPz94hGfuCA=; b=ndZ35ZJ0U6XeYtV7koiKoRVGX4bWhkSyG1eB1ipiUWCnUcPirT/W725b+Bz0XDcyLxklYjZRYbqN7BCtch2LD0xt70VfZCnvOlSfMWWuh1PPtg+Mr79pFrc+QGA/iVCRque9SX8Wlp5p9grvxMWjq9cK14bnryoBuDF18J3x+DY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1596793780356154.9020394861601; Fri, 7 Aug 2020 02:49:40 -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-153-zziszJKHP7qQ12z65CT5Kw-1; Fri, 07 Aug 2020 05:49:36 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F2D69801A03; Fri, 7 Aug 2020 09:49:30 +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 DA2FA5D9E8; Fri, 7 Aug 2020 09:49:29 +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 10128A35BC; Fri, 7 Aug 2020 09:49:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0779nRqQ007567 for ; Fri, 7 Aug 2020 05:49:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6C3F86111F; Fri, 7 Aug 2020 09:49:27 +0000 (UTC) Received: from hansolo.redhat.com (ovpn-13-81.pek2.redhat.com [10.72.13.81]) by smtp.corp.redhat.com (Postfix) with ESMTP id DD9D660BE2; Fri, 7 Aug 2020 09:49:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596793779; 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=Z7JGzzHnnWRDeosl1pfXY/0HFdlhQJslDPz94hGfuCA=; b=GdaMri+DvkNpYGPrWQ/zS3Znbxu7AnEmoKAch1P7Xz9R3VszYiZ8r7HOndiLVO0V+3hFI6 ZCfgRc/PkSrn6MMsjbe6Vu1r1HFcubtmELHV+b3lHgd5Rslj2fcqGKDLPiTbLQ9YnikrOY joEb7UamQKXwOhTG6bfU/81Z+O0tr4s= X-MC-Unique: zziszJKHP7qQ12z65CT5Kw-1 From: Han Han To: libvir-list@redhat.com Subject: [PATCH v4 1/4] qemu_capabilities: Add QEMU_CAPS_RBD_NAMESPACE Date: Fri, 7 Aug 2020 17:49:12 +0800 Message-Id: <20200807094915.3506690-2-hhan@redhat.com> In-Reply-To: <20200807094915.3506690-1-hhan@redhat.com> References: <20200807094915.3506690-1-hhan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: pkrempa@redhat.com, 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.14 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" Add rbd namespace in aarch64 capability replies. 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 Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Jason Dillaman --- src/qemu/qemu_capabilities.c | 4 ++++ src/qemu/qemu_capabilities.h | 3 +++ 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.x86_64.xml | 1 + 7 files changed, 12 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index ff6ba8c9e9..7656d5f8cb 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -597,6 +597,9 @@ VIR_ENUM_IMPL(virQEMUCaps, "spapr-tpm-proxy", "numa.hmat", "blockdev-hostdev-scsi", + + /* 380 */ + "rbd.namespace", ); =20 =20 @@ -1525,6 +1528,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsQMPSc= hemaQueries[] =3D { { "migrate-set-parameters/arg-type/downtime-limit", QEMU_CAPS_MIGRATIO= N_PARAM_DOWNTIME }, { "migrate-set-parameters/arg-type/xbzrle-cache-size", QEMU_CAPS_MIGRA= TION_PARAM_XBZRLE_CACHE_SIZE }, { "set-numa-node/arg-type/+hmat-lb", QEMU_CAPS_NUMA_HMAT }, + { "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 5d08941538..ef7ea9aa20 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -578,6 +578,9 @@ typedef enum { /* virQEMUCapsFlags grouping marker for = syntax-check */ QEMU_CAPS_NUMA_HMAT, /* -numa hmat */ QEMU_CAPS_BLOCKDEV_HOSTDEV_SCSI, /* -blockdev used for (i)SCSI hostdev= s */ =20 + /* 380 */ + QEMU_CAPS_RBD_NAMESPACE, /* -blockdev '{"driver":"rbd",...,"namespace"= :str}' */ + QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; =20 diff --git a/tests/qemucapabilitiesdata/caps_5.0.0.aarch64.xml b/tests/qemu= capabilitiesdata/caps_5.0.0.aarch64.xml index 928af2a01c..75622ca5fd 100644 --- a/tests/qemucapabilitiesdata/caps_5.0.0.aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_5.0.0.aarch64.xml @@ -199,6 +199,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 e8668a25a9..1780c8a5bc 100644 --- a/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml @@ -208,6 +208,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 85a8a46dac..d885bd9bb3 100644 --- a/tests/qemucapabilitiesdata/caps_5.0.0.riscv64.xml +++ b/tests/qemucapabilitiesdata/caps_5.0.0.riscv64.xml @@ -195,6 +195,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 546b9b0422..e93483f0c6 100644 --- a/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_5.0.0.x86_64.xml @@ -243,6 +243,7 @@ + 5000000 0 43100241 diff --git a/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_5.1.0.x86_64.xml index a9d82661e3..387a11a0c6 100644 --- a/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_5.1.0.x86_64.xml @@ -242,6 +242,7 @@ + 5000092 0 43100242 --=20 2.27.0 From nobody Sat May 4 03:04:55 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=1596793780; cv=none; d=zohomail.com; s=zohoarc; b=j3By+0a1HHgrj8wLJLICwjFOSKO4MAQkWT8n8f3adhESu82omNW62B1u94SkrvY3epfZKRADsz4eXrKuynph/yYspcDIocvmhOLBFSYehTGgN+wydN/pXnVHLv+Fp6cfE1MD/WkQIt18EbFt56viJemy8PvoiZX6frk5yXDslUQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596793780; 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=qOyIJpFDpyJKXfNOToNgM9Mgk+Ubjd3QgTU/yS24k7s=; b=X2HqOQ7uo7icJmT5jzE/Eu1eWerwfLdI8k4lhyWNuuHPmJ5M9rJt1wHXizpLAxULVmKJGbomBg5W3jfR0k3EU+in/3gHzzt7OPiFHh99bbG0bYyUYo/Fw6szgcvYTu1t9yhFgEsJx3+ev0jmWlYv9b/jjMfD5Mk6q4VBNHas5MQ= 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 1596793780632581.4995726441005; Fri, 7 Aug 2020 02:49:40 -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-121-qmzNsrrLPKmeps_HM_LeTw-1; Fri, 07 Aug 2020 05:49:37 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A2EE61005510; Fri, 7 Aug 2020 09:49:32 +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 A152A65C91; Fri, 7 Aug 2020 09:49:31 +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 698D01809561; Fri, 7 Aug 2020 09:49:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0779nU2H007584 for ; Fri, 7 Aug 2020 05:49:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8618961176; Fri, 7 Aug 2020 09:49:30 +0000 (UTC) Received: from hansolo.redhat.com (ovpn-13-81.pek2.redhat.com [10.72.13.81]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0D1F760BE2; Fri, 7 Aug 2020 09:49:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596793779; 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=qOyIJpFDpyJKXfNOToNgM9Mgk+Ubjd3QgTU/yS24k7s=; b=Dt3StQVB0dl6E8iDM4WHMpFj3abzF1NLv6zg6ijzt12azeAJUKo722s7WRoPcVIfXVOPJt bfGPRZRbbaVqA4nn4FBWwImIAWcltL70vaH55AW4F2r86ToTIL7sxocFsNah7oeNQ7V6nx 9h13zTYjWgPalVkDR7hCPtxraeVQvyk= X-MC-Unique: qmzNsrrLPKmeps_HM_LeTw-1 From: Han Han To: libvir-list@redhat.com Subject: [PATCH v4 2/4] conf: Support to parse rbd namespace attribute Date: Fri, 7 Aug 2020 17:49:13 +0800 Message-Id: <20200807094915.3506690-3-hhan@redhat.com> In-Reply-To: <20200807094915.3506690-1-hhan@redhat.com> References: <20200807094915.3506690-1-hhan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: pkrempa@redhat.com, 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.15 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 Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Jason Dillaman --- docs/formatdomain.rst | 5 ++++- docs/schemas/domaincommon.rng | 3 +++ src/conf/domain_conf.c | 4 ++++ src/util/virstoragefile.h | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 218f0c1718..431abc6f56 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -2256,7 +2256,7 @@ paravirtualized driver is specified via the ``disk`` = element. - + @@ -2497,6 +2497,9 @@ paravirtualized driver is specified via the ``disk`` = element. For protocols ``http`` and ``https`` an optional attribute ``query`` specifies the query string. ( :since:`Since 6.2.0` ) =20 + For protocol ``rbd``, an optional attribute ``namespace`` specifies = the + namespace of a rbd pool. ( :since:`Since 6.7.0 and QEMU 5.0.0` ) + For "iscsi" ( :since:`since 1.0.4` ), the ``name`` attribute may inc= lude a logical unit number, separated from the target's name by a slash (e.= g., ``iqn.2013-07.com.example:iscsi-pool/1``). If not specified, the def= ault diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 0d0dcbc5ce..ee09da3c7c 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -1762,6 +1762,9 @@ + + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index ef67efa1da..4b5e752c6f 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -9601,6 +9601,7 @@ virDomainDiskSourceNetworkParse(xmlNodePtr node, =20 /* config file currently only works with remote disks */ src->configFile =3D virXPathString("string(./config/@file)", ctxt); + src->ns =3D virXPathString("string(./@namespace)", ctxt); =20 if (src->protocol =3D=3D VIR_STORAGE_NET_PROTOCOL_HTTP || src->protocol =3D=3D VIR_STORAGE_NET_PROTOCOL_HTTPS) @@ -25083,6 +25084,9 @@ virDomainDiskSourceFormatNetwork(virBufferPtr attrB= uf, path =3D g_strdup_printf("%s/%s", src->volume, src->path); =20 virBufferEscapeString(attrBuf, " name=3D'%s'", path ? path : src->path= ); + if (src->ns) + virBufferEscapeString(attrBuf, " namespace=3D'%s'", src->ns); + virBufferEscapeString(attrBuf, " query=3D'%s'", src->query); =20 if (src->haveTLS !=3D VIR_TRISTATE_BOOL_ABSENT && diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h index f73b3ee005..f027989462 100644 --- a/src/util/virstoragefile.h +++ b/src/util/virstoragefile.h @@ -284,6 +284,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; virStorageNetHostDefPtr hosts; --=20 2.27.0 From nobody Sat May 4 03:04:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1596793794; cv=none; d=zohomail.com; s=zohoarc; b=SIfdnikT0JeoA3K9P3otZlVRNBzbDnsVMs1SKYBzew9spZh8Mw7NPPq2DXVr5FZyyIrDYXyEi2XRq24ZvOY2L3OC29NrhQqvPZpxCQpU4lOsWhs+27/jQY/dEHmOAHw9xhWjYQ+bM+KDn8OKkrspX1Tp4hjb8/mlHXFtUGE6Hvg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596793794; 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=TCOLi2zH3gd/QJQlGqH6jOwHoAsOxZ6A3sGp0h4a4oY=; b=l5sw96PeFm4SEwRFw0lw5xv3+Yz2S+iW5SSHFwgEq0xrQCH9dZgcjhdpm4GhQeGpSTEewA4ofnjrXC6Q678N2XUAiQJRUH62YtJ9XnZ+V+Rp7nsE3W5hoFx8DudxzO4DeForznAmopjJRautyxuVh1sUn2OG5Kf2/SZLXm9rUO0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1596793794214180.09277027328346; Fri, 7 Aug 2020 02:49:54 -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-236-YV541FiGO7-HNkFXgzajYA-1; Fri, 07 Aug 2020 05:49:50 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3BEF48064DE; Fri, 7 Aug 2020 09:49:45 +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 1C29669314; Fri, 7 Aug 2020 09:49:45 +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 DF0A71800BB2; Fri, 7 Aug 2020 09:49:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0779nWqa007599 for ; Fri, 7 Aug 2020 05:49:32 -0400 Received: by smtp.corp.redhat.com (Postfix) id B6BC060CD0; Fri, 7 Aug 2020 09:49:32 +0000 (UTC) Received: from hansolo.redhat.com (ovpn-13-81.pek2.redhat.com [10.72.13.81]) by smtp.corp.redhat.com (Postfix) with ESMTP id 30DC660BE2; Fri, 7 Aug 2020 09:49:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596793793; 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=TCOLi2zH3gd/QJQlGqH6jOwHoAsOxZ6A3sGp0h4a4oY=; b=BtD4HwpNV8Fcgm51QEjOB3/YH5KotrDF7mBTTaI6rbZGjWqN07w1CHYdRZFSEAkHjsetUv Z89z6hGk33Fw2BjNr1iMQ2xVjYGFisRWNw3VQJYkkc2oMe/zsAVm9JnvVWMbMJ+AxQI/yP CT9Tad/TLAK22uP9tpY1vNtllXwaQrU= X-MC-Unique: YV541FiGO7-HNkFXgzajYA-1 From: Han Han To: libvir-list@redhat.com Subject: [PATCH v4 3/4] qemu: Implement rbd namespace attribute Date: Fri, 7 Aug 2020 17:49:14 +0800 Message-Id: <20200807094915.3506690-4-hhan@redhat.com> In-Reply-To: <20200807094915.3506690-1-hhan@redhat.com> References: <20200807094915.3506690-1-hhan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: pkrempa@redhat.com, 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.16 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" Ceph Nautilus supports separate image namespaces within a pool for tenant isolation and QEMU added it as a rbd blockdev options from 5.0.0. This optional attribute is used to access a image with namespace. Add unit tests for this attribute. https://bugzilla.redhat.com/show_bug.cgi?id=3D1816909 Signed-off-by: Han Han Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Jason Dillaman --- src/qemu/qemu_block.c | 1 + src/qemu/qemu_domain.c | 8 ++++ ...k-network-rbd-namespace.x86_64-latest.args | 41 +++++++++++++++++++ .../disk-network-rbd-namespace.xml | 33 +++++++++++++++ tests/qemuxml2argvtest.c | 1 + ...sk-network-rbd-namespace.x86_64-latest.xml | 41 +++++++++++++++++++ tests/qemuxml2xmltest.c | 1 + 7 files changed, 126 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 26c1b42428..d698bdec67 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -872,6 +872,7 @@ qemuBlockStorageSourceGetRBDProps(virStorageSourcePtr s= rc, "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 c440c79e1d..534975df75 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4536,6 +4536,14 @@ qemuDomainValidateStorageSource(virStorageSourcePtr = src, return -1; } =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..a744805d74 --- /dev/null +++ b/tests/qemuxml2argvdata/disk-network-rbd-namespace.x86_64-latest.args @@ -0,0 +1,41 @@ +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 \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-cpu qemu64 \ +-m 214 \ +-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,nowait \ +-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.= org",\ +"port":"6322"},{"host":"mon3.example.org","port":"6322"}],\ +"node-name":"libvirt-1-storage","auto-read-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=3D0x2,drive=3Dlibvirt-1-format,\ +id=3Dvirtio-disk0,bootindex=3D1 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=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..8b526c4a20 --- /dev/null +++ b/tests/qemuxml2argvdata/disk-network-rbd-namespace.xml @@ -0,0 +1,33 @@ + + 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 01839cb88c..c6c18c4335 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1174,6 +1174,7 @@ mymain(void) DO_TEST_CAPS_VER("disk-network-rbd", "2.5.0"); 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..2166696ca8 --- /dev/null +++ b/tests/qemuxml2xmloutdata/disk-network-rbd-namespace.x86_64-latest.xml @@ -0,0 +1,41 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + qemu64 + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + + + + + + +
+ + +
+ + +
+ + + + + + + diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index a07e2b7553..653e5caa86 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -344,6 +344,7 @@ mymain(void) DO_TEST("disk-network-iscsi", QEMU_CAPS_VIRTIO_SCSI); DO_TEST("disk-network-gluster", NONE); DO_TEST("disk-network-rbd", NONE); + DO_TEST_CAPS_LATEST("disk-network-rbd-namespace"); DO_TEST("disk-network-source-auth", NONE); DO_TEST("disk-network-sheepdog", NONE); DO_TEST("disk-network-vxhs", NONE); --=20 2.27.0 From nobody Sat May 4 03:04:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1596793797; cv=none; d=zohomail.com; s=zohoarc; b=ayTEV7So0omQHYET23vDn87UxmpjPuusSfRUYTUrMeFrsLmSTHit6UgduCTr1v1p87EeOlU/0ExoYoh0NP+lvnsyD0XB5JDQXU8cK8CNvjeaRxjb/5zVdwMaGbSxRRrQIyaBM9im2fIXHrxQ0AwiUZkll24hXBU5+ntlwhpeXmM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596793797; 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=6w4tx6GWnOXe7m5uM52lDgJ5bjnUIhaT994YCgPus0c=; b=gFzJnG4XcEBOFFhfkqA8XjxpPlhWmg8ONiV4Oo5eYU4P2QaOPzOTdrx3MmY+M5w7fkq5zBbZ6s4HGBTXobhjVNGuubod5p6sLORwzLGX5fOWuzI64cRrOjK1viLnOZLptCumd6mnx7zpWJe0t/fNiVev8ccj1sQsPcildSB7hCg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1596793797619992.1059899200718; Fri, 7 Aug 2020 02:49: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-254-o06nGP0fNQ2XamMlwqRZJA-1; Fri, 07 Aug 2020 05:49:53 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8E50179ED0; Fri, 7 Aug 2020 09:49:47 +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 70A1D65C91; Fri, 7 Aug 2020 09:49: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 4063D4EDB7; Fri, 7 Aug 2020 09:49:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0779nY15007620 for ; Fri, 7 Aug 2020 05:49:34 -0400 Received: by smtp.corp.redhat.com (Postfix) id DB7DB60CD0; Fri, 7 Aug 2020 09:49:34 +0000 (UTC) Received: from hansolo.redhat.com (ovpn-13-81.pek2.redhat.com [10.72.13.81]) by smtp.corp.redhat.com (Postfix) with ESMTP id 527E160BE2; Fri, 7 Aug 2020 09:49:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596793796; 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=6w4tx6GWnOXe7m5uM52lDgJ5bjnUIhaT994YCgPus0c=; b=CKQI5eUx0RJ2fyTULU/zIt/kcEqkrM4FRwgH4+VPfO/TgZcVT/fQ2g7BrCY+Hyfh+iCliv Lqa0FFwLrF+K5boutJHM9mq5yrkB70Ec7RHG2SV2GGs4L89DTUC9QIsii32aozQDJVnmSl DOdMCMIsPptnyH7hEt3OO09SCrw751s= X-MC-Unique: o06nGP0fNQ2XamMlwqRZJA-1 From: Han Han To: libvir-list@redhat.com Subject: [PATCH v4 4/4] news: qemu: Support rbd namespace Date: Fri, 7 Aug 2020 17:49:15 +0800 Message-Id: <20200807094915.3506690-5-hhan@redhat.com> In-Reply-To: <20200807094915.3506690-1-hhan@redhat.com> References: <20200807094915.3506690-1-hhan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: pkrempa@redhat.com, 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.15 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 Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Jason Dillaman --- NEWS.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 63ca689b43..57d8a40731 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -13,6 +13,12 @@ v6.7.0 (unreleased) =20 * **New features** =20 + * qemu: Support rbd namespace attribute + + The namespaces is for the tenant isolation within a rbd pool, introduc= ed + from Ceph Nautilus, supported since QEMU 5.0.0. In libvirt, using it by + the namespace attribute in the source element of rbd disk. + * **Improvements** =20 * **Bug fixes** --=20 2.27.0