From nobody Fri Apr 19 06:16:56 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 153137550525456.36503829844787; Wed, 11 Jul 2018 23:05:05 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2DA2D308FBAB; Thu, 12 Jul 2018 06:05:02 +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 167F43001A40; Thu, 12 Jul 2018 06:05:01 +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 3E86A4A460; Thu, 12 Jul 2018 06:04:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6C64u6A002404 for ; Thu, 12 Jul 2018 02:04:57 -0400 Received: by smtp.corp.redhat.com (Postfix) id CAAC82010CB7; Thu, 12 Jul 2018 06:04:56 +0000 (UTC) Received: from mx1.redhat.com (ext-mx12.extmail.prod.ext.phx2.redhat.com [10.5.110.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 04B252010CAC; Thu, 12 Jul 2018 06:04:55 +0000 (UTC) Received: from h3cmg01-ex.h3c.com (smtp.h3c.com [60.191.123.56]) by mx1.redhat.com (Postfix) with ESMTP id 4A1F8308A975; Thu, 12 Jul 2018 06:04:51 +0000 (UTC) Received: from BJHUB01-EX.srv.huawei-3com.com (unknown [10.63.20.169]) by h3cmg01-ex.h3c.com with smtp id 0b1d_0250_80f0b755_998a_49db_a630_3f9e4049331f; Thu, 12 Jul 2018 14:04:49 +0800 Received: from H3CMLB14-EX.srv.huawei-3com.com ([fe80::f804:6772:bd71:f07f]) by BJHUB01-EX.srv.huawei-3com.com ([::1]) with mapi id 14.03.0248.002; Thu, 12 Jul 2018 14:02:54 +0800 From: Shichangkuo To: "'libvir-list@redhat.com'" , "'Michal Privoznik'" , "'jferlan@redhat.com'" Thread-Topic: [PATCH v1] storage: prefer using newDef to save configfile Thread-Index: AdQZpdBQaPGQH1giRpmM1XyjcOwmBg== Date: Thu, 12 Jul 2018 06:02:52 +0000 Message-ID: Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.152.189.61] MIME-Version: 1.0 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 207 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Thu, 12 Jul 2018 06:04:53 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Thu, 12 Jul 2018 06:04:53 +0000 (UTC) for IP:'60.191.123.56' DOMAIN:'smtp.h3c.com' HELO:'h3cmg01-ex.h3c.com' FROM:'shi.changkuo@h3c.com' RCPT:'' X-RedHat-Spam-Score: 0.83 (HELO_DYNAMIC_DHCP, RCVD_IN_DNSWL_NONE, SPF_PASS) 60.191.123.56 smtp.h3c.com 60.191.123.56 smtp.h3c.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.41 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.25 X-MIME-Autoconverted: from base64 to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id w6C64u6A002404 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v1] storage: prefer using newDef to save configfile 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-Type: text/plain; charset="utf-8" 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.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Thu, 12 Jul 2018 06:05:03 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 When re-defining an active storage pool, the configfile has not changed. This issue was introduced by bfcd8fc, storage: Use virStoragePoolObjGetDef accessor for driver. So we prefer using newDef to save configfile. Signed-off-by: shichangkuo --- src/storage/storage_driver.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index 254818e..8070d15 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -810,13 +810,14 @@ storagePoolDefineXML(virConnectPtr conn, if (!(obj =3D virStoragePoolObjAssignDef(driver->pools, newDef))) goto cleanup; - newDef =3D NULL; + newDef =3D virStoragePoolObjGetNewDef(obj); def =3D virStoragePoolObjGetDef(obj); - if (virStoragePoolObjSaveDef(driver, obj, def) < 0) { + if (virStoragePoolObjSaveDef(driver, obj, newDef ? newDef : def) < 0) { virStoragePoolObjRemove(driver->pools, obj); virObjectUnref(obj); obj =3D NULL; + newDef =3D NULL; goto cleanup; } @@ -826,6 +827,7 @@ storagePoolDefineXML(virConnectPtr conn, VIR_INFO("Defining storage pool '%s'", def->name); pool =3D virGetStoragePool(conn, def->name, def->uuid, NULL, NULL); + newDef =3D NULL; cleanup: virObjectEventStateQueue(driver->storageEventState, event); -- 1.7.9.5 ---------------------------------------------------------------------------= ---------------------------------------------------------- =E6=9C=AC=E9=82=AE=E4=BB=B6=E5=8F=8A=E5=85=B6=E9=99=84=E4=BB=B6=E5=90=AB=E6= =9C=89=E6=96=B0=E5=8D=8E=E4=B8=89=E9=9B=86=E5=9B=A2=E7=9A=84=E4=BF=9D=E5=AF= =86=E4=BF=A1=E6=81=AF=EF=BC=8C=E4=BB=85=E9=99=90=E4=BA=8E=E5=8F=91=E9=80=81= =E7=BB=99=E4=B8=8A=E9=9D=A2=E5=9C=B0=E5=9D=80=E4=B8=AD=E5=88=97=E5=87=BA =E7=9A=84=E4=B8=AA=E4=BA=BA=E6=88=96=E7=BE=A4=E7=BB=84=E3=80=82=E7=A6=81=E6= =AD=A2=E4=BB=BB=E4=BD=95=E5=85=B6=E4=BB=96=E4=BA=BA=E4=BB=A5=E4=BB=BB=E4=BD= =95=E5=BD=A2=E5=BC=8F=E4=BD=BF=E7=94=A8=EF=BC=88=E5=8C=85=E6=8B=AC=E4=BD=86= =E4=B8=8D=E9=99=90=E4=BA=8E=E5=85=A8=E9=83=A8=E6=88=96=E9=83=A8=E5=88=86=E5= =9C=B0=E6=B3=84=E9=9C=B2=E3=80=81=E5=A4=8D=E5=88=B6=E3=80=81 =E6=88=96=E6=95=A3=E5=8F=91=EF=BC=89=E6=9C=AC=E9=82=AE=E4=BB=B6=E4=B8=AD=E7= =9A=84=E4=BF=A1=E6=81=AF=E3=80=82=E5=A6=82=E6=9E=9C=E6=82=A8=E9=94=99=E6=94= =B6=E4=BA=86=E6=9C=AC=E9=82=AE=E4=BB=B6=EF=BC=8C=E8=AF=B7=E6=82=A8=E7=AB=8B= =E5=8D=B3=E7=94=B5=E8=AF=9D=E6=88=96=E9=82=AE=E4=BB=B6=E9=80=9A=E7=9F=A5=E5= =8F=91=E4=BB=B6=E4=BA=BA=E5=B9=B6=E5=88=A0=E9=99=A4=E6=9C=AC =E9=82=AE=E4=BB=B6=EF=BC=81 This e-mail and its attachments contain confidential information from New H= 3C, which is intended only for the person or entity whose address is listed above. Any u= se of the information contained herein in any way (including, but not limited to, tot= al or partial disclosure, reproduction, or dissemination) by persons other than the inten= ded recipient(s) is prohibited. If you receive this e-mail in error, please not= ify the sender by phone or email immediately and delete it! -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list