From nobody Sun Apr 28 05:31:15 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 1505165541512865.9767459836798; Mon, 11 Sep 2017 14:32:21 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9096C99380; Mon, 11 Sep 2017 21:32:19 +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 884D25C89F; Mon, 11 Sep 2017 21:32:18 +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 E340018045C2; Mon, 11 Sep 2017 21:32:15 +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 v8BLQ2s2019259 for ; Mon, 11 Sep 2017 17:26:02 -0400 Received: by smtp.corp.redhat.com (Postfix) id D24415C54A; Mon, 11 Sep 2017 21:26:02 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-114.phx2.redhat.com [10.3.117.114]) by smtp.corp.redhat.com (Postfix) with ESMTP id 99EFF5E1A3 for ; Mon, 11 Sep 2017 21:26:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9096C99380 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: John Ferlan To: libvir-list@redhat.com Date: Mon, 11 Sep 2017 17:25:51 -0400 Message-Id: <20170911212551.26741-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2] storage: Adjust expected format for Disk startup processing 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 11 Sep 2017 21:32:20 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" https://bugzilla.redhat.com/show_bug.cgi?id=3D1464313 If a Disk pool was defined/created using XML that either didn't specify a specific format or specified format type=3D'unknown', then restarting a pool after an initial disk backend build with overwrite would fail after a libvirtd restart for a non-autostarted pool. This is because the persistent pool data is not updated during pool build w/ overwrite processing to have the VIR_STORAGE_POOL_DISK_DOS default format. So in addition to the alteration done during disk build processing, alter the default expectation for disk startup to be DOS if nothing has been defined yet. That will either succeed if the pool had been successfully built previously using the default DOS format or fail with a message indicating the format is something else that does not match the expect format 'dos'. Signed-off-by: John Ferlan --- v1: https://www.redhat.com/archives/libvir-list/2017-September/msg00124.ht= ml Changes since v1...=20 * Use a totally different methodology. Rather than updating the persistent config file, alter the start processing to handle the unknown setting in the persistent file properly. src/storage/storage_backend_disk.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/storage/storage_backend_disk.c b/src/storage/storage_backe= nd_disk.c index e8f67bb00..bce3b4e2a 100644 --- a/src/storage/storage_backend_disk.c +++ b/src/storage/storage_backend_disk.c @@ -446,8 +446,7 @@ static int virStorageBackendDiskStartPool(virConnectPtr conn ATTRIBUTE_UNUSED, virStoragePoolObjPtr pool) { - const char *format =3D - virStoragePoolFormatDiskTypeToString(pool->def->source.format); + const char *format; const char *path =3D pool->def->source.devices[0].path; =20 virWaitForDevices(); @@ -458,6 +457,9 @@ virStorageBackendDiskStartPool(virConnectPtr conn ATTRI= BUTE_UNUSED, return -1; } =20 + if (pool->def->source.format =3D=3D VIR_STORAGE_POOL_DISK_UNKNOWN) + pool->def->source.format =3D VIR_STORAGE_POOL_DISK_DOS; + format =3D virStoragePoolFormatDiskTypeToString(pool->def->source.form= at); if (!virStorageBackendDeviceIsEmpty(path, format, false)) return -1; =20 --=20 2.13.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list