On Tue, Mar 22, 2016 at 11:04:46AM +0100, Fabiano Fidêncio wrote:
Seems that GVirConfigDomainGraphics* were built with a strong focus
on
writing/setting configs, but not reading those.
For instance, considering virt-viewer's case, where the app is just
consuming an already built xml, for getting the port attribute of a
GVirDomainConfigGraphis{Spice,Vnc} you have to know, beforehand, the
type of the connection and then call
gvir_config_domain_graphics_{sdl,spice}_get_port(). It means creating an
abstraction on virt-viewer side, that will ended up in some code like:
if (GVIR_CONFIG_IS_DOMAIN_GRAPHICS_SPICE(graphics))
_get_whatever_you_want_using_specific_spice_api()
else
_get_whatever_you want_using_specific_vnc_api()
In order to avoid this, let's introduce GVirConfigDomainGraphicsRemote
class that, at least for now, is intended to be a helper for the case
explained above. It introduces a new hierarchy in the project, where,
instead of having GVirConfigDomainGraphics{Spice,Vnc,Rdp} inheriting
from GVirCOnfigDomainGraphics, these classes will inherit from
s/COnfig/Config
diff --git a/libvirt-gconfig/libvirt-gconfig.sym
b/libvirt-gconfig/libvirt-gconfig.sym
index ed47610..6dca69a 100644
--- a/libvirt-gconfig/libvirt-gconfig.sym
+++ b/libvirt-gconfig/libvirt-gconfig.sym
@@ -734,9 +734,14 @@ global:
} LIBVIRT_GCONFIG_0.2.1;
LIBVIRT_GCONFIG_0.2.4 {
+global:
gvir_config_domain_graphics_rdp_get_autoport;
gvir_config_domain_graphics_rdp_get_host;
gvir_config_domain_graphics_rdp_set_host;
+ gvir_config_domain_graphics_remote_get_autoport;
+ gvir_config_domain_graphics_remote_get_host;
+ gvir_config_domain_graphics_remote_get_port;
+ gvir_config_domain_graphics_remote_get_type;
gvir_config_domain_graphics_sdl_get_display;
gvir_config_domain_graphics_sdl_get_fullscreen;
gvir_config_domain_graphics_spice_get_autoport;
One more question came to mind, why don't you implement _remote_set_* as well?
Christophe