mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 14:45:24 +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)
|
if (!def)
|
||||||
return;
|
return;
|
||||||
@ -2548,6 +2549,17 @@ void virDomainVideoDefFree(virDomainVideoDefPtr def)
|
|||||||
VIR_FREE(def->accel);
|
VIR_FREE(def->accel);
|
||||||
VIR_FREE(def->virtio);
|
VIR_FREE(def->virtio);
|
||||||
VIR_FREE(def->driver);
|
VIR_FREE(def->driver);
|
||||||
|
|
||||||
|
memset(def, 0, sizeof(*def));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void virDomainVideoDefFree(virDomainVideoDefPtr def)
|
||||||
|
{
|
||||||
|
if (!def)
|
||||||
|
return;
|
||||||
|
|
||||||
|
virDomainVideoDefClear(def);
|
||||||
VIR_FREE(def);
|
VIR_FREE(def);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2884,6 +2884,7 @@ void virDomainNVRAMDefFree(virDomainNVRAMDefPtr def);
|
|||||||
void virDomainWatchdogDefFree(virDomainWatchdogDefPtr def);
|
void virDomainWatchdogDefFree(virDomainWatchdogDefPtr def);
|
||||||
virDomainVideoDefPtr virDomainVideoDefNew(void);
|
virDomainVideoDefPtr virDomainVideoDefNew(void);
|
||||||
void virDomainVideoDefFree(virDomainVideoDefPtr def);
|
void virDomainVideoDefFree(virDomainVideoDefPtr def);
|
||||||
|
void virDomainVideoDefClear(virDomainVideoDefPtr def);
|
||||||
virDomainHostdevDefPtr virDomainHostdevDefNew(void);
|
virDomainHostdevDefPtr virDomainHostdevDefNew(void);
|
||||||
void virDomainHostdevDefClear(virDomainHostdevDefPtr def);
|
void virDomainHostdevDefClear(virDomainHostdevDefPtr def);
|
||||||
void virDomainHostdevDefFree(virDomainHostdevDefPtr def);
|
void virDomainHostdevDefFree(virDomainHostdevDefPtr def);
|
||||||
|
@ -558,6 +558,7 @@ virDomainTPMModelTypeToString;
|
|||||||
virDomainUSBDeviceDefForeach;
|
virDomainUSBDeviceDefForeach;
|
||||||
virDomainVideoDefaultRAM;
|
virDomainVideoDefaultRAM;
|
||||||
virDomainVideoDefaultType;
|
virDomainVideoDefaultType;
|
||||||
|
virDomainVideoDefClear;
|
||||||
virDomainVideoDefFree;
|
virDomainVideoDefFree;
|
||||||
virDomainVideoDefNew;
|
virDomainVideoDefNew;
|
||||||
virDomainVideoTypeFromString;
|
virDomainVideoTypeFromString;
|
||||||
|
Loading…
Reference in New Issue
Block a user