mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-27 18:03:50 +03:00
util: Alter virCloseCallback typedef to return void
Since virCloseCallbacksRun was ignoring the value anyway, let's just change it to be a void function. Signed-off-by: John Ferlan <jferlan@redhat.com> Reviewed-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
This commit is contained in:
parent
67757b066c
commit
3f204e4de4
@ -53,7 +53,7 @@
|
||||
|
||||
VIR_LOG_INIT("bhyve.bhyve_process");
|
||||
|
||||
static virDomainObjPtr
|
||||
static void
|
||||
bhyveProcessAutoDestroy(virDomainObjPtr vm,
|
||||
virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
void *opaque)
|
||||
@ -62,12 +62,8 @@ bhyveProcessAutoDestroy(virDomainObjPtr vm,
|
||||
|
||||
virBhyveProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_DESTROYED);
|
||||
|
||||
if (!vm->persistent) {
|
||||
if (!vm->persistent)
|
||||
virDomainObjListRemove(driver->domains, vm);
|
||||
vm = NULL;
|
||||
}
|
||||
|
||||
return vm;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -59,7 +59,7 @@ VIR_LOG_INIT("lxc.lxc_process");
|
||||
|
||||
#define START_POSTFIX ": starting up\n"
|
||||
|
||||
static virDomainObjPtr
|
||||
static void
|
||||
lxcProcessAutoDestroy(virDomainObjPtr dom,
|
||||
virConnectPtr conn,
|
||||
void *opaque)
|
||||
@ -79,15 +79,11 @@ lxcProcessAutoDestroy(virDomainObjPtr dom,
|
||||
VIR_DOMAIN_EVENT_STOPPED_DESTROYED);
|
||||
priv->doneStopEvent = true;
|
||||
|
||||
if (!dom->persistent) {
|
||||
if (!dom->persistent)
|
||||
virDomainObjListRemove(driver->domains, dom);
|
||||
dom = NULL;
|
||||
}
|
||||
|
||||
if (event)
|
||||
virObjectEventStateQueue(driver->domainEventState, event);
|
||||
|
||||
return dom;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1954,7 +1954,7 @@ qemuMigrationDstRun(virQEMUDriverPtr driver,
|
||||
* qemuDomainMigrateBegin3 and qemuDomainMigratePerform3 or
|
||||
* qemuDomainMigratePerform3 and qemuDomainMigrateConfirm3.
|
||||
*/
|
||||
static virDomainObjPtr
|
||||
static void
|
||||
qemuMigrationSrcCleanup(virDomainObjPtr vm,
|
||||
virConnectPtr conn,
|
||||
void *opaque)
|
||||
@ -1969,7 +1969,7 @@ qemuMigrationSrcCleanup(virDomainObjPtr vm,
|
||||
priv->job.phase));
|
||||
|
||||
if (!qemuMigrationJobIsActive(vm, QEMU_ASYNC_JOB_MIGRATION_OUT))
|
||||
goto cleanup;
|
||||
return;
|
||||
|
||||
VIR_DEBUG("The connection which started outgoing migration of domain %s"
|
||||
" was closed; canceling the migration",
|
||||
@ -2005,9 +2005,6 @@ qemuMigrationSrcCleanup(virDomainObjPtr vm,
|
||||
/* unreachable */
|
||||
;
|
||||
}
|
||||
|
||||
cleanup:
|
||||
return vm;
|
||||
}
|
||||
|
||||
|
||||
|
@ -7046,7 +7046,7 @@ int qemuProcessAttach(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
}
|
||||
|
||||
|
||||
static virDomainObjPtr
|
||||
static void
|
||||
qemuProcessAutoDestroy(virDomainObjPtr dom,
|
||||
virConnectPtr conn,
|
||||
void *opaque)
|
||||
@ -7070,7 +7070,7 @@ qemuProcessAutoDestroy(virDomainObjPtr dom,
|
||||
VIR_DEBUG("Killing domain");
|
||||
|
||||
if (qemuProcessBeginStopJob(driver, dom, QEMU_JOB_DESTROY, true) < 0)
|
||||
goto cleanup;
|
||||
return;
|
||||
|
||||
qemuProcessStop(driver, dom, VIR_DOMAIN_SHUTOFF_DESTROYED,
|
||||
QEMU_ASYNC_JOB_NONE, stopFlags);
|
||||
@ -7085,9 +7085,6 @@ qemuProcessAutoDestroy(virDomainObjPtr dom,
|
||||
qemuDomainObjEndJob(driver, dom);
|
||||
|
||||
qemuDomainEventQueue(driver, event);
|
||||
|
||||
cleanup:
|
||||
return dom;
|
||||
}
|
||||
|
||||
int qemuProcessAutoDestroyAdd(virQEMUDriverPtr driver,
|
||||
|
@ -359,10 +359,9 @@ virCloseCallbacksRun(virCloseCallbacksPtr closeCallbacks,
|
||||
* we're about to call the callback function and we have another
|
||||
* ref anyway (so it cannot be deleted).
|
||||
*
|
||||
* Call the callback function, ignoring the return since it might be
|
||||
* NULL. Once we're done with the object, then end the API usage. */
|
||||
* Call the callback function and end the API usage. */
|
||||
virObjectUnref(vm);
|
||||
ignore_value(list->entries[i].callback(vm, conn, opaque));
|
||||
list->entries[i].callback(vm, conn, opaque);
|
||||
virDomainObjEndAPI(&vm);
|
||||
}
|
||||
VIR_FREE(list->entries);
|
||||
|
@ -30,9 +30,9 @@
|
||||
typedef struct _virCloseCallbacks virCloseCallbacks;
|
||||
typedef virCloseCallbacks *virCloseCallbacksPtr;
|
||||
|
||||
typedef virDomainObjPtr (*virCloseCallback)(virDomainObjPtr vm,
|
||||
virConnectPtr conn,
|
||||
void *opaque);
|
||||
typedef void (*virCloseCallback)(virDomainObjPtr vm,
|
||||
virConnectPtr conn,
|
||||
void *opaque);
|
||||
virCloseCallbacksPtr virCloseCallbacksNew(void);
|
||||
int virCloseCallbacksSet(virCloseCallbacksPtr closeCallbacks,
|
||||
virDomainObjPtr vm,
|
||||
|
Loading…
x
Reference in New Issue
Block a user