From: Ján Tomko Date: Mon, 18 Feb 2013 11:50:46 +0000 (+0100) Subject: storage: move flag setting after declarations X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=41c73f66bc0c7b7a465e212ed6deb3017454f352;p=libvirt.git storage: move flag setting after declarations --- diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c index 87eca5ea20..295fd32b21 100644 --- a/src/storage/storage_backend.c +++ b/src/storage/storage_backend.c @@ -652,10 +652,6 @@ virStorageBackendCreateQemuImg(virConnectPtr conn, unsigned long long int size_arg; bool preallocate = false; - virCheckFlags(VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA, -1); - - preallocate = !!(flags & VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA); - const char *type = virStorageFileFormatTypeToString(vol->target.format); const char *backingType = vol->backingStore.path ? virStorageFileFormatTypeToString(vol->backingStore.format) : NULL; @@ -670,6 +666,10 @@ virStorageBackendCreateQemuImg(virConnectPtr conn, inputvol->target.format) : NULL; + virCheckFlags(VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA, NULL); + + preallocate = !!(flags & VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA); + if (type == NULL) { virReportError(VIR_ERR_INTERNAL_ERROR, _("unknown storage vol type %d"),