提交 359dc694 编写于 作者: P Peter Krempa

qemu: blockjob: Unexport qemuBlockJobEventProcess

The function is now only called locally. Some code movement was
necessary to avoid forward declarations.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 c3ec4b8d
......@@ -70,45 +70,6 @@ qemuBlockJobEmitEvents(virQEMUDriverPtr driver,
}
/**
* qemuBlockJobUpdate:
* @vm: domain
* @disk: domain disk
* @error: error (output parameter)
*
* Update disk's mirror state in response to a block job event stored in
* blockJobStatus by qemuProcessHandleBlockJob event handler.
*
* Returns the block job event processed or -1 if there was no pending event.
*/
int
qemuBlockJobUpdate(virDomainObjPtr vm,
qemuDomainAsyncJob asyncJob,
virDomainDiskDefPtr disk,
char **error)
{
qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk);
qemuDomainObjPrivatePtr priv = vm->privateData;
int status = diskPriv->blockJobStatus;
if (error)
*error = NULL;
if (status != -1) {
qemuBlockJobEventProcess(priv->driver, vm, disk, asyncJob,
diskPriv->blockJobType,
diskPriv->blockJobStatus);
diskPriv->blockJobStatus = -1;
if (error)
VIR_STEAL_PTR(*error, diskPriv->blockJobError);
else
VIR_FREE(diskPriv->blockJobError);
}
return status;
}
/**
* qemuBlockJobEventProcess:
* @driver: qemu driver
......@@ -121,7 +82,7 @@ qemuBlockJobUpdate(virDomainObjPtr vm,
* from QEMU. For mirror state's that must survive libvirt
* restart, also update the domain's status XML.
*/
void
static void
qemuBlockJobEventProcess(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainDiskDefPtr disk,
......@@ -236,6 +197,45 @@ qemuBlockJobEventProcess(virQEMUDriverPtr driver,
}
/**
* qemuBlockJobUpdate:
* @vm: domain
* @disk: domain disk
* @error: error (output parameter)
*
* Update disk's mirror state in response to a block job event stored in
* blockJobStatus by qemuProcessHandleBlockJob event handler.
*
* Returns the block job event processed or -1 if there was no pending event.
*/
int
qemuBlockJobUpdate(virDomainObjPtr vm,
qemuDomainAsyncJob asyncJob,
virDomainDiskDefPtr disk,
char **error)
{
qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk);
qemuDomainObjPrivatePtr priv = vm->privateData;
int status = diskPriv->blockJobStatus;
if (error)
*error = NULL;
if (status != -1) {
qemuBlockJobEventProcess(priv->driver, vm, disk, asyncJob,
diskPriv->blockJobType,
diskPriv->blockJobStatus);
diskPriv->blockJobStatus = -1;
if (error)
VIR_STEAL_PTR(*error, diskPriv->blockJobError);
else
VIR_FREE(diskPriv->blockJobError);
}
return status;
}
/**
* qemuBlockJobSyncBegin:
* @disk: domain disk
......
......@@ -30,12 +30,6 @@ int qemuBlockJobUpdate(virDomainObjPtr vm,
qemuDomainAsyncJob asyncJob,
virDomainDiskDefPtr disk,
char **error);
void qemuBlockJobEventProcess(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainDiskDefPtr disk,
qemuDomainAsyncJob asyncJob,
int type,
int status);
void qemuBlockJobSyncBegin(virDomainDiskDefPtr disk);
void qemuBlockJobSyncEnd(virDomainObjPtr vm,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册