From nobody Mon Feb 9 10:27:56 2026 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 --- 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