Skip to content

Commit c0806dc

Browse files
author
Jiri Denemark
committed
domain: Fix migratable XML with graphics/@listen
As of commit 6992994, we set graphics/@listen attribute according to the first listen child element even if that element is of type='network'. This was done for backward compatibility with applications which only support the original listen attribute. However, by doing so we broke migration to older libvirt which tried to check that the listen attribute matches one of the listen child elements but which did not take type='network' elements into account. We are not concerned about compatibility with old applications when formatting domain XML for migration for two reasons. The XML is consumed only by libvirtd and the IP address associated with type='network' listen address on the source host is just useless on the destination host. Thus, we can safely avoid propagating the type='network' IP address to graphics/@listen attribute when creating migratable XML. https://bugzilla.redhat.com/show_bug.cgi?id=1265111 Signed-off-by: Jiri Denemark <[email protected]>
1 parent 2d9fcb3 commit c0806dc

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/conf/domain_conf.c

+7-9
Original file line numberDiff line numberDiff line change
@@ -21020,19 +21020,17 @@ virDomainGraphicsDefFormat(virBufferPtr buf,
2102021020
* <graphics>. This is done to improve backward compatibility.
2102121021
*/
2102221022
for (i = 0; i < def->nListens; i++) {
21023-
virDomainGraphicsListenType listenType;
21024-
2102521023
if (flags & VIR_DOMAIN_DEF_FORMAT_MIGRATABLE &&
2102621024
def->listens[i].fromConfig)
2102721025
continue;
21028-
listenType = virDomainGraphicsListenGetType(def, i);
2102921026

21030-
if (listenType == VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS ||
21031-
(listenType == VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NETWORK &&
21032-
!(flags & VIR_DOMAIN_DEF_FORMAT_INACTIVE))) {
21033-
if ((listenAddr = virDomainGraphicsListenGetAddress(def, i)))
21034-
break;
21035-
}
21027+
if (def->listens[i].type == VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NETWORK &&
21028+
flags & (VIR_DOMAIN_DEF_FORMAT_INACTIVE |
21029+
VIR_DOMAIN_DEF_FORMAT_MIGRATABLE))
21030+
continue;
21031+
21032+
if ((listenAddr = virDomainGraphicsListenGetAddress(def, i)))
21033+
break;
2103621034
}
2103721035

2103821036
virBufferAsprintf(buf, "<graphics type='%s'", type);

0 commit comments

Comments
 (0)