mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-27 18:03:50 +03:00
qemu: Use virDomainChrSourceDefNew for monConfig
Rather than VIR_ALLOC, use the New function for allocation. We already use the Free function anyway. Signed-off-by: John Ferlan <jferlan@redhat.com> Reviewed-by: Laine Stump <laine@laine.org> Reviewed-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
This commit is contained in:
parent
d6d8d7bb9a
commit
9e792d1aaa
@ -12211,7 +12211,7 @@ virDomainChrSourceDefParseXML(virDomainChrSourceDefPtr def,
|
||||
}
|
||||
|
||||
|
||||
static virDomainChrSourceDefPtr
|
||||
virDomainChrSourceDefPtr
|
||||
virDomainChrSourceDefNew(virDomainXMLOptionPtr xmlopt)
|
||||
{
|
||||
virDomainChrSourceDefPtr def = NULL;
|
||||
|
@ -2827,6 +2827,9 @@ bool virDomainDefHasDeviceAddress(virDomainDefPtr def,
|
||||
|
||||
void virDomainDefFree(virDomainDefPtr vm);
|
||||
|
||||
virDomainChrSourceDefPtr
|
||||
virDomainChrSourceDefNew(virDomainXMLOptionPtr xmlopt);
|
||||
|
||||
virDomainChrDefPtr virDomainChrDefNew(virDomainXMLOptionPtr xmlopt);
|
||||
|
||||
virDomainDefPtr virDomainDefNew(void);
|
||||
|
@ -218,6 +218,7 @@ virDomainChrSourceDefClear;
|
||||
virDomainChrSourceDefCopy;
|
||||
virDomainChrSourceDefFree;
|
||||
virDomainChrSourceDefGetPath;
|
||||
virDomainChrSourceDefNew;
|
||||
virDomainChrSpicevmcTypeFromString;
|
||||
virDomainChrSpicevmcTypeToString;
|
||||
virDomainChrTcpProtocolTypeFromString;
|
||||
|
@ -2422,7 +2422,7 @@ qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt,
|
||||
xmlNodePtr node = NULL;
|
||||
virQEMUCapsPtr qemuCaps = NULL;
|
||||
|
||||
if (VIR_ALLOC(priv->monConfig) < 0)
|
||||
if (!(priv->monConfig = virDomainChrSourceDefNew(NULL)))
|
||||
goto error;
|
||||
|
||||
if (!(monitorpath =
|
||||
|
@ -2484,7 +2484,7 @@ qemuParseCommandLine(virCapsPtr caps,
|
||||
if (monConfig) {
|
||||
virDomainChrSourceDefPtr chr;
|
||||
|
||||
if (VIR_ALLOC(chr) < 0)
|
||||
if (!(chr = virDomainChrSourceDefNew(NULL)))
|
||||
goto error;
|
||||
|
||||
if (qemuParseCommandLineChr(chr, val) < 0) {
|
||||
|
@ -5717,7 +5717,7 @@ qemuProcessPrepareDomain(virQEMUDriverPtr driver,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (VIR_ALLOC(priv->monConfig) < 0)
|
||||
if (!(priv->monConfig = virDomainChrSourceDefNew(NULL)))
|
||||
goto cleanup;
|
||||
|
||||
VIR_DEBUG("Preparing monitor state");
|
||||
|
Loading…
x
Reference in New Issue
Block a user