Fix allocation of virDomainFSDef

Some less commonly used drivers were omitted when we switched
the allocator from a plain VIR_ALLOC to virDomainFSDefNew.

https://bugzilla.redhat.com/show_bug.cgi?id=1846450

Fixes: da665fbd4858890fbb3bbf5da2a7b6ca37bb3220
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
This commit is contained in:
Ján Tomko 2020-06-18 11:58:29 +02:00
parent f1d7852a43
commit ea33200488
2 changed files with 2 additions and 2 deletions

View File

@ -357,7 +357,7 @@ openvzReadFSConf(virDomainDefPtr def,
goto error;
}
if (VIR_ALLOC(fs) < 0)
if (!(fs = virDomainFSDefNew(NULL)))
goto error;
veid_str = g_strdup_printf("%d", veid);

View File

@ -3626,7 +3626,7 @@ vboxDumpSharedFolders(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine
char *hostPath = NULL;
PRBool writable = PR_FALSE;
if (VIR_ALLOC(def->fss[i]) < 0)
if (!(def->fss[i] = virDomainFSDefNew(data->xmlopt)))
goto cleanup;
def->fss[i]->type = VIR_DOMAIN_FS_TYPE_MOUNT;