This enumeration will be useful for vnc with the upcoming qemu-vdagent device so make the name more generic.
Signed-off-by: Jonathon Jongsma <jjong...@redhat.com> --- src/conf/domain_conf.c | 8 ++++---- src/conf/domain_conf.h | 14 +++++++------- src/libvirt_private.syms | 4 ++-- src/libxl/libxl_conf.c | 8 ++++---- src/libxl/xen_xl.c | 16 +++++++--------- src/qemu/qemu_command.c | 10 +++++----- 6 files changed, 29 insertions(+), 31 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 731139f80f..6f9954638c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -995,8 +995,8 @@ VIR_ENUM_IMPL(virDomainGraphicsSpiceZlibCompression, "always", ); -VIR_ENUM_IMPL(virDomainGraphicsSpiceMouseMode, - VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_LAST, +VIR_ENUM_IMPL(virDomainMouseMode, + VIR_DOMAIN_MOUSE_MODE_LAST, "default", "server", "client", @@ -12727,7 +12727,7 @@ virDomainGraphicsDefParseXMLSpice(virDomainGraphicsDef *def, if ((cur = virXPathNode("./mouse", ctxt))) { if (virXMLPropEnum(cur, "mode", - virDomainGraphicsSpiceMouseModeTypeFromString, + virDomainMouseModeTypeFromString, VIR_XML_PROP_REQUIRED | VIR_XML_PROP_NONZERO, &def->data.spice.mousemode) < 0) return -1; @@ -26616,7 +26616,7 @@ virDomainGraphicsDefFormat(virBuffer *buf, virDomainGraphicsSpiceStreamingModeTypeToString(def->data.spice.streaming)); if (def->data.spice.mousemode) virBufferAsprintf(buf, "<mouse mode='%s'/>\n", - virDomainGraphicsSpiceMouseModeTypeToString(def->data.spice.mousemode)); + virDomainMouseModeTypeToString(def->data.spice.mousemode)); if (def->data.spice.copypaste) virBufferAsprintf(buf, "<clipboard copypaste='%s'/>\n", virTristateBoolTypeToString(def->data.spice.copypaste)); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 49c964e6e1..2b00099431 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1844,12 +1844,12 @@ typedef enum { } virDomainGraphicsSpiceZlibCompression; typedef enum { - VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_DEFAULT = 0, - VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_SERVER, - VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_CLIENT, + VIR_DOMAIN_MOUSE_MODE_DEFAULT = 0, + VIR_DOMAIN_MOUSE_MODE_SERVER, + VIR_DOMAIN_MOUSE_MODE_CLIENT, - VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_LAST -} virDomainGraphicsSpiceMouseMode; + VIR_DOMAIN_MOUSE_MODE_LAST +} virDomainMouseMode; typedef enum { VIR_DOMAIN_GRAPHICS_SPICE_STREAMING_MODE_DEFAULT = 0, @@ -1927,7 +1927,7 @@ struct _virDomainGraphicsDef { int tlsPort; bool portReserved; bool tlsPortReserved; - virDomainGraphicsSpiceMouseMode mousemode; + virDomainMouseMode mousemode; char *keymap; virDomainGraphicsAuthDef auth; bool autoport; @@ -3990,7 +3990,7 @@ VIR_ENUM_DECL(virDomainGraphicsSpiceImageCompression); VIR_ENUM_DECL(virDomainGraphicsSpiceJpegCompression); VIR_ENUM_DECL(virDomainGraphicsSpiceZlibCompression); VIR_ENUM_DECL(virDomainGraphicsSpiceStreamingMode); -VIR_ENUM_DECL(virDomainGraphicsSpiceMouseMode); +VIR_ENUM_DECL(virDomainMouseMode); VIR_ENUM_DECL(virDomainGraphicsVNCSharePolicy); VIR_ENUM_DECL(virDomainHyperv); VIR_ENUM_DECL(virDomainKVM); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 03697d81a8..400adf14b5 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -444,8 +444,6 @@ virDomainGraphicsSpiceImageCompressionTypeFromString; virDomainGraphicsSpiceImageCompressionTypeToString; virDomainGraphicsSpiceJpegCompressionTypeFromString; virDomainGraphicsSpiceJpegCompressionTypeToString; -virDomainGraphicsSpiceMouseModeTypeFromString; -virDomainGraphicsSpiceMouseModeTypeToString; virDomainGraphicsSpiceStreamingModeTypeFromString; virDomainGraphicsSpiceStreamingModeTypeToString; virDomainGraphicsSpiceZlibCompressionTypeFromString; @@ -519,6 +517,8 @@ virDomainMemoryModelTypeToString; virDomainMemoryRemove; virDomainMemorySourceTypeFromString; virDomainMemorySourceTypeToString; +virDomainMouseModeTypeFromString; +virDomainMouseModeTypeToString; virDomainNetAllocateActualDevice; virDomainNetAppendIPAddress; virDomainNetARPInterfaces; diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index a0fc51c74a..0b4662e6dc 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -1645,14 +1645,14 @@ libxlMakeBuildInfoVfb(virPortAllocatorRange *graphicsports, switch (l_vfb->data.spice.mousemode) { /* client mouse mode is default in xl.cfg */ - case VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_DEFAULT: - case VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_CLIENT: + case VIR_DOMAIN_MOUSE_MODE_DEFAULT: + case VIR_DOMAIN_MOUSE_MODE_CLIENT: libxl_defbool_set(&b_info->u.hvm.spice.agent_mouse, true); break; - case VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_SERVER: + case VIR_DOMAIN_MOUSE_MODE_SERVER: libxl_defbool_set(&b_info->u.hvm.spice.agent_mouse, false); break; - case VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_LAST: + case VIR_DOMAIN_MOUSE_MODE_LAST: break; } diff --git a/src/libxl/xen_xl.c b/src/libxl/xen_xl.c index 87194ccbd1..6b7f638783 100644 --- a/src/libxl/xen_xl.c +++ b/src/libxl/xen_xl.c @@ -361,11 +361,9 @@ xenParseXLSpice(virConf *conf, virDomainDef *def) &val, 0) < 0) goto cleanup; if (val) { - graphics->data.spice.mousemode = - VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_CLIENT; + graphics->data.spice.mousemode = VIR_DOMAIN_MOUSE_MODE_CLIENT; } else { - graphics->data.spice.mousemode = - VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_SERVER; + graphics->data.spice.mousemode = VIR_DOMAIN_MOUSE_MODE_SERVER; } if (xenConfigGetBool(conf, "spice_clipboard_sharing", &val, 0) < 0) @@ -1691,11 +1689,11 @@ xenFormatXLSpice(virConf *conf, virDomainDef *def) if (graphics->data.spice.mousemode) { switch (graphics->data.spice.mousemode) { - case VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_SERVER: + case VIR_DOMAIN_MOUSE_MODE_SERVER: if (xenConfigSetInt(conf, "spiceagent_mouse", 0) < 0) return -1; break; - case VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_CLIENT: + case VIR_DOMAIN_MOUSE_MODE_CLIENT: if (xenConfigSetInt(conf, "spiceagent_mouse", 1) < 0) return -1; /* @@ -1705,11 +1703,11 @@ xenFormatXLSpice(virConf *conf, virDomainDef *def) if (xenConfigSetInt(conf, "spicevdagent", 1) < 0) return -1; break; - case VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_DEFAULT: + case VIR_DOMAIN_MOUSE_MODE_DEFAULT: break; - case VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_LAST: + case VIR_DOMAIN_MOUSE_MODE_LAST: default: - virReportEnumRangeError(virDomainGraphicsSpiceMouseMode, + virReportEnumRangeError(virDomainMouseMode, graphics->data.spice.mousemode); return -1; } diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 8246ab515a..7834aece35 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -8377,17 +8377,17 @@ qemuBuildGraphicsSPICECommandLine(virQEMUDriverConfig *cfg, if (graphics->data.spice.mousemode) { switch (graphics->data.spice.mousemode) { - case VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_SERVER: + case VIR_DOMAIN_MOUSE_MODE_SERVER: virBufferAddLit(&opt, "agent-mouse=off,"); break; - case VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_CLIENT: + case VIR_DOMAIN_MOUSE_MODE_CLIENT: virBufferAddLit(&opt, "agent-mouse=on,"); break; - case VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_DEFAULT: + case VIR_DOMAIN_MOUSE_MODE_DEFAULT: break; - case VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_LAST: + case VIR_DOMAIN_MOUSE_MODE_LAST: default: - virReportEnumRangeError(virDomainGraphicsSpiceMouseMode, + virReportEnumRangeError(virDomainMouseMode, graphics->data.spice.mousemode); return -1; } -- 2.35.1