Re: [PATCH RFC 20/51] qemu: blockjob: Add reference to disk into struct qemuBlockJobData

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Dec 12, 2018 at 06:08:36PM +0100, Peter Krempa wrote:
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@xxxxxxxxxx>
---
src/qemu/qemu_blockjob.c | 1 +
src/qemu/qemu_blockjob.h | 2 ++
2 files changed, 3 insertions(+)

diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c
index 17657a9d9b..7bbe582722 100644
--- a/src/qemu/qemu_blockjob.c
+++ b/src/qemu/qemu_blockjob.c
@@ -99,6 +99,7 @@ qemuBlockJobDataPtr
qemuBlockJobDiskNew(virDomainDiskDefPtr disk)
{
    qemuBlockJobDataPtr job = QEMU_DOMAIN_DISK_PRIVATE(disk)->blockjob;
+    job->disk = disk;

    qemuBlockJobDataReset(job);
    return virObjectRef(job);
diff --git a/src/qemu/qemu_blockjob.h b/src/qemu/qemu_blockjob.h
index 3d1b389dec..feaee4dee3 100644
--- a/src/qemu/qemu_blockjob.h
+++ b/src/qemu/qemu_blockjob.h
@@ -32,6 +32,8 @@ typedef qemuBlockJobData *qemuBlockJobDataPtr;
struct _qemuBlockJobData {
    virObject parent;

+    virDomainDiskDefPtr disk; /* may be NULL, if blockjob does not corrspond to any disk */

correspond

+
    bool started;
    int type;
    char *errmsg;

Reviewed-by: Ján Tomko <jtomko@xxxxxxxxxx>

Jano

Attachment: signature.asc
Description: PGP signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux