提交 cb06ea57 编写于 作者: P Pavel Hrdina

conf: fix migratable XML for graphics if socket is generated based on config

The graphics code is complex and there are a lot of exceptions and
backward compatible combinations.  One of them is the possibility
to configure "spice_auto_unix_socket" in qemu.conf which will convert
all spice graphics with listen type "address" without any address
specified to listen type "socket" when the guest is started.

We don't format this generated socket into migratable XML to make
migration work with older libvirt.  However, spice has another
exception that if autoport='no' and there is no port configured
it is converted to listen type "none".  Because of this we need
to format autoport='yes' to make sure that the listen type will
be the same as the offline XML.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1511407Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
上级 65108d94
...@@ -25166,6 +25166,18 @@ virDomainGraphicsDefFormat(virBufferPtr buf, ...@@ -25166,6 +25166,18 @@ virDomainGraphicsDefFormat(virBufferPtr buf,
break; break;
case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_SOCKET: case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_SOCKET:
/* If socket is auto-generated based on config option we don't
* add any listen element into migratable XML because the original
* listen type is "address".
* We need to set autoport to make sure that libvirt on destination
* will parse it as listen type "address", without autoport it is
* parsed as listen type "none". */
if ((flags & VIR_DOMAIN_DEF_FORMAT_MIGRATABLE) &&
glisten->fromConfig) {
virBufferAddStr(buf, " autoport='yes'");
}
break;
case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_LAST: case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_LAST:
break; break;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册