diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c index 9dbb299b1083fd8989d7221b5cdb02b1303289e6..f1ed510384b4342e360c99ec5da8a8e83f823a8a 100644 --- a/src/bhyve/bhyve_driver.c +++ b/src/bhyve/bhyve_driver.c @@ -715,7 +715,9 @@ static virStateDriver bhyveStateDriver = { int bhyveRegister(void) { - virRegisterDriver(&bhyveDriver); - virRegisterStateDriver(&bhyveStateDriver); + if (virRegisterDriver(&bhyveDriver) < 0) + return -1; + if (virRegisterStateDriver(&bhyveStateDriver) < 0) + return -1; return 0; } diff --git a/src/interface/interface_backend_netcf.c b/src/interface/interface_backend_netcf.c index b4c1fe924097cc25008a17976a91e38d45d92d78..98ce83b78ec0489421be9b79b324f3e99f74b3e4 100644 --- a/src/interface/interface_backend_netcf.c +++ b/src/interface/interface_backend_netcf.c @@ -1194,6 +1194,7 @@ int netcfIfaceRegister(void) { _("failed to register netcf interface driver")); return -1; } - virRegisterStateDriver(&interfaceStateDriver); + if (virRegisterStateDriver(&interfaceStateDriver) < 0) + return -1; return 0; } diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 0ab1ba2f39ae35b93aa5f0f17d159680d037b8e6..27c27d848564a2646d8bc7a00f0a515ad730c82e 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -5767,7 +5767,9 @@ static virStateDriver lxcStateDriver = { int lxcRegister(void) { - virRegisterDriver(&lxcDriver); - virRegisterStateDriver(&lxcStateDriver); + if (virRegisterDriver(&lxcDriver) < 0) + return -1; + if (virRegisterStateDriver(&lxcStateDriver) < 0) + return -1; return 0; } diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index c797f8fd12e33031e304bef43c085feee5a3efc2..181541e5c272b3ef0c1ad8aa1497a2b2bd3268b5 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -3232,7 +3232,8 @@ static virStateDriver networkStateDriver = { int networkRegister(void) { if (virRegisterNetworkDriver(&networkDriver) < 0) return -1; - virRegisterStateDriver(&networkStateDriver); + if (virRegisterStateDriver(&networkStateDriver) < 0) + return -1; return 0; } diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c index 2e89d07b64127d936e32267d2e6bb3a732209873..228794de772afc2b7f761f485939f5b9220cedf3 100644 --- a/src/nwfilter/nwfilter_driver.c +++ b/src/nwfilter/nwfilter_driver.c @@ -716,8 +716,11 @@ static virDomainConfNWFilterDriver domainNWFilterDriver = { int nwfilterRegister(void) { - virRegisterNWFilterDriver(&nwfilterDriver); - virRegisterStateDriver(&stateDriver); - virDomainConfNWFilterRegister(&domainNWFilterDriver); + if (virRegisterNWFilterDriver(&nwfilterDriver) < 0) + return -1; + if (virRegisterStateDriver(&stateDriver) < 0) + return -1; + if (virDomainConfNWFilterRegister(&domainNWFilterDriver) < 0) + return -1; return 0; } diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 89f443f5fe180f39c7e164cf79c7bba94a204ff6..fc382a5ec180a5e8f873921ef2232d48419de886 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -16796,7 +16796,9 @@ static virStateDriver qemuStateDriver = { }; int qemuRegister(void) { - virRegisterDriver(&qemuDriver); - virRegisterStateDriver(&qemuStateDriver); + if (virRegisterDriver(&qemuDriver) < 0) + return -1; + if (virRegisterStateDriver(&qemuStateDriver) < 0) + return -1; return 0; } diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 955465a911505acad3889ee286bb49d4d4eb1118..c9711bbd1c3d956892ba7291c35128ca2456b5d6 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -7825,15 +7825,23 @@ remoteRegister(void) { remoteDriver = &remote_driver; - if (virRegisterDriver(&remote_driver) == -1) return -1; - if (virRegisterNetworkDriver(&network_driver) == -1) return -1; - if (virRegisterInterfaceDriver(&interface_driver) == -1) return -1; - if (virRegisterStorageDriver(&storage_driver) == -1) return -1; - if (virRegisterNodeDeviceDriver(&node_device_driver) == -1) return -1; - if (virRegisterSecretDriver(&secret_driver) == -1) return -1; - if (virRegisterNWFilterDriver(&nwfilter_driver) == -1) return -1; + if (virRegisterDriver(&remote_driver) < 0) + return -1; + if (virRegisterNetworkDriver(&network_driver) < 0) + return -1; + if (virRegisterInterfaceDriver(&interface_driver) < 0) + return -1; + if (virRegisterStorageDriver(&storage_driver) < 0) + return -1; + if (virRegisterNodeDeviceDriver(&node_device_driver) < 0) + return -1; + if (virRegisterSecretDriver(&secret_driver) < 0) + return -1; + if (virRegisterNWFilterDriver(&nwfilter_driver) < 0) + return -1; #ifdef WITH_LIBVIRTD - if (virRegisterStateDriver(&state_driver) == -1) return -1; + if (virRegisterStateDriver(&state_driver) == -1) < 0) + return -1; #endif return 0; diff --git a/src/secret/secret_driver.c b/src/secret/secret_driver.c index 9f7f94657d3030b81052c947a6481326a098f585..5cb6391039741b2fa07ee756c9a5daacd074b233 100644 --- a/src/secret/secret_driver.c +++ b/src/secret/secret_driver.c @@ -1194,7 +1194,9 @@ static virStateDriver stateDriver = { int secretRegister(void) { - virRegisterSecretDriver(&secretDriver); - virRegisterStateDriver(&stateDriver); + if (virRegisterSecretDriver(&secretDriver) < 0) + return -1; + if (virRegisterStateDriver(&stateDriver) < 0) + return -1; return 0; } diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index 7dbff6ce25d3304c962ec3774af4b942284e287b..466ceba127cef9a9dbb5521bdf0143d715ee529b 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -2696,7 +2696,8 @@ int storageRegister(void) { if (virRegisterStorageDriver(&storageDriver) < 0) return -1; - virRegisterStateDriver(&stateDriver); + if (virRegisterStateDriver(&stateDriver) < 0) + return -1; return 0; } diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c index 3496e52e5657e44808c9bb94b78b17051952d57d..8ddf181be47a91bb0236d2684b156d4177e69445 100644 --- a/src/uml/uml_driver.c +++ b/src/uml/uml_driver.c @@ -2909,7 +2909,9 @@ static virStateDriver umlStateDriver = { }; int umlRegister(void) { - virRegisterDriver(¨Driver); - virRegisterStateDriver(¨StateDriver); + if (virRegisterDriver(¨Driver) < 0) + return -1; + if (virRegisterStateDriver(¨StateDriver) < 0) + return -1; return 0; }