mirror of https://gitee.com/openkylin/libvirt.git
qemu: blockjob: Add reference to disk into struct qemuBlockJobData
Block jobs can also happen on objects which are not a disk at a given point (e.g. the frontend was not hotplugged yet) and thus will be eventually kept separately. Add a reference back to the disk for blockjobs which do correspond to a disk. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
addb82bc5f
commit
f877ec1020
|
@ -99,6 +99,7 @@ qemuBlockJobDataPtr
|
|||
qemuBlockJobDiskNew(virDomainDiskDefPtr disk)
|
||||
{
|
||||
qemuBlockJobDataPtr job = QEMU_DOMAIN_DISK_PRIVATE(disk)->blockjob;
|
||||
job->disk = disk;
|
||||
|
||||
qemuBlockJobDataReset(job);
|
||||
return virObjectRef(job);
|
||||
|
|
|
@ -32,6 +32,8 @@ typedef qemuBlockJobData *qemuBlockJobDataPtr;
|
|||
struct _qemuBlockJobData {
|
||||
virObject parent;
|
||||
|
||||
virDomainDiskDefPtr disk; /* may be NULL, if blockjob does not correspond to any disk */
|
||||
|
||||
bool started;
|
||||
int type;
|
||||
char *errmsg;
|
||||
|
|
Loading…
Reference in New Issue