From nobody Mon Feb 9 03:52:41 2026 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 1551708153088265.1170497566735; Mon, 4 Mar 2019 06:02:33 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 621B53097035; Mon, 4 Mar 2019 14:02:31 +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 32F2B60143; Mon, 4 Mar 2019 14:02:31 +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 E484C3D389; Mon, 4 Mar 2019 14:02:30 +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 x24E2PNV000614 for ; Mon, 4 Mar 2019 09:02:25 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4F5B5261A2; Mon, 4 Mar 2019 14:02:25 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id C7ECC2632A for ; Mon, 4 Mar 2019 14:02:24 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Mon, 4 Mar 2019 15:02:13 +0100 Message-Id: <129afb30f997be7a5b0e1245961eda419ba13d14.1551707952.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/4] Revert "Separate out StateAutoStart from StateInitialize" 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Mon, 04 Mar 2019 14:02:31 +0000 (UTC) Content-Type: text/plain; charset="utf-8" https://bugzilla.redhat.com/show_bug.cgi?id=3D1685151 This reverts commit e4a969092bda5b3b952963fdf6658895165040b7. Now that drivers may call virConnectOpen() on secondary drivers, it doesn't make much sense to have autostart separated from driver initialization callback. In fact, it creates a problem because one driver during its initialization might try to fetch an object from another driver but since the object is yet to be autostarted the fetch fails. This has been observed in reality: qemu driver performs qemuProcessReconnect() during qemu's stateInitialize phase which may call virDomainDiskTranslateSourcePool() which connects to the storage driver to look up the volume. But the storage driver did not autostarted its pools yet therefore volume lookup fails and the domain is killed. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- src/driver-state.h | 4 ---- src/libvirt.c | 14 +------------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/src/driver-state.h b/src/driver-state.h index 54ca17b260..a8595662af 100644 --- a/src/driver-state.h +++ b/src/driver-state.h @@ -30,9 +30,6 @@ typedef int virStateInhibitCallback callback, void *opaque); =20 -typedef void -(*virDrvStateAutoStart)(void); - typedef int (*virDrvStateCleanup)(void); =20 @@ -48,7 +45,6 @@ typedef virStateDriver *virStateDriverPtr; struct _virStateDriver { const char *name; virDrvStateInitialize stateInitialize; - virDrvStateAutoStart stateAutoStart; virDrvStateCleanup stateCleanup; virDrvStateReload stateReload; virDrvStateStop stateStop; diff --git a/src/libvirt.c b/src/libvirt.c index 854d70a2bf..7e665b6cba 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -632,11 +632,7 @@ virRegisterStateDriver(virStateDriverPtr driver) * @callback: callback to invoke to inhibit shutdown of the daemon * @opaque: data to pass to @callback * - * Initialize all virtualization drivers. Accomplished in two phases, - * the first being state and structure initialization followed by any - * auto start supported by the driver. This is done to ensure dependencies - * that some drivers may have on another driver having been initialized - * will exist, such as the storage driver's need to use the secret driver. + * Initialize all virtualization drivers. * * Returns 0 if all succeed, -1 upon any failure. */ @@ -664,14 +660,6 @@ virStateInitialize(bool privileged, } } } - - for (i =3D 0; i < virStateDriverTabCount; i++) { - if (virStateDriverTab[i]->stateAutoStart) { - VIR_DEBUG("Running global auto start for %s state driver", - virStateDriverTab[i]->name); - virStateDriverTab[i]->stateAutoStart(); - } - } return 0; } =20 --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list