-
由 Laine Stump 提交于
Prior to 0.9.4, libvirt only supported a single listen, and it had to be an IP address: <graphics listen='1.2.3.4' ..../> Starting with 0.9.4, a graphics element could have a <listen> subelement (actually the grammar supports multiples, but all of the drivers only support a single <listen> per <graphics>), and that listen element can be of type='address' or type='network'. For type='address', <listen> also has an attribute called 'address' which contains the IP address for listening: <graphics ....> <listen type='address' address='1.2.3.4' .../> </graphics> type can also be "network", and in that case listen will have a "network" attribute which will contain the name of a libvirt network: <graphics ....> <listen type='network' network='testnet' .../> </graphics> At domain start (or migrate) time, libvirt will attempt to find an IP address associated with that network (e.g. the IP address of the bridge device used by the network, or the physical device listed in <forward dev='physdev'/>) and fill in that address in the status XML: <graphics ....> <listen type='network' network='testnet' address='1.2.3.4' .../> </graphics> In the case that a <graphics> element has a <listen> subelement of type='address', that listen subelement's "address" attribute is backfilled into the parent graphics element's "listen" *attribute* for backward compatibility (so that a management application unaware of the separate <listen> element can still learn the listen address). This backfill should be done with the IP learned from type='network' as well, and that's what this patch does: <graphics listen='1.2.3.4' ....> <listen type='network' network='testnet' address='1.2.3.4' .../> </graphics> This is a continuation of the fix for: https://bugzilla.redhat.com/show_bug.cgi?id=1191016
69929941