]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
domain_conf: Switch to virBufferAddLit for literal strings
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 19 Jul 2022 12:02:52 +0000 (14:02 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 19 Jul 2022 12:24:28 +0000 (14:24 +0200)
There's no need to use virBufferAddStr() for literal strings
without any newline character as it's more expensive than
virBufferAddLit().

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
src/conf/domain_conf.c

index 4c7a5a044c4cfe207c965ea8b34c780c50267400..44a01ab6282d97537eb500a8a7174f3a096d06b7 100644 (file)
@@ -25376,7 +25376,7 @@ virDomainGraphicsDefFormat(virBuffer *buf,
 
         case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NONE:
             if (flags & VIR_DOMAIN_DEF_FORMAT_MIGRATABLE)
-                virBufferAddStr(buf, " autoport='no'");
+                virBufferAddLit(buf, " autoport='no'");
             break;
 
         case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_SOCKET:
@@ -25388,7 +25388,7 @@ virDomainGraphicsDefFormat(virBuffer *buf,
              * parsed as listen type "none". */
             if ((flags & VIR_DOMAIN_DEF_FORMAT_MIGRATABLE) &&
                 glisten->fromConfig) {
-                virBufferAddStr(buf, " autoport='yes'");
+                virBufferAddLit(buf, " autoport='yes'");
             }
             break;