mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 11:31:16 +00:00
conf: add 'sharePolicy' attribute to graphics element for vnc
-vnc :5900,share=allow-exclusive allows clients to ask for exclusive access which is implemented by dropping other connections Connecting multiple clients in parallel requires all clients asking for a shared session (vncviewer: -shared switch) -vnc :5900,share=force-shared disables exclusive client access. Useful for shared desktop sessions, where you don't want someone forgetting specify -shared disconnect everybody else. -vnc :5900,share=ignore completely ignores the shared flag and allows everybody connect unconditionally
This commit is contained in:
parent
d377d02dc4
commit
2a58d07654
@ -3621,7 +3621,7 @@ qemu-kvm -net nic,model=? /dev/null
|
|||||||
...
|
...
|
||||||
<devices>
|
<devices>
|
||||||
<graphics type='sdl' display=':0.0'/>
|
<graphics type='sdl' display=':0.0'/>
|
||||||
<graphics type='vnc' port='5904'>
|
<graphics type='vnc' port='5904' sharePolicy='allow-exclusive'>
|
||||||
<listen type='address' address='1.2.3.4'/>
|
<listen type='address' address='1.2.3.4'/>
|
||||||
</graphics>
|
</graphics>
|
||||||
<graphics type='rdp' autoport='yes' multiUser='yes' />
|
<graphics type='rdp' autoport='yes' multiUser='yes' />
|
||||||
@ -3664,7 +3664,16 @@ qemu-kvm -net nic,model=? /dev/null
|
|||||||
allows control of connected client during password changes.
|
allows control of connected client during password changes.
|
||||||
VNC accepts <code>keep</code> value only.
|
VNC accepts <code>keep</code> value only.
|
||||||
<span class="since">since 0.9.3</span>
|
<span class="since">since 0.9.3</span>
|
||||||
NB, this may not be supported by all hypervisors.<br/> <br/>
|
NB, this may not be supported by all hypervisors.<br/>
|
||||||
|
The optional <code>sharePolicy</code> attribute specifies vnc server
|
||||||
|
display sharing policy. "allow-exclusive" allows clients to ask
|
||||||
|
for exclusive access by dropping other connections. Connecting
|
||||||
|
multiple clients in parallel requires all clients asking for a
|
||||||
|
shared session (vncviewer: -Shared switch). This is the default
|
||||||
|
value. "force-shared" disables exclusive client access, every
|
||||||
|
connection has to specify -Shared switch for vncviewer. "ignore"
|
||||||
|
welcomes every connection unconditionally
|
||||||
|
<span class="since">since 1.0.6</span>. <br/> <br/>
|
||||||
Rather than using listen/port, QEMU supports a
|
Rather than using listen/port, QEMU supports a
|
||||||
<code>socket</code> attribute for listening on a unix
|
<code>socket</code> attribute for listening on a unix
|
||||||
domain socket path.<span class="since">Since 0.8.8</span>
|
domain socket path.<span class="since">Since 0.8.8</span>
|
||||||
|
@ -2135,6 +2135,15 @@
|
|||||||
<ref name="addrIPorName"/>
|
<ref name="addrIPorName"/>
|
||||||
</attribute>
|
</attribute>
|
||||||
</optional>
|
</optional>
|
||||||
|
<optional>
|
||||||
|
<attribute name='sharePolicy'>
|
||||||
|
<choice>
|
||||||
|
<value>allow-exclusive</value>
|
||||||
|
<value>force-shared</value>
|
||||||
|
<value>ignore</value>
|
||||||
|
</choice>
|
||||||
|
</attribute>
|
||||||
|
</optional>
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<optional>
|
<optional>
|
||||||
|
@ -515,6 +515,13 @@ VIR_ENUM_IMPL(virDomainGraphicsAuthConnected,
|
|||||||
"disconnect",
|
"disconnect",
|
||||||
"keep")
|
"keep")
|
||||||
|
|
||||||
|
VIR_ENUM_IMPL(virDomainGraphicsVNCSharePolicy,
|
||||||
|
VIR_DOMAIN_GRAPHICS_VNC_SHARE_LAST,
|
||||||
|
"default",
|
||||||
|
"allow-exclusive",
|
||||||
|
"force-shared",
|
||||||
|
"ignore")
|
||||||
|
|
||||||
VIR_ENUM_IMPL(virDomainGraphicsSpiceChannelName,
|
VIR_ENUM_IMPL(virDomainGraphicsSpiceChannelName,
|
||||||
VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_LAST,
|
VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_LAST,
|
||||||
"main",
|
"main",
|
||||||
@ -7727,6 +7734,7 @@ virDomainGraphicsDefParseXML(xmlNodePtr node,
|
|||||||
if (def->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
|
if (def->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
|
||||||
char *port = virXMLPropString(node, "port");
|
char *port = virXMLPropString(node, "port");
|
||||||
char *websocket = virXMLPropString(node, "websocket");
|
char *websocket = virXMLPropString(node, "websocket");
|
||||||
|
char *sharePolicy = virXMLPropString(node, "sharePolicy");
|
||||||
char *autoport;
|
char *autoport;
|
||||||
|
|
||||||
if (port) {
|
if (port) {
|
||||||
@ -7769,6 +7777,21 @@ virDomainGraphicsDefParseXML(xmlNodePtr node,
|
|||||||
VIR_FREE(websocket);
|
VIR_FREE(websocket);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sharePolicy) {
|
||||||
|
int policy =
|
||||||
|
virDomainGraphicsVNCSharePolicyTypeFromString(sharePolicy);
|
||||||
|
|
||||||
|
if (policy < 0) {
|
||||||
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
|
_("unknown vnc display sharing policy '%s'"), sharePolicy);
|
||||||
|
VIR_FREE(sharePolicy);
|
||||||
|
goto error;
|
||||||
|
} else {
|
||||||
|
def->data.vnc.sharePolicy = policy;
|
||||||
|
}
|
||||||
|
VIR_FREE(sharePolicy);
|
||||||
|
}
|
||||||
|
|
||||||
def->data.vnc.socket = virXMLPropString(node, "socket");
|
def->data.vnc.socket = virXMLPropString(node, "socket");
|
||||||
def->data.vnc.keymap = virXMLPropString(node, "keymap");
|
def->data.vnc.keymap = virXMLPropString(node, "keymap");
|
||||||
|
|
||||||
@ -15304,6 +15327,11 @@ virDomainGraphicsDefFormat(virBufferPtr buf,
|
|||||||
virBufferEscapeString(buf, " keymap='%s'",
|
virBufferEscapeString(buf, " keymap='%s'",
|
||||||
def->data.vnc.keymap);
|
def->data.vnc.keymap);
|
||||||
|
|
||||||
|
if (def->data.vnc.sharePolicy)
|
||||||
|
virBufferAsprintf(buf, " sharePolicy='%s'",
|
||||||
|
virDomainGraphicsVNCSharePolicyTypeToString(
|
||||||
|
def->data.vnc.sharePolicy));
|
||||||
|
|
||||||
virDomainGraphicsAuthDefFormatAttr(buf, &def->data.vnc.auth, flags);
|
virDomainGraphicsAuthDefFormatAttr(buf, &def->data.vnc.auth, flags);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1288,6 +1288,15 @@ enum virDomainGraphicsType {
|
|||||||
VIR_DOMAIN_GRAPHICS_TYPE_LAST
|
VIR_DOMAIN_GRAPHICS_TYPE_LAST
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum virDomainGraphicsVNCSharePolicy {
|
||||||
|
VIR_DOMAIN_GRAPHICS_VNC_SHARE_DEFAULT = 0,
|
||||||
|
VIR_DOMAIN_GRAPHICS_VNC_SHARE_ALLOW_EXCLUSIVE,
|
||||||
|
VIR_DOMAIN_GRAPHICS_VNC_SHARE_FORCE_SHARED,
|
||||||
|
VIR_DOMAIN_GRAPHICS_VNC_SHARE_IGNORE,
|
||||||
|
|
||||||
|
VIR_DOMAIN_GRAPHICS_VNC_SHARE_LAST
|
||||||
|
};
|
||||||
|
|
||||||
enum virDomainGraphicsAuthConnectedType {
|
enum virDomainGraphicsAuthConnectedType {
|
||||||
VIR_DOMAIN_GRAPHICS_AUTH_CONNECTED_DEFAULT = 0,
|
VIR_DOMAIN_GRAPHICS_AUTH_CONNECTED_DEFAULT = 0,
|
||||||
VIR_DOMAIN_GRAPHICS_AUTH_CONNECTED_FAIL,
|
VIR_DOMAIN_GRAPHICS_AUTH_CONNECTED_FAIL,
|
||||||
@ -1427,6 +1436,7 @@ struct _virDomainGraphicsDef {
|
|||||||
char *keymap;
|
char *keymap;
|
||||||
char *socket;
|
char *socket;
|
||||||
virDomainGraphicsAuthDef auth;
|
virDomainGraphicsAuthDef auth;
|
||||||
|
int sharePolicy;
|
||||||
} vnc;
|
} vnc;
|
||||||
struct {
|
struct {
|
||||||
char *display;
|
char *display;
|
||||||
@ -2532,6 +2542,7 @@ VIR_ENUM_DECL(virDomainGraphicsSpicePlaybackCompression)
|
|||||||
VIR_ENUM_DECL(virDomainGraphicsSpiceStreamingMode)
|
VIR_ENUM_DECL(virDomainGraphicsSpiceStreamingMode)
|
||||||
VIR_ENUM_DECL(virDomainGraphicsSpiceClipboardCopypaste)
|
VIR_ENUM_DECL(virDomainGraphicsSpiceClipboardCopypaste)
|
||||||
VIR_ENUM_DECL(virDomainGraphicsSpiceMouseMode)
|
VIR_ENUM_DECL(virDomainGraphicsSpiceMouseMode)
|
||||||
|
VIR_ENUM_DECL(virDomainGraphicsVNCSharePolicy)
|
||||||
VIR_ENUM_DECL(virDomainHyperv)
|
VIR_ENUM_DECL(virDomainHyperv)
|
||||||
VIR_ENUM_DECL(virDomainRNGModel)
|
VIR_ENUM_DECL(virDomainRNGModel)
|
||||||
VIR_ENUM_DECL(virDomainRNGBackend)
|
VIR_ENUM_DECL(virDomainRNGBackend)
|
||||||
|
@ -203,6 +203,8 @@ virDomainGraphicsSpiceZlibCompressionTypeFromString;
|
|||||||
virDomainGraphicsSpiceZlibCompressionTypeToString;
|
virDomainGraphicsSpiceZlibCompressionTypeToString;
|
||||||
virDomainGraphicsTypeFromString;
|
virDomainGraphicsTypeFromString;
|
||||||
virDomainGraphicsTypeToString;
|
virDomainGraphicsTypeToString;
|
||||||
|
virDomainGraphicsVNCSharePolicyTypeFromString;
|
||||||
|
virDomainGraphicsVNCSharePolicyTypeToString;
|
||||||
virDomainHasDiskMirror;
|
virDomainHasDiskMirror;
|
||||||
virDomainHostdevCapsTypeToString;
|
virDomainHostdevCapsTypeToString;
|
||||||
virDomainHostdevDefAlloc;
|
virDomainHostdevDefAlloc;
|
||||||
|
Loading…
Reference in New Issue
Block a user