mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 22:25:25 +00:00
conf: Introduce virDomainVideoDefClear helper
Future patches rely on the ability to reset the contents of the virDomainVideoDef structure rather than re-allocating it. Signed-off-by: Erik Skultety <eskultet@redhat.com> Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
3e90bd67a2
commit
f317b1e5c5
@ -2538,7 +2538,8 @@ virDomainVideoDefNew(void)
|
||||
}
|
||||
|
||||
|
||||
void virDomainVideoDefFree(virDomainVideoDefPtr def)
|
||||
void
|
||||
virDomainVideoDefClear(virDomainVideoDefPtr def)
|
||||
{
|
||||
if (!def)
|
||||
return;
|
||||
@ -2548,6 +2549,17 @@ void virDomainVideoDefFree(virDomainVideoDefPtr def)
|
||||
VIR_FREE(def->accel);
|
||||
VIR_FREE(def->virtio);
|
||||
VIR_FREE(def->driver);
|
||||
|
||||
memset(def, 0, sizeof(*def));
|
||||
}
|
||||
|
||||
|
||||
void virDomainVideoDefFree(virDomainVideoDefPtr def)
|
||||
{
|
||||
if (!def)
|
||||
return;
|
||||
|
||||
virDomainVideoDefClear(def);
|
||||
VIR_FREE(def);
|
||||
}
|
||||
|
||||
|
@ -2884,6 +2884,7 @@ void virDomainNVRAMDefFree(virDomainNVRAMDefPtr def);
|
||||
void virDomainWatchdogDefFree(virDomainWatchdogDefPtr def);
|
||||
virDomainVideoDefPtr virDomainVideoDefNew(void);
|
||||
void virDomainVideoDefFree(virDomainVideoDefPtr def);
|
||||
void virDomainVideoDefClear(virDomainVideoDefPtr def);
|
||||
virDomainHostdevDefPtr virDomainHostdevDefNew(void);
|
||||
void virDomainHostdevDefClear(virDomainHostdevDefPtr def);
|
||||
void virDomainHostdevDefFree(virDomainHostdevDefPtr def);
|
||||
|
@ -558,6 +558,7 @@ virDomainTPMModelTypeToString;
|
||||
virDomainUSBDeviceDefForeach;
|
||||
virDomainVideoDefaultRAM;
|
||||
virDomainVideoDefaultType;
|
||||
virDomainVideoDefClear;
|
||||
virDomainVideoDefFree;
|
||||
virDomainVideoDefNew;
|
||||
virDomainVideoTypeFromString;
|
||||
|
Loading…
Reference in New Issue
Block a user