Extract those embedded structs from virDomainGraphicsDef so that we can
specify directives on them.
Signed-off-by: Shi Lei <shi_lei(a)massclouds.com>
---
src/conf/domain_conf.h | 112 ++++++++++++++++++++++------------------
src/conf/virconftypes.h | 18 +++++++
2 files changed, 80 insertions(+), 50 deletions(-)
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 14a3763..3d14aa1 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1672,6 +1672,62 @@ struct _virDomainGraphicsListenDef {
bool autoGenerated;
};
+struct _virDomainGraphicsSDLDef {
+ char *display;
+ char *xauth;
+ bool fullscreen;
+ virTristateBool gl;
+};
+
+struct _virDomainGraphicsVNCDef {
+ int port;
+ bool portReserved;
+ int websocket;
+ bool websocketGenerated;
+ bool autoport;
+ char *keymap;
+ virDomainGraphicsAuthDef auth;
+ int sharePolicy;
+};
+
+struct _virDomainGraphicsRDPDef {
+ int port;
+ bool autoport;
+ bool replaceUser;
+ bool multiUser;
+};
+
+struct _virDomainGraphicsDesktopDef {
+ char *display;
+ bool fullscreen;
+};
+
+struct _virDomainGraphicsSpiceDef {
+ int port;
+ int tlsPort;
+ bool portReserved;
+ bool tlsPortReserved;
+ virDomainGraphicsSpiceMouseMode mousemode;
+ char *keymap;
+ virDomainGraphicsAuthDef auth;
+ bool autoport;
+ int channels[VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_LAST];
+ virDomainGraphicsSpiceChannelMode defaultMode;
+ int image;
+ int jpeg;
+ int zlib;
+ int playback;
+ int streaming;
+ virTristateBool copypaste;
+ virTristateBool filetransfer;
+ virTristateBool gl;
+ char *rendernode;
+};
+
+struct _virDomainGraphicsEGLHeadlessDef {
+ char *rendernode;
+};
+
struct _virDomainGraphicsDef {
virObjectPtr privateData;
@@ -1682,56 +1738,12 @@ struct _virDomainGraphicsDef {
*/
virDomainGraphicsType type;
union {
- struct {
- int port;
- bool portReserved;
- int websocket;
- bool websocketGenerated;
- bool autoport;
- char *keymap;
- virDomainGraphicsAuthDef auth;
- int sharePolicy;
- } vnc;
- struct {
- char *display;
- char *xauth;
- bool fullscreen;
- virTristateBool gl;
- } sdl;
- struct {
- int port;
- bool autoport;
- bool replaceUser;
- bool multiUser;
- } rdp;
- struct {
- char *display;
- bool fullscreen;
- } desktop;
- struct {
- int port;
- int tlsPort;
- bool portReserved;
- bool tlsPortReserved;
- virDomainGraphicsSpiceMouseMode mousemode;
- char *keymap;
- virDomainGraphicsAuthDef auth;
- bool autoport;
- int channels[VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_LAST];
- virDomainGraphicsSpiceChannelMode defaultMode;
- int image;
- int jpeg;
- int zlib;
- int playback;
- int streaming;
- virTristateBool copypaste;
- virTristateBool filetransfer;
- virTristateBool gl;
- char *rendernode;
- } spice;
- struct {
- char *rendernode;
- } egl_headless;
+ virDomainGraphicsSDLDef sdl;
+ virDomainGraphicsVNCDef vnc;
+ virDomainGraphicsRDPDef rdp;
+ virDomainGraphicsDesktopDef desktop;
+ virDomainGraphicsSpiceDef spice;
+ virDomainGraphicsEGLHeadlessDef egl_headless;
} data;
/* nListens, listens, and *port are only useful if type is vnc,
* rdp, or spice. They've been extracted from the union only to
diff --git a/src/conf/virconftypes.h b/src/conf/virconftypes.h
index 9042a2b..ae7c18d 100644
--- a/src/conf/virconftypes.h
+++ b/src/conf/virconftypes.h
@@ -362,3 +362,21 @@ typedef virDomainXMLPrivateDataCallbacks
*virDomainXMLPrivateDataCallbacksPtr;
typedef struct _virDomainXenbusControllerOpts virDomainXenbusControllerOpts;
typedef virDomainXenbusControllerOpts *virDomainXenbusControllerOptsPtr;
+
+typedef struct _virDomainGraphicsSDLDef virDomainGraphicsSDLDef;
+typedef virDomainGraphicsSDLDef *virDomainGraphicsSDLDefPtr;
+
+typedef struct _virDomainGraphicsVNCDef virDomainGraphicsVNCDef;
+typedef virDomainGraphicsVNCDef *virDomainGraphicsVNCDefPtr;
+
+typedef struct _virDomainGraphicsRDPDef virDomainGraphicsRDPDef;
+typedef virDomainGraphicsRDPDef *virDomainGraphicsRDPDefPtr;
+
+typedef struct _virDomainGraphicsDesktopDef virDomainGraphicsDesktopDef;
+typedef virDomainGraphicsDesktopDef *virDomainGraphicsDesktopDefPtr;
+
+typedef struct _virDomainGraphicsSpiceDef virDomainGraphicsSpiceDef;
+typedef virDomainGraphicsSpiceDef *virDomainGraphicsSpiceDefPtr;
+
+typedef struct _virDomainGraphicsEGLHeadlessDef virDomainGraphicsEGLHeadlessDef;
+typedef virDomainGraphicsEGLHeadlessDef *virDomainGraphicsEGLHeadlessDefPtr;
--
2.25.1