mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
conf: eliminate unnecessary labels
Signed-off-by: Laine Stump <laine@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
ac59ecc9f8
commit
cf01360489
@ -1340,7 +1340,7 @@ virCapabilitiesFormatXML(virCapsPtr caps)
|
||||
virBufferAdjustIndent(&buf, 2);
|
||||
|
||||
if (virCapabilitiesFormatHostXML(&caps->host, &buf) < 0)
|
||||
goto error;
|
||||
return NULL;
|
||||
|
||||
virCapabilitiesFormatGuestXML(caps->guests, caps->nguests, &buf);
|
||||
|
||||
@ -1350,9 +1350,6 @@ virCapabilitiesFormatXML(virCapsPtr caps)
|
||||
virBufferAddLit(&buf, "</capabilities>\n");
|
||||
|
||||
return virBufferContentAndReset(&buf);
|
||||
|
||||
error:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* get the maximum ID of cpus in the host */
|
||||
|
@ -476,7 +476,7 @@ virDomainCheckpointDefFormatInternal(virBufferPtr buf,
|
||||
for (i = 0; i < def->ndisks; i++) {
|
||||
if (virDomainCheckpointDiskDefFormat(buf, &def->disks[i],
|
||||
flags) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
}
|
||||
virBufferAdjustIndent(buf, -2);
|
||||
virBufferAddLit(buf, "</disks>\n");
|
||||
@ -485,17 +485,15 @@ virDomainCheckpointDefFormatInternal(virBufferPtr buf,
|
||||
if (!(flags & VIR_DOMAIN_CHECKPOINT_FORMAT_NO_DOMAIN) &&
|
||||
virDomainDefFormatInternal(def->parent.dom, xmlopt,
|
||||
buf, domainflags) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
|
||||
virBufferAdjustIndent(buf, -2);
|
||||
virBufferAddLit(buf, "</domaincheckpoint>\n");
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
char *
|
||||
virDomainCheckpointDefFormat(virDomainCheckpointDefPtr def,
|
||||
virDomainXMLOptionPtr xmlopt,
|
||||
|
@ -671,12 +671,9 @@ virCPUDefFormat(virCPUDefPtr def,
|
||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||
|
||||
if (virCPUDefFormatBufFull(&buf, def, numa) < 0)
|
||||
goto cleanup;
|
||||
return NULL;
|
||||
|
||||
return virBufferContentAndReset(&buf);
|
||||
|
||||
cleanup:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@ -685,7 +682,6 @@ virCPUDefFormatBufFull(virBufferPtr buf,
|
||||
virCPUDefPtr def,
|
||||
virDomainNumaPtr numa)
|
||||
{
|
||||
int ret = -1;
|
||||
g_auto(virBuffer) attributeBuf = VIR_BUFFER_INITIALIZER;
|
||||
g_auto(virBuffer) childrenBuf = VIR_BUFFER_INIT_CHILD(buf);
|
||||
|
||||
@ -701,7 +697,7 @@ virCPUDefFormatBufFull(virBufferPtr buf,
|
||||
if (!(tmp = virCPUModeTypeToString(def->mode))) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Unexpected CPU mode %d"), def->mode);
|
||||
goto cleanup;
|
||||
return -1;
|
||||
}
|
||||
virBufferAsprintf(&attributeBuf, " mode='%s'", tmp);
|
||||
|
||||
@ -710,7 +706,7 @@ virCPUDefFormatBufFull(virBufferPtr buf,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Unexpected CPU match policy %d"),
|
||||
def->match);
|
||||
goto cleanup;
|
||||
return -1;
|
||||
}
|
||||
virBufferAsprintf(&attributeBuf, " match='%s'", tmp);
|
||||
}
|
||||
@ -731,10 +727,10 @@ virCPUDefFormatBufFull(virBufferPtr buf,
|
||||
virBufferAsprintf(&childrenBuf, "<arch>%s</arch>\n",
|
||||
virArchToString(def->arch));
|
||||
if (virCPUDefFormatBuf(&childrenBuf, def) < 0)
|
||||
goto cleanup;
|
||||
return -1;
|
||||
|
||||
if (virDomainNumaDefFormatXML(&childrenBuf, numa) < 0)
|
||||
goto cleanup;
|
||||
return -1;
|
||||
|
||||
/* Put it all together */
|
||||
if (virBufferUse(&attributeBuf) || virBufferUse(&childrenBuf)) {
|
||||
@ -752,9 +748,7 @@ virCPUDefFormatBufFull(virBufferPtr buf,
|
||||
}
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
cleanup:
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -29475,7 +29475,7 @@ virDomainDefFormatInternalSetRootName(virDomainDefPtr def,
|
||||
if (!(type = virDomainVirtTypeToString(def->virtType))) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unexpected domain type %d"), def->virtType);
|
||||
goto error;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (def->id == -1)
|
||||
@ -29520,13 +29520,13 @@ virDomainDefFormatInternalSetRootName(virDomainDefPtr def,
|
||||
xmlIndentTreeOutput = 1;
|
||||
if (!(xmlbuf = xmlBufferCreate())) {
|
||||
virReportOOMError();
|
||||
goto error;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (xmlNodeDump(xmlbuf, def->metadata->doc, def->metadata,
|
||||
virBufferGetIndent(buf) / 2, 1) < 0) {
|
||||
xmlIndentTreeOutput = oldIndentTreeOutput;
|
||||
goto error;
|
||||
return -1;
|
||||
}
|
||||
virBufferAsprintf(buf, "%s\n", (char *) xmlBufferContent(xmlbuf));
|
||||
xmlIndentTreeOutput = oldIndentTreeOutput;
|
||||
@ -29549,13 +29549,13 @@ virDomainDefFormatInternalSetRootName(virDomainDefPtr def,
|
||||
def->mem.cur_balloon);
|
||||
|
||||
if (virDomainDefFormatBlkiotune(buf, def) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
|
||||
virDomainMemtuneFormat(buf, &def->mem);
|
||||
virDomainMemorybackingFormat(buf, &def->mem);
|
||||
|
||||
if (virDomainCpuDefFormat(buf, def) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
|
||||
if (def->niothreadids > 0) {
|
||||
virBufferAsprintf(buf, "<iothreads>%zu</iothreads>\n",
|
||||
@ -29573,17 +29573,17 @@ virDomainDefFormatInternalSetRootName(virDomainDefPtr def,
|
||||
}
|
||||
|
||||
if (virDomainCputuneDefFormat(buf, def, flags) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
|
||||
if (virDomainNumatuneFormatXML(buf, def->numa) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
|
||||
if (def->resource)
|
||||
virDomainResourceDefFormat(buf, def->resource);
|
||||
|
||||
for (i = 0; i < def->nsysinfo; i++) {
|
||||
if (virSysinfoFormat(buf, def->sysinfo[i]) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (def->os.bootloader) {
|
||||
@ -29663,7 +29663,7 @@ virDomainDefFormatInternalSetRootName(virDomainDefPtr def,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unexpected boot device type %d"),
|
||||
def->os.bootDevs[n]);
|
||||
goto error;
|
||||
return -1;
|
||||
}
|
||||
virBufferAsprintf(buf, "<boot dev='%s'/>\n", boottype);
|
||||
}
|
||||
@ -29695,7 +29695,7 @@ virDomainDefFormatInternalSetRootName(virDomainDefPtr def,
|
||||
if (mode == NULL) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("unexpected smbios mode %d"), def->os.smbios_mode);
|
||||
goto error;
|
||||
return -1;
|
||||
}
|
||||
virBufferAsprintf(buf, "<smbios mode='%s'/>\n", mode);
|
||||
}
|
||||
@ -29726,10 +29726,10 @@ virDomainDefFormatInternalSetRootName(virDomainDefPtr def,
|
||||
}
|
||||
|
||||
if (virDomainDefFormatFeatures(buf, def) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
|
||||
if (virCPUDefFormatBufFull(buf, def->cpu, def->numa) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
|
||||
virBufferAsprintf(buf, "<clock offset='%s'",
|
||||
virDomainClockOffsetTypeToString(def->clock.offset));
|
||||
@ -29760,7 +29760,7 @@ virDomainDefFormatInternalSetRootName(virDomainDefPtr def,
|
||||
virBufferAdjustIndent(buf, 2);
|
||||
for (n = 0; n < def->clock.ntimers; n++) {
|
||||
if (virDomainTimerDefFormat(buf, def->clock.timers[n]) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
}
|
||||
virBufferAdjustIndent(buf, -2);
|
||||
virBufferAddLit(buf, "</clock>\n");
|
||||
@ -29769,20 +29769,20 @@ virDomainDefFormatInternalSetRootName(virDomainDefPtr def,
|
||||
if (virDomainEventActionDefFormat(buf, def->onPoweroff,
|
||||
"on_poweroff",
|
||||
virDomainLifecycleActionTypeToString) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
if (virDomainEventActionDefFormat(buf, def->onReboot,
|
||||
"on_reboot",
|
||||
virDomainLifecycleActionTypeToString) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
if (virDomainEventActionDefFormat(buf, def->onCrash,
|
||||
"on_crash",
|
||||
virDomainLifecycleActionTypeToString) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
if (def->onLockFailure != VIR_DOMAIN_LOCK_FAILURE_DEFAULT &&
|
||||
virDomainEventActionDefFormat(buf, def->onLockFailure,
|
||||
"on_lockfailure",
|
||||
virDomainLockFailureTypeToString) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
|
||||
if (def->pm.s3 || def->pm.s4) {
|
||||
virBufferAddLit(buf, "<pm>\n");
|
||||
@ -29809,35 +29809,35 @@ virDomainDefFormatInternalSetRootName(virDomainDefPtr def,
|
||||
|
||||
for (n = 0; n < def->ndisks; n++)
|
||||
if (virDomainDiskDefFormat(buf, def->disks[n], flags, xmlopt) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
|
||||
for (n = 0; n < def->ncontrollers; n++)
|
||||
if (virDomainControllerDefFormat(buf, def->controllers[n], flags) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
|
||||
for (n = 0; n < def->nleases; n++)
|
||||
if (virDomainLeaseDefFormat(buf, def->leases[n]) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
|
||||
for (n = 0; n < def->nfss; n++)
|
||||
if (virDomainFSDefFormat(buf, def->fss[n], flags) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
|
||||
for (n = 0; n < def->nnets; n++)
|
||||
if (virDomainNetDefFormat(buf, def->nets[n], xmlopt, flags) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
|
||||
for (n = 0; n < def->nsmartcards; n++)
|
||||
if (virDomainSmartcardDefFormat(buf, def->smartcards[n], flags) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
|
||||
for (n = 0; n < def->nserials; n++)
|
||||
if (virDomainChrDefFormat(buf, def->serials[n], flags) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
|
||||
for (n = 0; n < def->nparallels; n++)
|
||||
if (virDomainChrDefFormat(buf, def->parallels[n], flags) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
|
||||
for (n = 0; n < def->nconsoles; n++) {
|
||||
virDomainChrDef console;
|
||||
@ -29855,36 +29855,36 @@ virDomainDefFormatInternalSetRootName(virDomainDefPtr def,
|
||||
memcpy(&console, def->consoles[n], sizeof(console));
|
||||
}
|
||||
if (virDomainChrDefFormat(buf, &console, flags) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (n = 0; n < def->nchannels; n++)
|
||||
if (virDomainChrDefFormat(buf, def->channels[n], flags) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
|
||||
for (n = 0; n < def->ninputs; n++) {
|
||||
if (virDomainInputDefFormat(buf, def->inputs[n], flags) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (n = 0; n < def->ntpms; n++) {
|
||||
if (virDomainTPMDefFormat(buf, def->tpms[n], flags) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (n = 0; n < def->ngraphics; n++) {
|
||||
if (virDomainGraphicsDefFormat(buf, def->graphics[n], flags) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (n = 0; n < def->nsounds; n++) {
|
||||
if (virDomainSoundDefFormat(buf, def->sounds[n], flags) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (n = 0; n < def->nvideos; n++) {
|
||||
if (virDomainVideoDefFormat(buf, def->videos[n], flags) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (n = 0; n < def->nhostdevs; n++) {
|
||||
@ -29894,13 +29894,13 @@ virDomainDefFormatInternalSetRootName(virDomainDefPtr def,
|
||||
*/
|
||||
if (!def->hostdevs[n]->parentnet &&
|
||||
virDomainHostdevDefFormat(buf, def->hostdevs[n], flags) < 0) {
|
||||
goto error;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
for (n = 0; n < def->nredirdevs; n++) {
|
||||
if (virDomainRedirdevDefFormat(buf, def->redirdevs[n], flags) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (def->redirfilter)
|
||||
@ -29908,7 +29908,7 @@ virDomainDefFormatInternalSetRootName(virDomainDefPtr def,
|
||||
|
||||
for (n = 0; n < def->nhubs; n++) {
|
||||
if (virDomainHubDefFormat(buf, def->hubs[n], flags) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (def->watchdog)
|
||||
@ -29919,7 +29919,7 @@ virDomainDefFormatInternalSetRootName(virDomainDefPtr def,
|
||||
|
||||
for (n = 0; n < def->nrngs; n++) {
|
||||
if (virDomainRNGDefFormat(buf, def->rngs[n], flags))
|
||||
goto error;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (def->nvram)
|
||||
@ -29927,26 +29927,26 @@ virDomainDefFormatInternalSetRootName(virDomainDefPtr def,
|
||||
|
||||
for (n = 0; n < def->npanics; n++) {
|
||||
if (virDomainPanicDefFormat(buf, def->panics[n]) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (n = 0; n < def->nshmems; n++) {
|
||||
if (virDomainShmemDefFormat(buf, def->shmems[n], flags) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (n = 0; n < def->nmems; n++) {
|
||||
if (virDomainMemoryDefFormat(buf, def->mems[n], def, flags) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (def->iommu &&
|
||||
virDomainIOMMUDefFormat(buf, def->iommu) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
|
||||
if (def->vsock &&
|
||||
virDomainVsockDefFormat(buf, def->vsock) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
|
||||
virBufferAdjustIndent(buf, -2);
|
||||
virBufferAddLit(buf, "</devices>\n");
|
||||
@ -29961,18 +29961,16 @@ virDomainDefFormatInternalSetRootName(virDomainDefPtr def,
|
||||
|
||||
if (def->namespaceData && def->ns.format) {
|
||||
if ((def->ns.format)(buf, def->namespaceData) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
}
|
||||
|
||||
virBufferAdjustIndent(buf, -2);
|
||||
virBufferAsprintf(buf, "</%s>\n", rootname);
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/* Converts VIR_DOMAIN_XML_COMMON_FLAGS into VIR_DOMAIN_DEF_FORMAT_*
|
||||
* flags, and silently ignores any other flags. Note that the caller
|
||||
* should validate the set of flags it is willing to accept; see also
|
||||
|
@ -2721,12 +2721,9 @@ virNetworkDefFormat(const virNetworkDef *def,
|
||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||
|
||||
if (virNetworkDefFormatBuf(&buf, def, xmlopt, flags) < 0)
|
||||
goto error;
|
||||
return NULL;
|
||||
|
||||
return virBufferContentAndReset(&buf);
|
||||
|
||||
error:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
@ -3062,16 +3062,13 @@ virNWFilterDefFormat(const virNWFilterDef *def)
|
||||
|
||||
for (i = 0; i < def->nentries; i++) {
|
||||
if (virNWFilterEntryFormat(&buf, def->filterEntries[i]) < 0)
|
||||
goto err_exit;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
virBufferAdjustIndent(&buf, -2);
|
||||
virBufferAddLit(&buf, "</filter>\n");
|
||||
|
||||
return virBufferContentAndReset(&buf);
|
||||
|
||||
err_exit:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static virNWFilterTriggerRebuildCallback rebuildCallback;
|
||||
|
@ -294,12 +294,9 @@ virSecretDefFormat(const virSecretDef *def)
|
||||
def->description);
|
||||
if (def->usage_type != VIR_SECRET_USAGE_TYPE_NONE &&
|
||||
virSecretDefFormatUsage(&buf, def) < 0)
|
||||
goto error;
|
||||
return NULL;
|
||||
virBufferAdjustIndent(&buf, -2);
|
||||
virBufferAddLit(&buf, "</secret>\n");
|
||||
|
||||
return virBufferContentAndReset(&buf);
|
||||
|
||||
error:
|
||||
return NULL;
|
||||
}
|
||||
|
@ -877,7 +877,7 @@ virDomainSnapshotDefFormatInternal(virBufferPtr buf,
|
||||
virBufferAdjustIndent(buf, 2);
|
||||
for (i = 0; i < def->ndisks; i++) {
|
||||
if (virDomainSnapshotDiskDefFormat(buf, &def->disks[i], xmlopt) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
}
|
||||
virBufferAdjustIndent(buf, -2);
|
||||
virBufferAddLit(buf, "</disks>\n");
|
||||
@ -886,7 +886,7 @@ virDomainSnapshotDefFormatInternal(virBufferPtr buf,
|
||||
if (def->parent.dom) {
|
||||
if (virDomainDefFormatInternal(def->parent.dom, xmlopt,
|
||||
buf, domainflags) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
} else if (uuidstr) {
|
||||
virBufferAddLit(buf, "<domain>\n");
|
||||
virBufferAdjustIndent(buf, 2);
|
||||
@ -899,12 +899,12 @@ virDomainSnapshotDefFormatInternal(virBufferPtr buf,
|
||||
if (virDomainDefFormatInternalSetRootName(def->parent.inactiveDom, xmlopt,
|
||||
buf, "inactiveDomain",
|
||||
domainflags) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (virSaveCookieFormatBuf(buf, def->cookie,
|
||||
virDomainXMLOptionGetSaveCookie(xmlopt)) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
|
||||
if (flags & VIR_DOMAIN_SNAPSHOT_FORMAT_INTERNAL)
|
||||
virBufferAsprintf(buf, "<active>%d</active>\n",
|
||||
@ -914,9 +914,6 @@ virDomainSnapshotDefFormatInternal(virBufferPtr buf,
|
||||
virBufferAddLit(buf, "</domainsnapshot>\n");
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1226,12 +1226,9 @@ virStoragePoolDefFormat(virStoragePoolDefPtr def)
|
||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||
|
||||
if (virStoragePoolDefFormatBuf(&buf, def) < 0)
|
||||
goto error;
|
||||
return NULL;
|
||||
|
||||
return virBufferContentAndReset(&buf);
|
||||
|
||||
error:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@ -1648,21 +1645,18 @@ virStorageVolDefFormat(virStoragePoolDefPtr pool,
|
||||
|
||||
if (virStorageVolTargetDefFormat(options, &buf,
|
||||
&def->target, "target") < 0)
|
||||
goto cleanup;
|
||||
return NULL;
|
||||
|
||||
if (virStorageSourceHasBacking(&def->target) &&
|
||||
virStorageVolTargetDefFormat(options, &buf,
|
||||
def->target.backingStore,
|
||||
"backingStore") < 0)
|
||||
goto cleanup;
|
||||
return NULL;
|
||||
|
||||
virBufferAdjustIndent(&buf, -2);
|
||||
virBufferAddLit(&buf, "</volume>\n");
|
||||
|
||||
return virBufferContentAndReset(&buf);
|
||||
|
||||
cleanup:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@ -1753,7 +1747,7 @@ virStoragePoolSourceListFormat(virStoragePoolSourceListPtr def)
|
||||
if (!type) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("unexpected pool type"));
|
||||
goto cleanup;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
virBufferAddLit(&buf, "<sources>\n");
|
||||
@ -1766,7 +1760,4 @@ virStoragePoolSourceListFormat(virStoragePoolSourceListPtr def)
|
||||
virBufferAddLit(&buf, "</sources>\n");
|
||||
|
||||
return virBufferContentAndReset(&buf);
|
||||
|
||||
cleanup:
|
||||
return NULL;
|
||||
}
|
||||
|
@ -820,7 +820,7 @@ virNetworkObjFormat(virNetworkObjPtr obj,
|
||||
size_t i;
|
||||
|
||||
if (!classIdStr)
|
||||
goto error;
|
||||
return NULL;
|
||||
|
||||
virBufferAddLit(&buf, "<networkstatus>\n");
|
||||
virBufferAdjustIndent(&buf, 2);
|
||||
@ -835,15 +835,12 @@ virNetworkObjFormat(virNetworkObjPtr obj,
|
||||
}
|
||||
|
||||
if (virNetworkDefFormatBuf(&buf, obj->def, xmlopt, flags) < 0)
|
||||
goto error;
|
||||
return NULL;
|
||||
|
||||
virBufferAdjustIndent(&buf, -2);
|
||||
virBufferAddLit(&buf, "</networkstatus>");
|
||||
|
||||
return virBufferContentAndReset(&buf);
|
||||
|
||||
error:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
@ -130,10 +130,7 @@ virSaveCookieFormat(virObjectPtr obj,
|
||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||
|
||||
if (virSaveCookieFormatBuf(&buf, obj, saveCookie) < 0)
|
||||
goto error;
|
||||
return NULL;
|
||||
|
||||
return virBufferContentAndReset(&buf);
|
||||
|
||||
error:
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user