From 98ee86e76c284c31bf3e06ec57b900984ca564a9 Mon Sep 17 00:00:00 2001 From: Richard Laager Date: Tue, 15 Mar 2016 01:17:33 -0500 Subject: [PATCH] storage: Improve code consistency between backends This improves the code consistency around freeing vol->target.path in createVol implementations. --- src/storage/storage_backend_logical.c | 2 -- src/storage/storage_backend_zfs.c | 6 +----- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_backend_logical.c index ecbf430544..90a194ebc4 100644 --- a/src/storage/storage_backend_logical.c +++ b/src/storage/storage_backend_logical.c @@ -921,9 +921,7 @@ virStorageBackendLogicalCreateVol(virConnectPtr conn, vol->type = VIR_STORAGE_VOL_BLOCK; - /* A target path passed to CreateVol has no meaning */ VIR_FREE(vol->target.path); - if (virAsprintf(&vol->target.path, "%s/%s", pool->def->target.path, vol->name) == -1) diff --git a/src/storage/storage_backend_zfs.c b/src/storage/storage_backend_zfs.c index 2e6e40792c..4129aaeb6d 100644 --- a/src/storage/storage_backend_zfs.c +++ b/src/storage/storage_backend_zfs.c @@ -303,11 +303,7 @@ virStorageBackendZFSCreateVol(virConnectPtr conn ATTRIBUTE_UNUSED, vol->type = VIR_STORAGE_VOL_BLOCK; - if (vol->target.path != NULL) { - /* A target path passed to CreateVol has no meaning */ - VIR_FREE(vol->target.path); - } - + VIR_FREE(vol->target.path); if (virAsprintf(&vol->target.path, "%s/%s", pool->def->target.path, vol->name) == -1) return -1; -- GitLab