domain_conf: Switch to virBufferAddLit for literal strings

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>
This commit is contained in:
Michal Privoznik 2022-07-19 14:02:52 +02:00
parent 4e39625095
commit a9d1c08b71

View 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;