if (meta && meta->capacity)
target->capacity = meta->capacity;
- if (encryption && meta && meta->encrypted) {
- if (VIR_ALLOC(*encryption) < 0)
- goto cleanup;
+ if (encryption && meta && meta->encryption) {
+ *encryption = meta->encryption;
+ meta->encryption = NULL;
switch (target->format) {
case VIR_STORAGE_FILE_QCOW:
}
if (meta->capacity)
vol->target.capacity = meta->capacity;
- if (meta->encrypted) {
- if (VIR_ALLOC(vol->target.encryption) < 0)
- goto cleanup;
+ if (meta->encryption) {
+ vol->target.encryption = meta->encryption;
+ meta->encryption = NULL;
if (vol->target.format == VIR_STORAGE_FILE_QCOW ||
vol->target.format == VIR_STORAGE_FILE_QCOW2)
vol->target.encryption->format = VIR_STORAGE_ENCRYPTION_FORMAT_QCOW;
crypt_format = virReadBufInt32BE(buf +
fileTypeInfo[format].qcowCryptOffset);
- meta->encrypted = crypt_format != 0;
+ if (crypt_format && VIR_ALLOC(meta->encryption) < 0)
+ goto cleanup;
}
if (fileTypeInfo[format].getBackingStore != NULL) {
VIR_FREE(meta->compat);
VIR_FREE(meta->directory);
virBitmapFree(meta->features);
+ virStorageEncryptionFree(meta->encryption);
VIR_FREE(meta);
}
int backingStoreFormat; /* enum virStorageFileFormat */
bool backingStoreIsFile;
virStorageFileMetadataPtr backingMeta;
+
+ virStorageEncryptionPtr encryption;
unsigned long long capacity;
- bool encrypted;
virBitmapPtr features; /* bits described by enum virStorageFileFeature */
char *compat;
};
/*
- * Copyright (C) 2013 Red Hat, Inc.
+ * Copyright (C) 2013-2014 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
NULLSTR(elt->backingStoreRaw),
NULLSTR(elt->directory),
elt->backingStoreFormat, elt->backingStoreIsFile,
- elt->capacity, elt->encrypted) < 0) {
+ elt->capacity, !!elt->encryption) < 0) {
VIR_FREE(expect);
VIR_FREE(actual);
goto cleanup;