mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 09:17:52 +03:00
qemu: domain: Introduce helper for always fetching virStorageSource private data
Add a helper which will always return the storage source private data even if it was not allocated before. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
852ee1950a
commit
47be725719
@ -570,6 +570,16 @@ qemuDomainStorageSourcePrivateDispose(void *obj)
|
||||
}
|
||||
|
||||
|
||||
qemuDomainStorageSourcePrivatePtr
|
||||
qemuDomainStorageSourcePrivateFetch(virStorageSourcePtr src)
|
||||
{
|
||||
if (!src->privateData)
|
||||
src->privateData = qemuDomainStorageSourcePrivateNew();
|
||||
|
||||
return QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src);
|
||||
}
|
||||
|
||||
|
||||
static virClassPtr qemuDomainVcpuPrivateClass;
|
||||
static void qemuDomainVcpuPrivateDispose(void *obj);
|
||||
|
||||
|
@ -320,6 +320,8 @@ struct _qemuDomainStorageSourcePrivate {
|
||||
};
|
||||
|
||||
virObjectPtr qemuDomainStorageSourcePrivateNew(void);
|
||||
qemuDomainStorageSourcePrivatePtr
|
||||
qemuDomainStorageSourcePrivateFetch(virStorageSourcePtr src);
|
||||
|
||||
typedef struct _qemuDomainVcpuPrivate qemuDomainVcpuPrivate;
|
||||
typedef qemuDomainVcpuPrivate *qemuDomainVcpuPrivatePtr;
|
||||
|
Loading…
Reference in New Issue
Block a user