On Wed, Jun 08, 2016 at 05:25:42PM +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
docs/formatdomain.html.in | 8 ++++++
docs/schemas/domaincommon.rng | 10 ++++++++
src/conf/domain_conf.c | 60 +++++++++++++++++++++++++++++++++++++++++--
src/conf/domain_conf.h | 6 +++++
src/libvirt_private.syms | 1 +
src/qemu/qemu_hotplug.c | 9 +++++++
src/qemu/qemu_process.c | 9 +++++++
src/security/virt-aa-helper.c | 15 ++++++++---
8 files changed, 112 insertions(+), 6 deletions(-)
ACK
@@ -10895,6 +10897,7 @@ virDomainGraphicsAuthDefParseXML(xmlNodePtr
node,
/**
* virDomainGraphicsListenDefParseXML:
* @def: listen def pointer to be filled
+ * @graphics: graphics def pointer
* @node: xml node of <listen/> element
* @parent: xml node of <graphics/> element
* @flags: bit-wise or of VIR_DOMAIN_DEF_PARSE_*
@@ -10906,6 +10909,7 @@ virDomainGraphicsAuthDefParseXML(xmlNodePtr node,
*/
static int
virDomainGraphicsListenDefParseXML(virDomainGraphicsListenDefPtr def,
+ virDomainGraphicsDefPtr graphics,
Passing just the graphics type would be enough.
xmlNodePtr node,
xmlNodePtr parent,
unsigned int flags)
@@ -10914,8 +10918,10 @@ virDomainGraphicsListenDefParseXML(virDomainGraphicsListenDefPtr
def,
char *type = virXMLPropString(node, "type");
char *address = virXMLPropString(node, "address");
char *network = virXMLPropString(node, "network");
+ char *socket = virXMLPropString(node, "socket");
char *fromConfig = virXMLPropString(node, "fromConfig");
char *addressCompat = NULL;
+ const char *graphicsType = virDomainGraphicsTypeToString(graphics->type);
int tmp, typeVal;
if (parent)
@@ -10934,6 +10940,13 @@ virDomainGraphicsListenDefParseXML(virDomainGraphicsListenDefPtr
def,
}
def->type = typeVal;
+ if (def->type == VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_SOCKET) {
Okay, we don't parse it yet, hence no XML->XML test.
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("listen type 'socket' is not available for "
+ "graphics type '%s'"), graphicsType);
+ goto error;
+ }
+
if (def->type == VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS) {
if (address && addressCompat && STRNEQ(address, addressCompat))
{
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
diff --git a/src/security/virt-aa-helper.c
b/src/security/virt-aa-helper.c
index 6b0685c..9eafaee 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -1007,10 +1007,17 @@ get_files(vahControl * ctl)
goto cleanup;
for (i = 0; i < ctl->def->ngraphics; i++) {
- if (ctl->def->graphics[i]->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC
&&
- ctl->def->graphics[i]->data.vnc.socket &&
- vah_add_file(&buf, ctl->def->graphics[i]->data.vnc.socket,
"w"))
- goto cleanup;
+ virDomainGraphicsDefPtr graphics = ctl->def->graphics[i];
+ size_t n;
+
+ for (n = 0; n < graphics->nListens; n++) {
+ virDomainGraphicsListenDef listenObj = graphics->listens[n];
+
+ if (listenObj.type == VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_SOCKET &&
+ listenObj.socket &&
+ vah_add_file(&buf, listenObj.socket, "rw"))
+ goto cleanup;
+ }
}
I would move this hunk to the next patch, since we have not yet started
copying data.vnc.socket to listens.
Jan