[RFC] Private data pointer for virStoragePool and virStorageVol structs

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

 



Ata Bohra proposed a backend concept for the ESX storage driver to
simplify the addition of iSCSI support to the ESX storage driver.

The problem here is that most of the storage driver functions need to
determine the backend to be used from the pool name.

This overhead can be avoided by adding a private data pointer to the
virStoragePool and virStorageVol structs that the ESX storage driver
can use to store a pointer to the correct backend.

struct _virStoragePool {
    virObject object;
    virConnectPtr conn;
    char *name;
    unsigned char uuid[VIR_UUID_BUFLEN];

    void *privateData;
    virFreeCallback privateDataFreeFunc;
};

struct _virStorageVol {
    virObject object;
    virConnectPtr conn;
    char *pool;
    char *name;
    char *key;

    void *privateData;
    virFreeCallback privateDataFreeFunc;
};

virGetStoragePool and virGetStorageVol would set privateData and
privateDataFreeFunc as given by the caller. virStoragePoolDispose and
virStorageVolDispose would call privateDataFreeFunc if set.

Comments?

-- 
Matthias Bolte
http://photron.blogspot.com

--
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]