
On 08/18/2017 11:36 AM, Martin Kletzander wrote:
Partially-resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1443434
How so? Seeing as backing chains weren't mentioned in the bz. If I remove the changes from this patch, the new XML tests still pass (at least for me), so I'm curious at the relationship. Regardless, a bit more beef to the commit message would be nice.
Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- src/storage/storage_source.c | 5 ++++ .../qemuxml2argv-floppy-drive-noformat.args | 24 +++++++++++++++++ .../qemuxml2argv-floppy-drive-noformat.xml | 31 ++++++++++++++++++++++ tests/qemuxml2argvtest.c | 2 ++ 4 files changed, 62 insertions(+) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-floppy-drive-noformat.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-floppy-drive-noformat.xml
diff --git a/src/storage/storage_source.c b/src/storage/storage_source.c index b620153f1e5a..bbc5cc77be1a 100644 --- a/src/storage/storage_source.c +++ b/src/storage/storage_source.c @@ -527,11 +527,16 @@ virStorageFileGetMetadata(virStorageSourcePtr src, allow_probe, report_broken);
virHashTablePtr cycle = NULL; + virStorageType actualType = virStorageSourceGetActualType(src); int ret = -1;
if (!(cycle = virHashCreate(5, NULL))) return -1;
+ /* No backing chains for type='dir' */ + if (actualType == VIR_STORAGE_TYPE_DIR) + return 0; +
This would leak cycle Reviewed-by: John Ferlan <jferlan@redhat.com> With the obvious adjustment and commit message adjustment... John [...]