mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 11:31:16 +00: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)
|
virDomainChrSourceDefNew(virDomainXMLOptionPtr xmlopt)
|
||||||
{
|
{
|
||||||
virDomainChrSourceDefPtr def = NULL;
|
virDomainChrSourceDefPtr def = NULL;
|
||||||
|
@ -2827,6 +2827,9 @@ bool virDomainDefHasDeviceAddress(virDomainDefPtr def,
|
|||||||
|
|
||||||
void virDomainDefFree(virDomainDefPtr vm);
|
void virDomainDefFree(virDomainDefPtr vm);
|
||||||
|
|
||||||
|
virDomainChrSourceDefPtr
|
||||||
|
virDomainChrSourceDefNew(virDomainXMLOptionPtr xmlopt);
|
||||||
|
|
||||||
virDomainChrDefPtr virDomainChrDefNew(virDomainXMLOptionPtr xmlopt);
|
virDomainChrDefPtr virDomainChrDefNew(virDomainXMLOptionPtr xmlopt);
|
||||||
|
|
||||||
virDomainDefPtr virDomainDefNew(void);
|
virDomainDefPtr virDomainDefNew(void);
|
||||||
|
@ -218,6 +218,7 @@ virDomainChrSourceDefClear;
|
|||||||
virDomainChrSourceDefCopy;
|
virDomainChrSourceDefCopy;
|
||||||
virDomainChrSourceDefFree;
|
virDomainChrSourceDefFree;
|
||||||
virDomainChrSourceDefGetPath;
|
virDomainChrSourceDefGetPath;
|
||||||
|
virDomainChrSourceDefNew;
|
||||||
virDomainChrSpicevmcTypeFromString;
|
virDomainChrSpicevmcTypeFromString;
|
||||||
virDomainChrSpicevmcTypeToString;
|
virDomainChrSpicevmcTypeToString;
|
||||||
virDomainChrTcpProtocolTypeFromString;
|
virDomainChrTcpProtocolTypeFromString;
|
||||||
|
@ -2422,7 +2422,7 @@ qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt,
|
|||||||
xmlNodePtr node = NULL;
|
xmlNodePtr node = NULL;
|
||||||
virQEMUCapsPtr qemuCaps = NULL;
|
virQEMUCapsPtr qemuCaps = NULL;
|
||||||
|
|
||||||
if (VIR_ALLOC(priv->monConfig) < 0)
|
if (!(priv->monConfig = virDomainChrSourceDefNew(NULL)))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (!(monitorpath =
|
if (!(monitorpath =
|
||||||
|
@ -2484,7 +2484,7 @@ qemuParseCommandLine(virCapsPtr caps,
|
|||||||
if (monConfig) {
|
if (monConfig) {
|
||||||
virDomainChrSourceDefPtr chr;
|
virDomainChrSourceDefPtr chr;
|
||||||
|
|
||||||
if (VIR_ALLOC(chr) < 0)
|
if (!(chr = virDomainChrSourceDefNew(NULL)))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (qemuParseCommandLineChr(chr, val) < 0) {
|
if (qemuParseCommandLineChr(chr, val) < 0) {
|
||||||
|
@ -5717,7 +5717,7 @@ qemuProcessPrepareDomain(virQEMUDriverPtr driver,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (VIR_ALLOC(priv->monConfig) < 0)
|
if (!(priv->monConfig = virDomainChrSourceDefNew(NULL)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
VIR_DEBUG("Preparing monitor state");
|
VIR_DEBUG("Preparing monitor state");
|
||||||
|
Loading…
Reference in New Issue
Block a user