From nobody Wed May 8 05:58:01 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1551708146019715.5865419582761; Mon, 4 Mar 2019 06:02:26 -0800 (PST) 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 5C983C057F3B; Mon, 4 Mar 2019 14:02:24 +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 34DF72CFBA; Mon, 4 Mar 2019 14:02:24 +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 ED298181A12A; Mon, 4 Mar 2019 14:02:23 +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 x24E2MSa000593 for ; Mon, 4 Mar 2019 09:02:22 -0500 Received: by smtp.corp.redhat.com (Postfix) id C4A0A1A8EA; Mon, 4 Mar 2019 14:02:22 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 481C62632A for ; Mon, 4 Mar 2019 14:02:20 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Mon, 4 Mar 2019 15:02:10 +0100 Message-Id: <70e0fd92833b1fe0bdfacb679bb0cb46529b159a.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 1/4] daemon: Register secret driver before storage driver 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 04 Mar 2019 14:02:24 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The order in which drivers are registered is important because their stateInitialize and stateAutoStart callback are called in that order. Well, stateAutoStart is going away and therefore if there is some dependency between two drivers (e.g. when initializing storage driver expects secret driver to be available already), the registration of such drivers must happen in correct order. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- src/remote/remote_daemon.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/remote/remote_daemon.c b/src/remote/remote_daemon.c index 54ddfc42a0..61eabe03be 100644 --- a/src/remote/remote_daemon.c +++ b/src/remote/remote_daemon.c @@ -312,6 +312,10 @@ static int daemonInitialize(void) if (virDriverLoadModule("interface", "interfaceRegister", false) < 0) return -1; #endif +#ifdef WITH_SECRETS + if (virDriverLoadModule("secret", "secretRegister", false) < 0) + return -1; +#endif #ifdef WITH_STORAGE if (virDriverLoadModule("storage", "storageRegister", false) < 0) return -1; @@ -320,10 +324,6 @@ static int daemonInitialize(void) if (virDriverLoadModule("nodedev", "nodedevRegister", false) < 0) return -1; #endif -#ifdef WITH_SECRETS - if (virDriverLoadModule("secret", "secretRegister", false) < 0) - return -1; -#endif #ifdef WITH_NWFILTER if (virDriverLoadModule("nwfilter", "nwfilterRegister", false) < 0) return -1; --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 8 05:58:01 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 155170814754950.07704452334792; Mon, 4 Mar 2019 06:02:27 -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 DB8AC307D869; Mon, 4 Mar 2019 14:02:25 +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 AA48E6013A; Mon, 4 Mar 2019 14:02:25 +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 65CBB3D387; Mon, 4 Mar 2019 14:02:25 +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 x24E2Nli000599 for ; Mon, 4 Mar 2019 09:02:23 -0500 Received: by smtp.corp.redhat.com (Postfix) id 9ECC01A8F1; Mon, 4 Mar 2019 14:02:23 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 219FD1A8EA for ; Mon, 4 Mar 2019 14:02:22 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Mon, 4 Mar 2019 15:02:11 +0100 Message-Id: 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 2/4] bhyve: Move autostarting of domains into bhyveStateInitialize 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.48]); Mon, 04 Mar 2019 14:02:26 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The stateAutoStart callback will go away shortly. Therefore, move the autostart call into state initialize callback. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- src/bhyve/bhyve_driver.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c index 3e192284cc..061888ab0b 100644 --- a/src/bhyve/bhyve_driver.c +++ b/src/bhyve/bhyve_driver.c @@ -1269,6 +1269,8 @@ bhyveStateInitialize(bool privileged, =20 virBhyveProcessReconnectAll(bhyve_driver); =20 + bhyveAutostartDomains(bhyve_driver); + return 0; =20 cleanup: @@ -1296,15 +1298,6 @@ bhyveDriverGetGrubCaps(virConnectPtr conn) return 0; } =20 -static void -bhyveStateAutoStart(void) -{ - if (!bhyve_driver) - return; - - bhyveAutostartDomains(bhyve_driver); -} - static int bhyveConnectGetMaxVcpus(virConnectPtr conn, const char *type) @@ -1712,7 +1705,6 @@ static virConnectDriver bhyveConnectDriver =3D { static virStateDriver bhyveStateDriver =3D { .name =3D "bhyve", .stateInitialize =3D bhyveStateInitialize, - .stateAutoStart =3D bhyveStateAutoStart, .stateCleanup =3D bhyveStateCleanup, }; =20 --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 8 05:58:01 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1551708149916874.161059021914; Mon, 4 Mar 2019 06:02:29 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2386C307D84D; Mon, 4 Mar 2019 14:02:28 +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 E88265D783; Mon, 4 Mar 2019 14:02:27 +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 A6A91181A135; Mon, 4 Mar 2019 14:02:27 +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 x24E2OM2000609 for ; Mon, 4 Mar 2019 09:02:24 -0500 Received: by smtp.corp.redhat.com (Postfix) id 777231A8EA; Mon, 4 Mar 2019 14:02:24 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id EEE5D2632A for ; Mon, 4 Mar 2019 14:02:23 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Mon, 4 Mar 2019 15:02:12 +0100 Message-Id: <1eab5410b7366075ab797ac9584a782035b31dc8.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 3/4] Revert "virStateDriver - Separate AutoStart from Initialize" 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Mon, 04 Mar 2019 14:02:28 +0000 (UTC) Content-Type: text/plain; charset="utf-8" https://bugzilla.redhat.com/show_bug.cgi?id=3D1685151 This reverts commit cefb97fb815c81fc882da752f45effd23bcb9b4b. The stateAutoStart callback will be removed in the next commit. Therefore move autostarting of domains, networks and storage pools back into stateInitialize callbacks. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- src/libxl/libxl_driver.c | 14 +++----------- src/lxc/lxc_driver.c | 28 ++++++++-------------------- src/network/bridge_driver.c | 22 ++++------------------ src/qemu/qemu_driver.c | 17 ++--------------- src/storage/storage_driver.c | 19 ++----------------- 5 files changed, 19 insertions(+), 81 deletions(-) diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 31b842aeee..a9edc8211d 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -779,6 +779,9 @@ libxlStateInitialize(bool privileged, NULL, NULL) < 0) goto error; =20 + virDomainObjListForEach(libxl_driver->domains, libxlAutostartDomain, + libxl_driver); + virDomainObjListForEach(libxl_driver->domains, libxlDomainManagedSaveL= oad, libxl_driver); =20 @@ -790,16 +793,6 @@ libxlStateInitialize(bool privileged, return -1; } =20 -static void -libxlStateAutoStart(void) -{ - if (!libxl_driver) - return; - - virDomainObjListForEach(libxl_driver->domains, libxlAutostartDomain, - libxl_driver); -} - static int libxlStateReload(void) { @@ -6611,7 +6604,6 @@ static virConnectDriver libxlConnectDriver =3D { static virStateDriver libxlStateDriver =3D { .name =3D "LIBXL", .stateInitialize =3D libxlStateInitialize, - .stateAutoStart =3D libxlStateAutoStart, .stateCleanup =3D libxlStateCleanup, .stateReload =3D libxlStateReload, }; diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 516a6b4de3..b1ef221c5c 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -1632,26 +1632,15 @@ static int lxcStateInitialize(bool privileged, NULL, NULL) < 0) goto cleanup; =20 - virObjectUnref(caps); - return 0; - - cleanup: - virObjectUnref(caps); - lxcStateCleanup(); - return -1; -} - -/** - * lxcStateAutoStart: - * - * Function to autostart the LXC daemons - */ -static void lxcStateAutoStart(void) -{ - if (!lxc_driver) - return; - virLXCProcessAutostartAll(lxc_driver); + + virObjectUnref(caps); + return 0; + + cleanup: + virObjectUnref(caps); + lxcStateCleanup(); + return -1; } =20 static void lxcNotifyLoadDomain(virDomainObjPtr vm, int newVM, void *opaqu= e) @@ -5502,7 +5491,6 @@ static virConnectDriver lxcConnectDriver =3D { static virStateDriver lxcStateDriver =3D { .name =3D LXC_DRIVER_NAME, .stateInitialize =3D lxcStateInitialize, - .stateAutoStart =3D lxcStateAutoStart, .stateCleanup =3D lxcStateCleanup, .stateReload =3D lxcStateReload, }; diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index b3ca5b8a15..c3e1381124 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -660,6 +660,10 @@ networkStateInitialize(bool privileged, networkReloadFirewallRules(network_driver, true); networkRefreshDaemons(network_driver); =20 + virNetworkObjListForEach(network_driver->networks, + networkAutostartConfig, + network_driver); + network_driver->networkEventState =3D virObjectEventStateNew(); =20 #ifdef WITH_FIREWALLD @@ -699,23 +703,6 @@ networkStateInitialize(bool privileged, } =20 =20 -/** - * networkStateAutoStart: - * - * Function to AutoStart the bridge configs - */ -static void -networkStateAutoStart(void) -{ - if (!network_driver) - return; - - virNetworkObjListForEach(network_driver->networks, - networkAutostartConfig, - network_driver); -} - - /** * networkStateReload: * @@ -5652,7 +5639,6 @@ static virConnectDriver networkConnectDriver =3D { static virStateDriver networkStateDriver =3D { .name =3D "bridge", .stateInitialize =3D networkStateInitialize, - .stateAutoStart =3D networkStateAutoStart, .stateCleanup =3D networkStateCleanup, .stateReload =3D networkStateReload, }; diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 36426cd65a..043cb817d2 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -914,6 +914,8 @@ qemuStateInitialize(bool privileged, =20 qemuProcessReconnectAll(qemu_driver); =20 + qemuAutostartDomains(qemu_driver); + return 0; =20 error: @@ -924,20 +926,6 @@ qemuStateInitialize(bool privileged, return -1; } =20 -/** - * qemuStateAutoStart: - * - * Function to auto start the QEMU daemons - */ -static void -qemuStateAutoStart(void) -{ - if (!qemu_driver) - return; - - qemuAutostartDomains(qemu_driver); -} - static void qemuNotifyLoadDomain(virDomainObjPtr vm, int newVM, void *opaq= ue) { virQEMUDriverPtr driver =3D opaque; @@ -22672,7 +22660,6 @@ static virConnectDriver qemuConnectDriver =3D { static virStateDriver qemuStateDriver =3D { .name =3D QEMU_DRIVER_NAME, .stateInitialize =3D qemuStateInitialize, - .stateAutoStart =3D qemuStateAutoStart, .stateCleanup =3D qemuStateCleanup, .stateReload =3D qemuStateReload, .stateStop =3D qemuStateStop, diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index 34634e97d9..98be434005 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -294,6 +294,8 @@ storageStateInitialize(bool privileged, =20 storagePoolUpdateAllState(); =20 + storageDriverAutostart(); + driver->storageEventState =3D virObjectEventStateNew(); =20 storageDriverUnlock(); @@ -306,22 +308,6 @@ storageStateInitialize(bool privileged, return -1; } =20 -/** - * storageStateAutoStart: - * - * Function to auto start the storage driver - */ -static void -storageStateAutoStart(void) -{ - if (!driver) - return; - - storageDriverLock(); - storageDriverAutostart(); - storageDriverUnlock(); -} - /** * storageStateReload: * @@ -2832,7 +2818,6 @@ static virConnectDriver storageConnectDriver =3D { static virStateDriver stateDriver =3D { .name =3D "storage", .stateInitialize =3D storageStateInitialize, - .stateAutoStart =3D storageStateAutoStart, .stateCleanup =3D storageStateCleanup, .stateReload =3D storageStateReload, }; --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 8 05:58:01 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 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