[PATCH v2 3/8] domain_capabilities: reformat virDomainCapsCPUCustomFormat()

Kristina Hanicova posted 8 patches 3 years, 6 months ago
[PATCH v2 3/8] domain_capabilities: reformat virDomainCapsCPUCustomFormat()
Posted by Kristina Hanicova 3 years, 6 months ago
Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
---
 src/conf/domain_capabilities.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c
index 6e8f957657..653123f293 100644
--- a/src/conf/domain_capabilities.c
+++ b/src/conf/domain_capabilities.c
@@ -376,12 +376,14 @@ virDomainCapsCPUCustomFormat(virBuffer *buf,
 
     for (i = 0; i < custom->nmodels; i++) {
         virDomainCapsCPUModel *model = custom->models + i;
+
         virBufferAsprintf(buf, "<model usable='%s'",
                           virDomainCapsCPUUsableTypeToString(model->usable));
+
         if (model->deprecated)
             virBufferAddLit(buf, " deprecated='yes'");
-        virBufferAsprintf(buf, ">%s</model>\n",
-                          model->name);
+
+        virBufferAsprintf(buf, ">%s</model>\n", model->name);
     }
 
     virBufferAdjustIndent(buf, -2);
-- 
2.35.3
Re: [PATCH v2 3/8] domain_capabilities: reformat virDomainCapsCPUCustomFormat()
Posted by Martin Kletzander 3 years, 6 months ago
On Thu, Jul 21, 2022 at 12:45:48PM +0200, Kristina Hanicova wrote:
>Signed-off-by: Kristina Hanicova <khanicov@redhat.com>

I was thinking if this would look nicer with virXMLFormatElement, but
then I realised it's just a two lines of code and it does not matter at
all =)

Reviewed-by: Martin Kletzander <mkletzan@redhat.com>


>---
> src/conf/domain_capabilities.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
>diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c
>index 6e8f957657..653123f293 100644
>--- a/src/conf/domain_capabilities.c
>+++ b/src/conf/domain_capabilities.c
>@@ -376,12 +376,14 @@ virDomainCapsCPUCustomFormat(virBuffer *buf,
>
>     for (i = 0; i < custom->nmodels; i++) {
>         virDomainCapsCPUModel *model = custom->models + i;
>+
>         virBufferAsprintf(buf, "<model usable='%s'",
>                           virDomainCapsCPUUsableTypeToString(model->usable));
>+
>         if (model->deprecated)
>             virBufferAddLit(buf, " deprecated='yes'");
>-        virBufferAsprintf(buf, ">%s</model>\n",
>-                          model->name);
>+
>+        virBufferAsprintf(buf, ">%s</model>\n", model->name);
>     }
>
>     virBufferAdjustIndent(buf, -2);
>-- 
>2.35.3
>