[PATCH 2/2] domain_conf: Switch to virBufferAddLit for literal strings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 src/conf/domain_conf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 4c7a5a044c..44a01ab628 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -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;
 
-- 
2.35.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux