[libvirt] [PATCH 07/10] storage: Implement ephemeral storage APIs for local disk volumes

Eric Blake eblake at redhat.com
Thu Jan 9 23:39:44 UTC 2014


On 01/09/2014 09:15 AM, Peter Krempa wrote:
> This patch implements the APIs for getting temporary storage pools for
> the local filesystem driver using storage_backend_fs.
> ---
>  src/check-aclrules.pl        |   3 +
>  src/storage/storage_driver.c | 253 +++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 256 insertions(+)
> 

> +    /* generate a unique name */
> +    do {
> +        if (pool) {
> +            virStoragePoolObjUnlock(pool);
> +            pool = NULL;
> +        }
> +
> +        storageEphemeralGenerateUniquePoolID(def);
> +
> +        if ((pool = virStoragePoolObjFindByUUID(&driver->pools, def->uuid)))
> +            continue;
> +
> +        pool = virStoragePoolObjFindByName(&driver->pools, def->name);
> +    } while (pool);

This avoids a collision with any existing pools, but what if we pick a
name that a later public API also picks - will the public API be
rejected, or will our internal pool be automatically upgraded to be
tagged as an existing pool?  (Not that generated UUIDs are likely to
collide, but you never know...)

> @@ -2632,6 +2881,10 @@ static virStorageDriver storageDriver = {
> 
>      .storagePoolIsActive = storagePoolIsActive, /* 0.7.3 */
>      .storagePoolIsPersistent = storagePoolIsPersistent, /* 0.7.3 */
> +
> +    .storageEphemeralFree = storageEphemeralFree, /* 1.2.1 */
> +    .storageEphemeralFromDiskDef = storageEphemeralFromDiskDef, /* 1.2.1 */
> +    .storageEphemeralFromSnapshotDiskDef = storageEphemeralFromSnapshotDiskDef, /* 1.2.1 */

1.2.2

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140109/bfa2f44c/attachment-0001.sig>


More information about the libvir-list mailing list