From nobody Thu May 2 06:17:28 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; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 15047890561968.36706664037979; Thu, 7 Sep 2017 05:57:36 -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 8C75F1F56C; Thu, 7 Sep 2017 12:57:34 +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 458A36BF66; Thu, 7 Sep 2017 12:57:34 +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 5149B180610B; Thu, 7 Sep 2017 12:57: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 v87CvT6X031096 for ; Thu, 7 Sep 2017 08:57:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id 50D0318B8A; Thu, 7 Sep 2017 12:57:29 +0000 (UTC) Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 44EEE18B9D for ; Thu, 7 Sep 2017 12:57:22 +0000 (UTC) Received: from special.mail1.smtp.beget.ru (special.mail1.smtp.beget.ru [5.101.158.91]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 432304E33A for ; Thu, 7 Sep 2017 12:57:20 +0000 (UTC) Received: from [5.101.159.150] (port=37258 helo=rin.office.beget.ru) by smtp.beget.ru with esmtpa (Exim 4.89-beget) (envelope-from ) id 1dpwMv-0003P0-TN; Thu, 07 Sep 2017 15:57:17 +0300 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8C75F1F56C Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=beget.ru Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 8C75F1F56C Authentication-Results: mx1.redhat.com; dkim=fail reason="signature verification failed" (1024-bit key) header.d=beget.ru header.i=@beget.ru header.b="cTjCJ/3A" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 432304E33A Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=beget.ru Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=apolyakov@beget.ru DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 432304E33A DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=beget.ru; s=beget; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender: Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=ULlQvE85kIggXh6N6w2rSHOReZPOEXsQUAIVQ6u4tc4=; b=cTjCJ/3AFcO/F0feF8apIRPorm VCfI6LyYqWOC5kZGM/+Nt9remGrRH+BGAC6GAP/qSndnUvINqStqMfEUemJAo9baicthaVtqcUczv rICYB9HWNNfZP0aUMuL+9kF+c9MfJehnRvPXUOY/Ei54xU5Mz4HbI89iYHUnfRMHRINI=; From: apolyakov@beget.ru To: libvir-list@redhat.com Date: Thu, 7 Sep 2017 15:56:58 +0300 Message-Id: <20170907125659.6235-2-apolyakov@beget.ru> In-Reply-To: <20170907125659.6235-1-apolyakov@beget.ru> References: <20170907125659.6235-1-apolyakov@beget.ru> X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 205 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 07 Sep 2017 12:57:21 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 07 Sep 2017 12:57:21 +0000 (UTC) for IP:'5.101.158.91' DOMAIN:'special.mail1.smtp.beget.ru' HELO:'special.mail1.smtp.beget.ru' FROM:'apolyakov@beget.ru' RCPT:'' X-RedHat-Spam-Score: -0.112 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, SPF_PASS) 5.101.158.91 special.mail1.smtp.beget.ru 5.101.158.91 special.mail1.smtp.beget.ru X-Scanned-By: MIMEDefang 2.78 on 10.5.110.38 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Alexander Polyakov Subject: [libvirt] [PATCH 1/2] logical: implement volume resize 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: , MIME-Version: 1.0 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.30]); Thu, 07 Sep 2017 12:57:35 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Alexander Polyakov Add new virStorageBackendLogicalResizeVol function to implement resize of logical volumes Sparse volumes are not supported Signed-off-by: Alexander Polyakov Reviewed-by: John Ferlan --- m4/virt-storage-lvm.m4 | 4 ++++ src/storage/storage_backend_logical.c | 37 +++++++++++++++++++++++++++++++= ++++ 2 files changed, 41 insertions(+) diff --git a/m4/virt-storage-lvm.m4 b/m4/virt-storage-lvm.m4 index a0ccca7a0..0932995b4 100644 --- a/m4/virt-storage-lvm.m4 +++ b/m4/virt-storage-lvm.m4 @@ -30,6 +30,7 @@ AC_DEFUN([LIBVIRT_STORAGE_CHECK_LVM], [ AC_PATH_PROG([VGREMOVE], [vgremove], [], [$LIBVIRT_SBIN_PATH]) AC_PATH_PROG([LVREMOVE], [lvremove], [], [$LIBVIRT_SBIN_PATH]) AC_PATH_PROG([LVCHANGE], [lvchange], [], [$LIBVIRT_SBIN_PATH]) + AC_PATH_PROG([LVRESIZE], [lvresize], [], [$LIBVIRT_SBIN_PATH]) AC_PATH_PROG([VGCHANGE], [vgchange], [], [$LIBVIRT_SBIN_PATH]) AC_PATH_PROG([VGSCAN], [vgscan], [], [$LIBVIRT_SBIN_PATH]) AC_PATH_PROG([PVS], [pvs], [], [$LIBVIRT_SBIN_PATH]) @@ -44,6 +45,7 @@ AC_DEFUN([LIBVIRT_STORAGE_CHECK_LVM], [ if test -z "$VGREMOVE" ; then AC_MSG_ERROR([We need vgremove for LVM= storage driver]) ; fi if test -z "$LVREMOVE" ; then AC_MSG_ERROR([We need lvremove for LVM= storage driver]) ; fi if test -z "$LVCHANGE" ; then AC_MSG_ERROR([We need lvchange for LVM= storage driver]) ; fi + if test -z "$LVRESIZE" ; then AC_MSG_ERROR([We need lvresize for LVM= storage driver]) ; fi if test -z "$VGCHANGE" ; then AC_MSG_ERROR([We need vgchange for LVM= storage driver]) ; fi if test -z "$VGSCAN" ; then AC_MSG_ERROR([We need vgscan for LVM sto= rage driver]) ; fi if test -z "$PVS" ; then AC_MSG_ERROR([We need pvs for LVM storage d= river]) ; fi @@ -57,6 +59,7 @@ AC_DEFUN([LIBVIRT_STORAGE_CHECK_LVM], [ if test -z "$VGREMOVE" ; then with_storage_lvm=3Dno ; fi if test -z "$LVREMOVE" ; then with_storage_lvm=3Dno ; fi if test -z "$LVCHANGE" ; then with_storage_lvm=3Dno ; fi + if test -z "$LVRESIZE" ; then with_storage_lvm=3Dno ; fi if test -z "$VGCHANGE" ; then with_storage_lvm=3Dno ; fi if test -z "$VGSCAN" ; then with_storage_lvm=3Dno ; fi if test -z "$PVS" ; then with_storage_lvm=3Dno ; fi @@ -75,6 +78,7 @@ AC_DEFUN([LIBVIRT_STORAGE_CHECK_LVM], [ AC_DEFINE_UNQUOTED([VGREMOVE],["$VGREMOVE"],[Location of vgremove pr= ogram]) AC_DEFINE_UNQUOTED([LVREMOVE],["$LVREMOVE"],[Location of lvremove pr= ogram]) AC_DEFINE_UNQUOTED([LVCHANGE],["$LVCHANGE"],[Location of lvchange pr= ogram]) + AC_DEFINE_UNQUOTED([LVRESIZE],["$LVRESIZE"],[Location of lvresize pr= ogram]) AC_DEFINE_UNQUOTED([VGCHANGE],["$VGCHANGE"],[Location of vgchange pr= ogram]) AC_DEFINE_UNQUOTED([VGSCAN],["$VGSCAN"],[Location of vgscan program]) AC_DEFINE_UNQUOTED([PVS],["$PVS"],[Location of pvs program]) diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_ba= ckend_logical.c index 67f70e551..e5cb09922 100644 --- a/src/storage/storage_backend_logical.c +++ b/src/storage/storage_backend_logical.c @@ -1072,6 +1072,42 @@ virStorageBackendLogicalVolWipe(virConnectPtr conn, return -1; } =20 +static int +virStorageBackendLogicalResizeVol(virConnectPtr conn ATTRIBUTE_UNUSED, + virStoragePoolObjPtr pool ATTRIBUTE_UNU= SED, + virStorageVolDefPtr vol, + unsigned long long capacity, + unsigned int flags) +{ + virCheckFlags(VIR_STORAGE_VOL_RESIZE_SHRINK | + VIR_STORAGE_VOL_RESIZE_DELTA, -1); + + bool delta =3D flags & VIR_STORAGE_VOL_RESIZE_DELTA; + bool shrink =3D flags & VIR_STORAGE_VOL_RESIZE_SHRINK; + + if (vol->target.sparse) { + virReportError(VIR_ERR_NO_SUPPORT, + _("logical volume '%s' is sparse, volume resize " + "not supported"), + vol->target.path); + return -1; + } + + virCommandPtr cmd =3D virCommandNewArgList(LVRESIZE, "-L", NULL); + + if (delta) { + virCommandAddArgFormat(cmd, "%c%lluB", shrink ? '-' : '+', + capacity); + } else { + virCommandAddArgFormat(cmd, "%lluB", capacity); + } + virCommandAddArgFormat(cmd, "%s", vol->target.path); + int ret =3D virCommandRun(cmd, NULL); + + virCommandFree(cmd); + return ret; +} + virStorageBackend virStorageBackendLogical =3D { .type =3D VIR_STORAGE_POOL_LOGICAL, =20 @@ -1089,6 +1125,7 @@ virStorageBackend virStorageBackendLogical =3D { .uploadVol =3D virStorageBackendVolUploadLocal, .downloadVol =3D virStorageBackendVolDownloadLocal, .wipeVol =3D virStorageBackendLogicalVolWipe, + .resizeVol =3D virStorageBackendLogicalResizeVol, }; =20 =20 --=20 2.13.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 06:17:28 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; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1504789056463469.5677292328895; Thu, 7 Sep 2017 05:57:36 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id E7264C047B60; Thu, 7 Sep 2017 12:57:34 +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 1B6947BCAB; Thu, 7 Sep 2017 12:57:34 +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 AD0E21806106; Thu, 7 Sep 2017 12:57:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v87CvVVU031118 for ; Thu, 7 Sep 2017 08:57:31 -0400 Received: by smtp.corp.redhat.com (Postfix) id A86339557E; Thu, 7 Sep 2017 12:57:31 +0000 (UTC) Received: from mx1.redhat.com (ext-mx01.extmail.prod.ext.phx2.redhat.com [10.5.110.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A2A7D95578 for ; Thu, 7 Sep 2017 12:57:22 +0000 (UTC) Received: from special.mail1.smtp.beget.ru (special.mail1.smtp.beget.ru [5.101.158.91]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2A92481DE4 for ; Thu, 7 Sep 2017 12:57:20 +0000 (UTC) Received: from [5.101.159.150] (port=37258 helo=rin.office.beget.ru) by smtp.beget.ru with esmtpa (Exim 4.89-beget) (envelope-from ) id 1dpwMv-0003P0-VC; Thu, 07 Sep 2017 15:57:18 +0300 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E7264C047B60 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=beget.ru Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com E7264C047B60 Authentication-Results: mx1.redhat.com; dkim=fail reason="signature verification failed" (1024-bit key) header.d=beget.ru header.i=@beget.ru header.b="g9irSh1L" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2A92481DE4 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=beget.ru Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=apolyakov@beget.ru DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 2A92481DE4 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=beget.ru; s=beget; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender: Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=3ptnt75jGg7bW0jS6oU5Xkf1T1qdlLGjRpeZI0SfpBI=; b=g9irSh1LDKa4JWc7zloGXFB7eh DntlwDPYDrSHaDvyyQ9J8x7GRaxDRDh7++g7AuQyqPyDXLqFPAfEbYG5HXFm1x4YhH76ui6KWMF10 tgLZBg/IK+htJ92a6vHlI8X3QiLR8lqgXQCqdEC4WZfQslBLAh+rCnkQ/TiGec4ZrNYw=; From: apolyakov@beget.ru To: libvir-list@redhat.com Date: Thu, 7 Sep 2017 15:56:59 +0300 Message-Id: <20170907125659.6235-3-apolyakov@beget.ru> In-Reply-To: <20170907125659.6235-1-apolyakov@beget.ru> References: <20170907125659.6235-1-apolyakov@beget.ru> X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 205 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 07 Sep 2017 12:57:21 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 07 Sep 2017 12:57:21 +0000 (UTC) for IP:'5.101.158.91' DOMAIN:'special.mail1.smtp.beget.ru' HELO:'special.mail1.smtp.beget.ru' FROM:'apolyakov@beget.ru' RCPT:'' X-RedHat-Spam-Score: -0.112 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, SPF_PASS) 5.101.158.91 special.mail1.smtp.beget.ru 5.101.158.91 special.mail1.smtp.beget.ru X-Scanned-By: MIMEDefang 2.78 on 10.5.110.25 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Alexander Polyakov Subject: [libvirt] [PATCH 2/2] news: Document lvm volume resize 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: , MIME-Version: 1.0 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 07 Sep 2017 12:57:35 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Alexander Polyakov Signed-off-by: Alexander Polyakov Reviewed-by: John Ferlan --- docs/news.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index 483f9d6d1..44e99205f 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -37,6 +37,14 @@
+ + + logical: Add volume resize + + + It's now possible to resize LVM volumes. + +
--=20 2.13.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list