From: Michal Privoznik Date: Mon, 27 Oct 2025 10:55:46 +0000 (+0100) Subject: domain_conf: Make virDomainMemoryDefFormat() return void X-Git-Tag: v11.9.0-rc1~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=30eab13fc9812dcc0f39b0ea261414bf8f7d1403;p=thirdparty%2Flibvirt.git domain_conf: Make virDomainMemoryDefFormat() return void The only thing that's possibly making virDomainMemoryDefFormat() fail is call to virDomainMemorySourceDefFormat() but that always returns zero. Make both functions return void so callers are not confused. Signed-off-by: Michal Privoznik Reviewed-by: Jiri Denemark --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 0223fc1d88..0a647a1b44 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -26472,7 +26472,7 @@ virDomainCryptoDefFree(virDomainCryptoDef *def) } -static int +static void virDomainMemorySourceDefFormat(virBuffer *buf, virDomainMemoryDef *def) { @@ -26532,8 +26532,6 @@ virDomainMemorySourceDefFormat(virBuffer *buf, } virXMLFormatElement(buf, "source", NULL, &childBuf); - - return 0; } @@ -26600,7 +26598,7 @@ virDomainMemoryTargetDefFormat(virBuffer *buf, virXMLFormatElement(buf, "target", &attrBuf, &childBuf); } -static int +static void virDomainMemoryDefFormat(virBuffer *buf, virDomainMemoryDef *def, unsigned int flags) @@ -26625,8 +26623,7 @@ virDomainMemoryDefFormat(virBuffer *buf, virBufferAsprintf(buf, "%s\n", uuidstr); } - if (virDomainMemorySourceDefFormat(buf, def) < 0) - return -1; + virDomainMemorySourceDefFormat(buf, def); virDomainMemoryTargetDefFormat(buf, def, flags); @@ -26634,7 +26631,6 @@ virDomainMemoryDefFormat(virBuffer *buf, virBufferAdjustIndent(buf, -2); virBufferAddLit(buf, "\n"); - return 0; } static void @@ -29462,8 +29458,7 @@ virDomainDefFormatInternalSetRootName(virDomainDef *def, virDomainShmemDefFormat(buf, def->shmems[n], flags); for (n = 0; n < def->nmems; n++) { - if (virDomainMemoryDefFormat(buf, def->mems[n], flags) < 0) - return -1; + virDomainMemoryDefFormat(buf, def->mems[n], flags); } for (n = 0; n < def->ncryptos; n++) {