From nobody Wed Nov 27 04:59:33 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 ARC-Seal: i=1; a=rsa-sha256; t=1558708670; cv=none; d=zoho.com; s=zohoarc; b=FXUmNMraVXnJRGtJRb6pGsxhr77u/208VqD4a3KawVX7OlfQQuPO2ulKtu+5Y+w6e8z9fmVPazbEMLoR/VM+O1EwZ3ABsmriMoTv19UG+zb6aqcXP3wpL67WMMxJ6qXxYkV5rmxGI4vTU6blIje2S4aFmdwNwFufOqlsNjUrUSc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558708670; h=Content-Type:Content-Transfer-Encoding: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:ARC-Authentication-Results; bh=J5Kn8Xt4FzZyEaeCm3rOiSQvK4OTgLvHkJwJW1HbS/k=; b=OwPIzG3SSVDzNyKKPa7XdXTxxUiJMag0MeMSXJbY2SHqsqV9XJHA1FXiVz4TNcDuuLzHSV0Q24nqL58GPEzLIhAVer6o6PkTffjrBTlqLd99+U3EWCt+al+CppzuU8hMOhJeoErcN9p7629JDTdH979KiuG5Jxo+K0Vc0YG0e+0= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 15587086709806.622809874496511; Fri, 24 May 2019 07:37:50 -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 39FB7C00C7DD; Fri, 24 May 2019 14:37:49 +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 132B01835C; Fri, 24 May 2019 14:37:48 +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 CB6301806B16; Fri, 24 May 2019 14:37:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x4OEa90g011392 for ; Fri, 24 May 2019 10:36:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1531B69299; Fri, 24 May 2019 14:36:09 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 912C56928D for ; Fri, 24 May 2019 14:36:08 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Fri, 24 May 2019 16:35:45 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v1 09/11] storagePoolCreateXML: Don't lose persistent storage on failed create 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 24 May 2019 14:37:49 +0000 (UTC) Content-Type: text/plain; charset="utf-8" If there's a persistent storage and user tries to start a new one with the same name and UUID (e.g. to test new configuration) it may happen that upon failure we lose the persistent defintion. Fortunately, we don't remove it from the disk only from the internal list of the pools. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- src/storage/storage_driver.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index 38b83a77b7..def4123b82 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -744,6 +744,7 @@ storagePoolCreateXML(virConnectPtr conn, goto cleanup; =20 if (!(obj =3D virStoragePoolObjListAdd(driver->pools, newDef, + VIR_STORAGE_POOL_OBJ_LIST_ADD_LIV= E | VIR_STORAGE_POOL_OBJ_LIST_ADD_CHE= CK_LIVE))) goto cleanup; newDef =3D NULL; @@ -790,7 +791,7 @@ storagePoolCreateXML(virConnectPtr conn, return pool; =20 error: - virStoragePoolObjRemove(driver->pools, obj); + virStoragePoolUpdateInactive(obj); goto cleanup; } =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list