From: Richard Laager Date: Tue, 15 Mar 2016 06:17:33 +0000 (-0500) Subject: storage: Improve code consistency between backends X-Git-Tag: v1.3.3-rc1~120 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=98ee86e76c284c31bf3e06ec57b900984ca564a9;p=thirdparty%2Flibvirt.git storage: Improve code consistency between backends This improves the code consistency around freeing vol->target.path in createVol implementations. --- 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;