if (!def)
return;
- switch ((virDomainGraphicsType)def->type) {
+ switch (def->type) {
case VIR_DOMAIN_GRAPHICS_TYPE_VNC:
VIR_FREE(def->data.vnc.socket);
VIR_FREE(def->data.vnc.keymap);
char *address = virXMLPropString(node, "address");
char *network = virXMLPropString(node, "network");
char *fromConfig = virXMLPropString(node, "fromConfig");
- int tmp;
+ int tmp, typeVal;
if (!type) {
virReportError(VIR_ERR_XML_ERROR, "%s",
goto error;
}
- if ((def->type = virDomainGraphicsListenTypeFromString(type)) < 0) {
+ if ((typeVal = virDomainGraphicsListenTypeFromString(type)) < 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("unknown graphics listen type '%s'"), type);
goto error;
}
+ def->type = typeVal;
/* address is recognized if either type='address', or if
* type='network' and we're looking at live XML (i.e. *not*
{
virDomainGraphicsDefPtr def;
char *type = NULL;
+ int typeVal;
if (VIR_ALLOC(def) < 0)
return NULL;
goto error;
}
- if ((def->type = virDomainGraphicsTypeFromString(type)) < 0) {
+ if ((typeVal = virDomainGraphicsTypeFromString(type)) < 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("unknown graphics device type '%s'"), type);
goto error;
}
+ def->type = typeVal;
- switch ((virDomainGraphicsType)def->type) {
+ switch (def->type) {
case VIR_DOMAIN_GRAPHICS_TYPE_VNC:
if (virDomainGraphicsDefParseXMLVNC(def, node, ctxt, flags) < 0)
goto error;
virDomainGraphicsAuthDefFormatAttr(buf, &def->data.spice.auth, flags);
break;
+ case VIR_DOMAIN_GRAPHICS_TYPE_LAST:
+ break;
}
for (i = 0; i < def->nListens; i++) {
typedef struct _virDomainGraphicsListenDef virDomainGraphicsListenDef;
typedef virDomainGraphicsListenDef *virDomainGraphicsListenDefPtr;
struct _virDomainGraphicsListenDef {
- int type; /* enum virDomainGraphicsListenType */
+ virDomainGraphicsListenType type;
char *address;
char *network;
bool fromConfig; /* true if the @address is config file originated */
* Value 0 means port wasn't specified in XML at all.
* Positive value is actual port number given in XML.
*/
- int type;
+ virDomainGraphicsType type;
union {
struct {
int port;
int tlsPort;
bool portReserved;
bool tlsPortReserved;
- int mousemode;
+ virDomainGraphicsSpiceMouseMode mousemode;
char *keymap;
virDomainGraphicsAuthDef auth;
bool autoport;
int channels[VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_LAST];
- int defaultMode; /* enum virDomainGraphicsSpiceChannelMode */
+ virDomainGraphicsSpiceChannelMode defaultMode;
int image;
int jpeg;
int zlib;
int playback;
int streaming;
- int copypaste; /* enum virTristateBool */
- int filetransfer; /* enum virTristateBool */
- int gl; /* enum virTristateBool */
+ virTristateBool copypaste;
+ virTristateBool filetransfer;
+ virTristateBool gl;
} spice;
} data;
/* nListens, listens, and *port are only useful if type is vnc,
if (VIR_STRDUP(x_vfb->keymap, l_vfb->data.vnc.keymap) < 0)
return -1;
break;
+
+ case VIR_DOMAIN_GRAPHICS_TYPE_RDP:
+ case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP:
+ case VIR_DOMAIN_GRAPHICS_TYPE_SPICE:
+ case VIR_DOMAIN_GRAPHICS_TYPE_LAST:
+ break;
}
return 0;
case VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_SERVER:
libxl_defbool_set(&b_info->u.hvm.spice.agent_mouse, false);
break;
+ case VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_LAST:
+ break;
}
#ifdef LIBXL_HAVE_SPICE_VDAGENT
if (VIR_STRDUP(gListen->address, netAddr) < 0)
goto error;
break;
+
+ case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NONE:
+ case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_LAST:
+ break;
}
}
if (VIR_STRDUP(gListen->address, listenAddr) < 0)
goto error;
break;
+
+ case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NONE:
+ case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_LAST:
+ break;
}
}
}
}
- if (graphics->data.spice.gl == VIR_TRISTATE_SWITCH_ON) {
+ if (graphics->data.spice.gl == VIR_TRISTATE_BOOL_YES) {
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SPICE_GL)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("This QEMU doesn't support spice OpenGL"));
virDomainGraphicsDefPtr graphics,
const char *domainLibDir)
{
- switch ((virDomainGraphicsType) graphics->type) {
+ switch (graphics->type) {
case VIR_DOMAIN_GRAPHICS_TYPE_SDL:
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SDL)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
case VIR_DOMAIN_GRAPHICS_TYPE_SPICE:
++spice;
break;
+ case VIR_DOMAIN_GRAPHICS_TYPE_RDP:
+ case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP:
+ case VIR_DOMAIN_GRAPHICS_TYPE_LAST:
+ break;
}
}
goto cleanup;
}
- switch ((virDomainGraphicsListenType) newlisten->type) {
+ switch (newlisten->type) {
case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS:
if (STRNEQ_NULLABLE(newlisten->address, oldlisten->address)) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
virDomainGraphicsDefPtr graphics = NULL;
const struct sexpr *cur, *node;
const char *tmp;
+ int typeVal;
/* append network devices and framebuffer */
for (cur = root; cur->kind == SEXPR_CONS; cur = cur->u.s.cdr) {
if (VIR_ALLOC(graphics) < 0)
goto error;
- if ((graphics->type = virDomainGraphicsTypeFromString(tmp)) < 0) {
+ if ((typeVal = virDomainGraphicsTypeFromString(tmp)) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unknown graphics type '%s'"), tmp);
goto error;
}
+ graphics->type = typeVal;
if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_SDL) {
const char *display = sexpr_node(node, "device/vfb/display");