diff mbox series

[15/30] storagefile: Fill in meta->externalDataStoreRaw

Message ID c40c62e6f763173fcc44df1f2b06bdc9a0d71c6f.1570482718.git.crobinso@redhat.com
State Accepted
Commit 556f7c68a0008b7467b306093eb106a10b7fca45
Headers show
Series storagefile, security: qcow2 data_file support | expand

Commit Message

Cole Robinson Oct. 7, 2019, 9:49 p.m. UTC
Call qcow2GetExtensions to actually fill in the virStorageSource
externalDataStoreRaw member

Signed-off-by: Cole Robinson <crobinso@redhat.com>

---
 src/util/virstoragefile.c | 6 ++++++
 1 file changed, 6 insertions(+)

-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Comments

Daniel Henrique Barboza Oct. 9, 2019, 9:54 p.m. UTC | #1
On 10/7/19 6:49 PM, Cole Robinson wrote:
> Call qcow2GetExtensions to actually fill in the virStorageSource

> externalDataStoreRaw member

>

> Signed-off-by: Cole Robinson <crobinso@redhat.com>

> ---


Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>



>   src/util/virstoragefile.c | 6 ++++++

>   1 file changed, 6 insertions(+)

>

> diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c

> index 7e32d7619e..53fe4590b4 100644

> --- a/src/util/virstoragefile.c

> +++ b/src/util/virstoragefile.c

> @@ -1060,6 +1060,12 @@ virStorageFileGetMetadataInternal(virStorageSourcePtr meta,

>           fileTypeInfo[meta->format].getFeatures(&meta->features, meta->format, buf, len) < 0)

>           return -1;

>   

> +    VIR_FREE(meta->externalDataStoreRaw);

> +    if (meta->format == VIR_STORAGE_FILE_QCOW2 &&

> +        qcow2GetExtensions(buf, len, NULL, &meta->externalDataStoreRaw) < 0) {

> +        return -1;

> +    }

> +

>       VIR_FREE(meta->compat);

>       if (meta->format == VIR_STORAGE_FILE_QCOW2 && meta->features &&

>           VIR_STRDUP(meta->compat, "1.1") < 0)


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
diff mbox series

Patch

diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index 7e32d7619e..53fe4590b4 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -1060,6 +1060,12 @@  virStorageFileGetMetadataInternal(virStorageSourcePtr meta,
         fileTypeInfo[meta->format].getFeatures(&meta->features, meta->format, buf, len) < 0)
         return -1;
 
+    VIR_FREE(meta->externalDataStoreRaw);
+    if (meta->format == VIR_STORAGE_FILE_QCOW2 &&
+        qcow2GetExtensions(buf, len, NULL, &meta->externalDataStoreRaw) < 0) {
+        return -1;
+    }
+
     VIR_FREE(meta->compat);
     if (meta->format == VIR_STORAGE_FILE_QCOW2 && meta->features &&
         VIR_STRDUP(meta->compat, "1.1") < 0)