From: Ján Tomko Date: Mon, 20 Mar 2017 09:25:34 +0000 (+0100) Subject: Split out virDomainIOMMUDefFormat X-Git-Tag: v3.3.0-rc1~168 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d34ac94351255721ae86eba561cd2ba1d620ab7b;p=thirdparty%2Flibvirt.git Split out virDomainIOMMUDefFormat Make adding subelements easier. --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 0dbd45f45f..9bec68beb2 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -23989,6 +23989,15 @@ virDomainDefIothreadShouldFormat(virDomainDefPtr def) } +static void +virDomainIOMMUDefFormat(virBufferPtr buf, + const virDomainIOMMUDef *iommu) +{ + virBufferAsprintf(buf, "\n", + virDomainIOMMUModelTypeToString(iommu->model)); +} + + /* This internal version appends to an existing buffer * (possibly with auto-indent), rather than flattening * to string. @@ -24735,10 +24744,8 @@ virDomainDefFormatInternal(virDomainDefPtr def, goto error; } - if (def->iommu) { - virBufferAsprintf(buf, "\n", - virDomainIOMMUModelTypeToString(def->iommu->model)); - } + if (def->iommu) + virDomainIOMMUDefFormat(buf, def->iommu); virBufferAdjustIndent(buf, -2); virBufferAddLit(buf, "\n");