From nobody Fri Apr 19 08:01:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1552663076289866.0399859691659; Fri, 15 Mar 2019 08:17:56 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 65DB53003457; Fri, 15 Mar 2019 15:17:54 +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 3F28D1799F; Fri, 15 Mar 2019 15:17:54 +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 04F7E3D38B; Fri, 15 Mar 2019 15:17:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x2FFHcpb001278 for ; Fri, 15 Mar 2019 11:17:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0677B19C7C; Fri, 15 Mar 2019 15:17:38 +0000 (UTC) Received: from mx1.redhat.com (ext-mx10.extmail.prod.ext.phx2.redhat.com [10.5.110.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 002B019C77 for ; Fri, 15 Mar 2019 15:17:35 +0000 (UTC) Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2FEC35946F for ; Fri, 15 Mar 2019 15:17:35 +0000 (UTC) Received: by mail-qk1-f199.google.com with SMTP id x63so8037538qka.5 for ; Fri, 15 Mar 2019 08:17:35 -0700 (PDT) Received: from cube-1.lan (pool-96-241-25-63.washdc.fios.verizon.net. [96.241.25.63]) by smtp.gmail.com with ESMTPSA id o8sm1210850qkg.6.2019.03.15.08.17.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Mar 2019 08:17:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wKi7WJpV1OZQo3TXrWSPh7OtZedcsrNBkcgtuYkWBak=; b=YGuFo94zt4oq9041z9V4/vqGMAVnhUWt+k0a/8wtKP8ds/NPx3SHCDJZi1x746Ou07 Kq4FQiDmMk3/FRqB5WxeQBw38KTzsvORuXhWg7TY0N4t6JL/bcv82Y37VV8GaoVR7rPm rfkYhJpn6bESgkd22iLDRHbCfoCg8w1yJ8lor6bZc0Rov4YQLH/NbWwCdNHJXDGW1l7l iL1yoNGgjNuFj0hgq9ivHl39x82bTPdpC/Iy5rowXqKapnZ2HTU0dusT9q2aBVEHkeLt p6FhjC5ZcrrBWyfa3VjJ7fLGXfSqbsBB/J0a0+42sl/dh4Vq7WGCYTULv8mX79rGazAk beuA== X-Gm-Message-State: APjAAAWcLtyrRufbOpF8HP2JvpiY9iwqVbvIDCzkyEfqC09S6+zxBTeG T3fc+oMUmGc8hBsFiZM9ktXSmtTvDxfJ3mOsJlfDvWH/pky+b4o9GrefpEFzkD321LJE8FipnfU XIOm6+TdE+OZgFHKlwtE= X-Received: by 2002:a0c:e5c8:: with SMTP id u8mr1714707qvm.158.1552663054140; Fri, 15 Mar 2019 08:17:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqxRcoX7CgHOuHMIe2GH/Zpgl509Ssx1HhwHeh5qi+Ia8yKGgjFgupYjV3VwkrsFt1gfyWIqMA== X-Received: by 2002:a0c:e5c8:: with SMTP id u8mr1714692qvm.158.1552663053938; Fri, 15 Mar 2019 08:17:33 -0700 (PDT) From: jdillama@redhat.com X-Google-Original-From: dillaman@redhat.com To: libvir-list@redhat.com Date: Fri, 15 Mar 2019 11:17:23 -0400 Message-Id: <20190315151725.1068-2-dillaman@redhat.com> In-Reply-To: <20190315151725.1068-1-dillaman@redhat.com> References: <20190315151725.1068-1-dillaman@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Jason Dillaman Subject: [libvirt] [PATCH 1/3] rbd: do not attempt to use fast-diff if it's marked invalid 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Fri, 15 Mar 2019 15:17:54 +0000 (UTC) Content-Type: text/plain; charset="utf-8" From: Jason Dillaman The librbd API will transparently revert to a slow disk usage calculation method if the fast-diff map is marked as invalid. Signed-off-by: Jason Dillaman --- src/storage/storage_backend_rbd.c | 41 ++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backen= d_rbd.c index 2b7af1db23..e67911f928 100644 --- a/src/storage/storage_backend_rbd.c +++ b/src/storage/storage_backend_rbd.c @@ -437,10 +437,29 @@ volStorageBackendRBDGetFeatures(rbd_image_t image, } =20 #if LIBRBD_VERSION_CODE > 265 +static int +volStorageBackendRBDGetFlags(rbd_image_t image, + const char *volname, + uint64_t *flags) +{ + int r, ret =3D -1; + + if ((r =3D rbd_get_flags(image, flags)) < 0) { + virReportSystemError(-r, _("failed to get the flags of RBD image " + "%s"), volname); + goto cleanup; + } + ret =3D 0; + + cleanup: + return ret; +} + static bool -volStorageBackendRBDUseFastDiff(uint64_t features) +volStorageBackendRBDUseFastDiff(uint64_t features, uint64_t flags) { - return features & RBD_FEATURE_FAST_DIFF; + return (((features & RBD_FEATURE_FAST_DIFF) !=3D 0ULL) && + ((flags & RBD_FLAG_FAST_DIFF_INVALID) =3D=3D 0ULL)); } =20 static int @@ -484,7 +503,17 @@ virStorageBackendRBDSetAllocation(virStorageVolDefPtr = vol, =20 #else static int -volStorageBackendRBDUseFastDiff(uint64_t features ATTRIBUTE_UNUSED) +volStorageBackendRBDGetFlags(rbd_image_t image, + const char *volname, + uint64_t *flags) +{ + *flags =3D 0; + return 0; +} + +static int +volStorageBackendRBDUseFastDiff(uint64_t features ATTRIBUTE_UNUSED, + uint64_t feature_flags ATTRIBUTE_UNUSED) { return false; } @@ -509,6 +538,7 @@ volStorageBackendRBDRefreshVolInfo(virStorageVolDefPtr = vol, rbd_image_t image =3D NULL; rbd_image_info_t info; uint64_t features; + uint64_t flags; =20 if ((r =3D rbd_open_read_only(ptr->ioctx, vol->name, &image, NULL)) < = 0) { ret =3D -r; @@ -527,11 +557,14 @@ volStorageBackendRBDRefreshVolInfo(virStorageVolDefPt= r vol, if (volStorageBackendRBDGetFeatures(image, vol->name, &features) < 0) goto cleanup; =20 + if (volStorageBackendRBDGetFlags(image, vol->name, &flags) < 0) + goto cleanup; + vol->target.capacity =3D info.size; vol->type =3D VIR_STORAGE_VOL_NETWORK; vol->target.format =3D VIR_STORAGE_FILE_RAW; =20 - if (volStorageBackendRBDUseFastDiff(features)) { + if (volStorageBackendRBDUseFastDiff(features, flags)) { VIR_DEBUG("RBD image %s/%s has fast-diff feature enabled. " "Querying for actual allocation", def->source.name, vol->name); --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 19 08:01:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1552663065168810.0458149838981; Fri, 15 Mar 2019 08:17:45 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 630503082AC3; Fri, 15 Mar 2019 15:17:43 +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 39B2119C77; Fri, 15 Mar 2019 15:17:43 +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 EB5853D389; Fri, 15 Mar 2019 15:17:42 +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 x2FFHdOV001287 for ; Fri, 15 Mar 2019 11:17:39 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2968460FDD; Fri, 15 Mar 2019 15:17:39 +0000 (UTC) Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2424460FDC for ; Fri, 15 Mar 2019 15:17:37 +0000 (UTC) Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1455F3DDB6 for ; Fri, 15 Mar 2019 15:17:37 +0000 (UTC) Received: by mail-qk1-f197.google.com with SMTP id l10so5806084qkj.22 for ; Fri, 15 Mar 2019 08:17:37 -0700 (PDT) Received: from cube-1.lan (pool-96-241-25-63.washdc.fios.verizon.net. [96.241.25.63]) by smtp.gmail.com with ESMTPSA id o8sm1210850qkg.6.2019.03.15.08.17.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Mar 2019 08:17:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FpCpW8li64Hq8JvMqQbFs7Iav8G2K2grm6mGXirxwOc=; b=ARDSLCdWi3qmQ3h7YhSeZIfGAXITC25gdpkfEA/g5SCRPqekNDeFaLJz3Iq68DHjNN EMdnMKV5IH4WmTIIKHWmYdlosWbh/GiwdNlAxkyLCwJ5H8zmAQ4MdjfpOavFnSAKw3Jh 6fHN2p4iODUHcW1MV/n7C6IY6ZAX9TmZjPefYVWT2h+2rrHb1rU00BZEOcwNiCEKQ9bO 0jJvhiw/x+Zl0OVF+B4XumCAwyorvTfR869tK6HLcuxlf1y2L3bt3oOtHINIcIGn3FRH 6fLRxjMAIEZ7bINgpcps6NllvDrbL7roulQ6eJBgwtmPcsf26PQKkmni7ryDmi5mlxM5 sMpA== X-Gm-Message-State: APjAAAXk5yFGaV6SBfd8OYO9eZ2i4YzaONYilYrFkYZfs+fODLTdUWOL gH55X+552+MW812chN9uGHViOnyItGMCbbA4olQm8owObMB57KBQ2Sh1olVON+bE/er7RwcDwK6 /oliNhsL04Qs83evpwlc= X-Received: by 2002:a0c:b524:: with SMTP id d36mr2985013qve.48.1552663055839; Fri, 15 Mar 2019 08:17:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqzQnmA9RwD2iJv2cvfMx8k/FIDlxfPpeN+F5XfOkDU43RIVManLfVO2bMemZxNxyfRRmia+4w== X-Received: by 2002:a0c:b524:: with SMTP id d36mr2984988qve.48.1552663055570; Fri, 15 Mar 2019 08:17:35 -0700 (PDT) From: jdillama@redhat.com X-Google-Original-From: dillaman@redhat.com To: libvir-list@redhat.com Date: Fri, 15 Mar 2019 11:17:24 -0400 Message-Id: <20190315151725.1068-3-dillaman@redhat.com> In-Reply-To: <20190315151725.1068-1-dillaman@redhat.com> References: <20190315151725.1068-1-dillaman@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Jason Dillaman Subject: [libvirt] [PATCH 2/3] storage: optional 'refresh_volume_allocation' attribute on pool 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Fri, 15 Mar 2019 15:17:43 +0000 (UTC) Content-Type: text/plain; charset="utf-8" From: Jason Dillaman When this attribute is set to 'capacity', refreshing volume allocations within the pool will report the capacity for the allocation. This is useful for certain backends where computing the actual allocation of a volume might be an expensive operation. Signed-off-by: Jason Dillaman --- docs/formatstorage.html.in | 15 +++++++++--- docs/schemas/storagecommon.rng | 7 ++++++ docs/schemas/storagepool.rng | 5 ++++ src/conf/storage_conf.c | 23 +++++++++++++++++++ src/conf/storage_conf.h | 9 ++++++++ .../pool-rbd-refresh-volume-allocation.xml | 12 ++++++++++ .../pool-rbd-refresh-volume-allocation.xml | 15 ++++++++++++ tests/storagepoolxml2xmltest.c | 1 + 8 files changed, 84 insertions(+), 3 deletions(-) create mode 100644 tests/storagepoolxml2xmlin/pool-rbd-refresh-volume-allo= cation.xml create mode 100644 tests/storagepoolxml2xmlout/pool-rbd-refresh-volume-all= ocation.xml diff --git a/docs/formatstorage.html.in b/docs/formatstorage.html.in index 968651330f..d40e463167 100644 --- a/docs/formatstorage.html.in +++ b/docs/formatstorage.html.in @@ -16,7 +16,7 @@

The top level tag for a storage pool document is 'pool'. It has - a single attribute type, which is one of dir, + an attribute type, which is one of dir, fs, netfs, disk, iscsi, logical, scsi (all since 0.4.1), @@ -27,8 +27,17 @@ zfs (since 1.2.8), vstorage (since 3.1.0), or iscsi-direct (since 4.7.0). - This corresponds to the - storage backend drivers listed further along in this document. + This corresponds to the storage backend drivers listed further along= in + this document. +

+

+ The 'pool' element may also have an optional + refresh_volume_allocation attribute to control how + volume allocation is computed during a refresh. Valid values + are default to compute the actual usage or + capacity to default the allocation to the logical + capacity for cases where computing the allocation is too expensive. + Since 5.1.1

General metadata

=20 diff --git a/docs/schemas/storagecommon.rng b/docs/schemas/storagecommon.rng index 63b51470a0..d837f92bc7 100644 --- a/docs/schemas/storagecommon.rng +++ b/docs/schemas/storagecommon.rng @@ -236,4 +236,11 @@ =20 + + + default + capacity + + + diff --git a/docs/schemas/storagepool.rng b/docs/schemas/storagepool.rng index 3907f70afe..e44ecdb3f3 100644 --- a/docs/schemas/storagepool.rng +++ b/docs/schemas/storagepool.rng @@ -11,6 +11,11 @@ =20 + + + + + diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index c7ab5b8802..dc4838058c 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -94,6 +94,11 @@ VIR_ENUM_IMPL(virStorageVolFormatDisk, "extended", ); =20 +VIR_ENUM_IMPL(virStorageVolRefreshAllocation, + VIR_STORAGE_VOL_REFRESH_ALLOCATION_LAST, + "default", "capacity", +); + VIR_ENUM_IMPL(virStoragePartedFs, VIR_STORAGE_PARTED_FS_TYPE_LAST, "ext2", "ext2", "fat16", @@ -797,6 +802,7 @@ virStoragePoolDefParseXML(xmlXPathContextPtr ctxt) xmlNodePtr source_node; VIR_AUTOPTR(virStoragePoolDef) def =3D NULL; VIR_AUTOFREE(char *) type =3D NULL; + VIR_AUTOFREE(char *) refresh_volume_allocation =3D NULL; VIR_AUTOFREE(char *) uuid =3D NULL; VIR_AUTOFREE(char *) target_path =3D NULL; =20 @@ -819,6 +825,18 @@ virStoragePoolDefParseXML(xmlXPathContextPtr ctxt) if ((options =3D virStoragePoolOptionsForPoolType(def->type)) =3D=3D N= ULL) return NULL; =20 + refresh_volume_allocation =3D virXPathString("string(./@refresh_volume= _allocation)", + ctxt); + if (refresh_volume_allocation) { + if ((def->refresh_volume_allocation =3D + virStorageVolRefreshAllocationTypeFromString(refresh_volum= e_allocation)) < 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("unknown storage pool volume refresh allo= cation type %s"), + refresh_volume_allocation); + return NULL; + } + } + source_node =3D virXPathNode("./source", ctxt); if (source_node) { if (virStoragePoolDefParseSource(ctxt, &def->source, def->type, @@ -1107,8 +1125,13 @@ virStoragePoolDefFormatBuf(virBufferPtr buf, return -1; } virBufferAsprintf(buf, "refresh_volume_allocation) + virBufferAsprintf(buf, " refresh_volume_allocation=3D'%s'", + virStorageVolRefreshAllocationTypeToString(def->= refresh_volume_allocation)); if (def->namespaceData && def->ns.href) virBufferAsprintf(buf, " %s", (def->ns.href)()); + + virBufferAddLit(buf, ">\n"); virBufferAdjustIndent(buf, 2); virBufferEscapeString(buf, "%s\n", def->name); diff --git a/src/conf/storage_conf.h b/src/conf/storage_conf.h index bfbebd15bd..f61d8f5a18 100644 --- a/src/conf/storage_conf.h +++ b/src/conf/storage_conf.h @@ -83,6 +83,13 @@ struct _virStorageVolSource { * backend for partition type creation */ }; =20 +typedef enum { + VIR_STORAGE_VOL_REFRESH_ALLOCATION_DEFAULT, /* compute actual allocati= on */ + VIR_STORAGE_VOL_REFRESH_ALLOCATION_CAPACITY, /* use logical capacity */ + VIR_STORAGE_VOL_REFRESH_ALLOCATION_LAST, +} virStorageVolRefreshAllocationType; + +VIR_ENUM_DECL(virStorageVolRefreshAllocation); =20 typedef struct _virStorageVolDef virStorageVolDef; typedef virStorageVolDef *virStorageVolDefPtr; @@ -243,6 +250,8 @@ struct _virStoragePoolDef { unsigned char uuid[VIR_UUID_BUFLEN]; int type; /* virStoragePoolType */ =20 + int refresh_volume_allocation; /* virStorageVolRefreshAllocationType */ + unsigned long long allocation; /* bytes */ unsigned long long capacity; /* bytes */ unsigned long long available; /* bytes */ diff --git a/tests/storagepoolxml2xmlin/pool-rbd-refresh-volume-allocation.= xml b/tests/storagepoolxml2xmlin/pool-rbd-refresh-volume-allocation.xml new file mode 100644 index 0000000000..632d895310 --- /dev/null +++ b/tests/storagepoolxml2xmlin/pool-rbd-refresh-volume-allocation.xml @@ -0,0 +1,12 @@ + + ceph + 47c1faee-0207-e741-f5ae-d9b019b98fe2 + + rbd + + + + + + + diff --git a/tests/storagepoolxml2xmlout/pool-rbd-refresh-volume-allocation= .xml b/tests/storagepoolxml2xmlout/pool-rbd-refresh-volume-allocation.xml new file mode 100644 index 0000000000..c40c0b5bd5 --- /dev/null +++ b/tests/storagepoolxml2xmlout/pool-rbd-refresh-volume-allocation.xml @@ -0,0 +1,15 @@ + + ceph + 47c1faee-0207-e741-f5ae-d9b019b98fe2 + 0 + 0 + 0 + + + + rbd + + + + + diff --git a/tests/storagepoolxml2xmltest.c b/tests/storagepoolxml2xmltest.c index bd3408e8b8..2ae514f346 100644 --- a/tests/storagepoolxml2xmltest.c +++ b/tests/storagepoolxml2xmltest.c @@ -95,6 +95,7 @@ mymain(void) DO_TEST("pool-zfs-sourcedev"); DO_TEST("pool-rbd"); #ifdef WITH_STORAGE_RBD + DO_TEST("pool-rbd-refresh-volume-allocation"); DO_TEST("pool-rbd-ns-configopts"); #endif DO_TEST("pool-vstorage"); --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 19 08:01:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 155266307238832.98440596366959; Fri, 15 Mar 2019 08:17:52 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B580CAB099; Fri, 15 Mar 2019 15:17:50 +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 900C560C6C; Fri, 15 Mar 2019 15:17:50 +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 42E64181A009; Fri, 15 Mar 2019 15:17:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x2FFHc0Q001277 for ; Fri, 15 Mar 2019 11:17:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id 067EB891D; Fri, 15 Mar 2019 15:17:38 +0000 (UTC) Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.phx2.redhat.com [10.5.110.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 006C419C79 for ; Fri, 15 Mar 2019 15:17:37 +0000 (UTC) Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C76E988AA3 for ; Fri, 15 Mar 2019 15:17:37 +0000 (UTC) Received: by mail-qk1-f198.google.com with SMTP id x63so8037631qka.5 for ; Fri, 15 Mar 2019 08:17:37 -0700 (PDT) Received: from cube-1.lan (pool-96-241-25-63.washdc.fios.verizon.net. [96.241.25.63]) by smtp.gmail.com with ESMTPSA id o8sm1210850qkg.6.2019.03.15.08.17.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Mar 2019 08:17:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/Rf4TDaASBCHenRime0A+okVz6JjhfSB7bOU7KXHAV0=; b=oVw4zBrq+vrXflGtbKiugxlDAyzg8bh+WWIWshcXkroUfH3bueh9BYC0pb9iDfDBjh Cf4wNMU9OxZc4BipRuXTbA9hbasI9xRGchQED1RjaAoMCw6RIPvumdCHIufa55h4NMBl NswHeFNI+8oDTYFGJ1zanHWNW8YBRFS5fWiBZ0h4S8zSp5tYFo5grRFNVoOs0KMFmCIv CpY7jq9HWYLlyPfFpXq/wn0h94Z37oCzFiCMVr/kRxlw9ZNkg4+UO1kj/nqiBJ8Md99T COl0BIJG7kEhvRPeb4orX3FmenhVcusrLz7Z662Y0/syCK77cQXpdtwfK+Z8rtGWsNlQ KoRQ== X-Gm-Message-State: APjAAAUWtJk3HpnAV3VuMAloP8tMLesJwNfrkb5OW9BYC5DjlzLKezns 1Ui37W7AIJUFi+ztlXjISCY+gJ8yjIfyWDGjiO2Rko2Nd8XxrWAaAH8fFoiWuxyjthLoEVat+5K XlyWcegRnwFGviI2/7VU= X-Received: by 2002:ac8:1481:: with SMTP id l1mr3321202qtj.226.1552663056757; Fri, 15 Mar 2019 08:17:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqx/HWtphwClkXruNIT92zKhWHlG+HQm71TVT7gquGJr7DHz+owz+TjUovfCqrmyVHZD/ASaGg== X-Received: by 2002:ac8:1481:: with SMTP id l1mr3321181qtj.226.1552663056562; Fri, 15 Mar 2019 08:17:36 -0700 (PDT) From: jdillama@redhat.com X-Google-Original-From: dillaman@redhat.com To: libvir-list@redhat.com Date: Fri, 15 Mar 2019 11:17:25 -0400 Message-Id: <20190315151725.1068-4-dillaman@redhat.com> In-Reply-To: <20190315151725.1068-1-dillaman@redhat.com> References: <20190315151725.1068-1-dillaman@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Jason Dillaman Subject: [libvirt] [PATCH 3/3] rbd: optionally compute volume allocation from capacity 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 15 Mar 2019 15:17:51 +0000 (UTC) Content-Type: text/plain; charset="utf-8" From: Jason Dillaman Use the new 'refresh_volume_allocation' pool override to skip computing the actual volume usage if disabled. Signed-off-by: Jason Dillaman --- src/storage/storage_backend_rbd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backen= d_rbd.c index e67911f928..1b01fbb3a8 100644 --- a/src/storage/storage_backend_rbd.c +++ b/src/storage/storage_backend_rbd.c @@ -564,7 +564,8 @@ volStorageBackendRBDRefreshVolInfo(virStorageVolDefPtr = vol, vol->type =3D VIR_STORAGE_VOL_NETWORK; vol->target.format =3D VIR_STORAGE_FILE_RAW; =20 - if (volStorageBackendRBDUseFastDiff(features, flags)) { + if (def->refresh_volume_allocation =3D=3D VIR_STORAGE_VOL_REFRESH_ALLO= CATION_DEFAULT && + volStorageBackendRBDUseFastDiff(features, flags)) { VIR_DEBUG("RBD image %s/%s has fast-diff feature enabled. " "Querying for actual allocation", def->source.name, vol->name); --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list