mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
qemuMigrationCookieXMLFormatStr: Remove
There is just one caller, inline the code. This also optimizes the code as we no longer have to calculate length of the output XML as it's actually stored in the buffer struct. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
2d155e2348
commit
5b32815d1a
@ -861,20 +861,6 @@ qemuMigrationCookieXMLFormat(virQEMUDriverPtr driver,
|
||||
}
|
||||
|
||||
|
||||
static char *
|
||||
qemuMigrationCookieXMLFormatStr(virQEMUDriverPtr driver,
|
||||
virQEMUCapsPtr qemuCaps,
|
||||
qemuMigrationCookiePtr mig)
|
||||
{
|
||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||
|
||||
if (qemuMigrationCookieXMLFormat(driver, qemuCaps, &buf, mig) < 0)
|
||||
return NULL;
|
||||
|
||||
return virBufferContentAndReset(&buf);
|
||||
}
|
||||
|
||||
|
||||
static qemuMigrationCookieGraphicsPtr
|
||||
qemuMigrationCookieGraphicsXMLParse(xmlXPathContextPtr ctxt)
|
||||
{
|
||||
@ -1397,6 +1383,7 @@ qemuMigrationCookieFormat(qemuMigrationCookiePtr mig,
|
||||
unsigned int flags)
|
||||
{
|
||||
qemuDomainObjPrivatePtr priv = dom->privateData;
|
||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||
|
||||
if (!cookieout || !cookieoutlen)
|
||||
return 0;
|
||||
@ -1441,10 +1428,11 @@ qemuMigrationCookieFormat(qemuMigrationCookiePtr mig,
|
||||
qemuMigrationCookieAddCaps(mig, dom, party) < 0)
|
||||
return -1;
|
||||
|
||||
if (!(*cookieout = qemuMigrationCookieXMLFormatStr(driver, priv->qemuCaps, mig)))
|
||||
if (qemuMigrationCookieXMLFormat(driver, priv->qemuCaps, &buf, mig) < 0)
|
||||
return -1;
|
||||
|
||||
*cookieoutlen = strlen(*cookieout) + 1;
|
||||
*cookieoutlen = virBufferUse(&buf) + 1;
|
||||
*cookieout = virBufferContentAndReset(&buf);
|
||||
|
||||
VIR_DEBUG("cookielen=%d cookie=%s", *cookieoutlen, *cookieout);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user