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

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



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

Attachment: signature.asc
Description: OpenPGP digital signature


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