Re: [libvirt] [PATCH v5 1/6] graphics: introduce listen type socket and use it for VNC
On Wed, May 25, 2016 at 10:32:02AM +0200, Christophe Fergeau wrote: > On Tue, May 24, 2016 at 04:45:53PM +0200, Pavel Hrdina wrote: > > Introduce a new listen type that will be used to tell a graphics device > > to listen on unix socket and use it for VNC graphics instead of socket > > attribute. The socket attribute will remain in the XML for backward > > compatibility. > > > > Since old libvirt supports 'socket' attribute inside 'graphics' element > > for socket path provided by user libvirt will generate migratable XML > > without that listen type='socket' but only with 'socket' attribute in > > order to be able to migrate back to old libvirt. > > > > Signed-off-by: Pavel Hrdina> > diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in > > index 72bfa35..91f41db 100644 > > --- a/docs/formatdomain.html.in > > +++ b/docs/formatdomain.html.in > > @@ -5349,6 +5349,22 @@ qemu-kvm -net nic,model=? /dev/null > >of the first forward dev will be used. > > > > > > + socket since 1.3.5 > > + > > + > > + This listen type tells a graphics server to listen on unix > > socket. > > + Attribute socket contains a path to unix socket. If > > this > > + attribute is omitted libvirt will generate this path for you. > > + Supported by graphics type vnc. > > + > > + > > + For vnc graphics be backward compatible > > + the socket attribute of first listen > > element > > + is duplicated as socket attribute in > > graphics > > + element. If graphics element contains a > > socket > > + attribute all listen elements are ignored. > > + > > + > > > > > > Video devices > > diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng > > index 903fd7e..60f9f52 100644 > > --- a/docs/schemas/domaincommon.rng > > +++ b/docs/schemas/domaincommon.rng > > @@ -2971,6 +2971,16 @@ > > > > > > > > + > > + > > + socket > > + > > + > > + > > + > > + > > + > > + > > > > > > > > Reiterating an old comment on this new version, but I really think > "type" should be "unix" rather than "socket" for consistency reasons. > Less strong feelings on "socket" VS "path" for the associated attribute > name. Yes, I know about your comment but like I've already replied, I would prefer "socket" for consistency reasons. I would use "unix" if we had a "tcp" instead of "address". All other occurrences in our XML have "tcp", "udp" and "unix" but in case of listens we have "address", "network" and "none" and I think that "socket" fits better than "unix". I'm not arguing that "unix" would be more correct description, but "socket" isn't completely wrong. Pavel -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v5 1/6] graphics: introduce listen type socket and use it for VNC
On Tue, May 24, 2016 at 04:45:53PM +0200, Pavel Hrdina wrote: > Introduce a new listen type that will be used to tell a graphics device > to listen on unix socket and use it for VNC graphics instead of socket > attribute. The socket attribute will remain in the XML for backward > compatibility. > > Since old libvirt supports 'socket' attribute inside 'graphics' element > for socket path provided by user libvirt will generate migratable XML > without that listen type='socket' but only with 'socket' attribute in > order to be able to migrate back to old libvirt. > > Signed-off-by: Pavel Hrdina> diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in > index 72bfa35..91f41db 100644 > --- a/docs/formatdomain.html.in > +++ b/docs/formatdomain.html.in > @@ -5349,6 +5349,22 @@ qemu-kvm -net nic,model=? /dev/null >of the first forward dev will be used. > > > + socket since 1.3.5 > + > + > + This listen type tells a graphics server to listen on unix socket. > + Attribute socket contains a path to unix socket. If > this > + attribute is omitted libvirt will generate this path for you. > + Supported by graphics type vnc. > + > + > + For vnc graphics be backward compatible > + the socket attribute of first listen > element > + is duplicated as socket attribute in > graphics > + element. If graphics element contains a > socket > + attribute all listen elements are ignored. > + > + > > > Video devices > diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng > index 903fd7e..60f9f52 100644 > --- a/docs/schemas/domaincommon.rng > +++ b/docs/schemas/domaincommon.rng > @@ -2971,6 +2971,16 @@ > > > > + > + > + socket > + > + > + > + > + > + > + > > > Reiterating an old comment on this new version, but I really think "type" should be "unix" rather than "socket" for consistency reasons. Less strong feelings on "socket" VS "path" for the associated attribute name. Christophe signature.asc Description: PGP signature -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH v5 1/6] graphics: introduce listen type socket and use it for VNC
Introduce a new listen type that will be used to tell a graphics device to listen on unix socket and use it for VNC graphics instead of socket attribute. The socket attribute will remain in the XML for backward compatibility. Since old libvirt supports 'socket' attribute inside 'graphics' element for socket path provided by user libvirt will generate migratable XML without that listen type='socket' but only with 'socket' attribute in order to be able to migrate back to old libvirt. Signed-off-by: Pavel Hrdina--- docs/formatdomain.html.in | 16 +++ docs/schemas/domaincommon.rng | 10 ++ src/conf/domain_conf.c | 152 ++--- src/conf/domain_conf.h | 8 +- src/libvirt_private.syms | 1 + src/qemu/qemu.conf | 6 +- src/qemu/qemu_command.c| 58 src/qemu/qemu_domain.c | 28 ++-- src/qemu/qemu_hotplug.c| 9 ++ src/qemu/qemu_parse_command.c | 2 +- src/qemu/qemu_process.c| 45 -- src/security/virt-aa-helper.c | 15 +- ...ric-graphics-vnc-socket-attr-listen-address.xml | 30 ...hics-vnc-socket-attr-listen-socket-mismatch.xml | 30 ...eric-graphics-vnc-socket-attr-listen-socket.xml | 30 ...ric-graphics-vnc-socket-attr-listen-address.xml | 30 ...eric-graphics-vnc-socket-attr-listen-socket.xml | 30 .../generic-graphics-vnc-socket-listen.xml | 4 +- .../generic-graphics-vnc-socket.xml| 4 +- tests/genericxml2xmltest.c | 4 + .../qemuargv2xml-graphics-vnc-socket.xml | 4 +- .../qemuxml2argv-graphics-vnc-auto-socket.args | 20 +++ .../qemuxml2argv-graphics-vnc-auto-socket.xml | 30 .../qemuxml2argv-graphics-vnc-socket.args | 4 +- .../qemuxml2argv-graphics-vnc-socket.xml | 10 +- tests/qemuxml2argvtest.c | 2 + .../qemuxml2xmlout-graphics-vnc-auto-socket.xml| 35 + ...graphics-vnc-remove-generated-socket-active.xml | 4 +- .../qemuxml2xmlout-graphics-vnc-socket.xml | 35 + tests/qemuxml2xmltest.c| 2 + 30 files changed, 564 insertions(+), 94 deletions(-) create mode 100644 tests/genericxml2xmlindata/generic-graphics-vnc-socket-attr-listen-address.xml create mode 100644 tests/genericxml2xmlindata/generic-graphics-vnc-socket-attr-listen-socket-mismatch.xml create mode 100644 tests/genericxml2xmlindata/generic-graphics-vnc-socket-attr-listen-socket.xml create mode 100644 tests/genericxml2xmloutdata/generic-graphics-vnc-socket-attr-listen-address.xml create mode 100644 tests/genericxml2xmloutdata/generic-graphics-vnc-socket-attr-listen-socket.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-auto-socket.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-auto-socket.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-vnc-auto-socket.xml create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-vnc-socket.xml diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 72bfa35..91f41db 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -5349,6 +5349,22 @@ qemu-kvm -net nic,model=? /dev/null of the first forward dev will be used. + socket since 1.3.5 + + + This listen type tells a graphics server to listen on unix socket. + Attribute socket contains a path to unix socket. If this + attribute is omitted libvirt will generate this path for you. + Supported by graphics type vnc. + + + For vnc graphics be backward compatible + the socket attribute of first listen element + is duplicated as socket attribute in graphics + element. If graphics element contains a socket + attribute all listen elements are ignored. + + Video devices diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 903fd7e..60f9f52 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -2971,6 +2971,16 @@ + + + socket + + + + + + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index fb05bf7..bbbf67c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -561,7 +561,8 @@ VIR_ENUM_IMPL(virDomainGraphics, VIR_DOMAIN_GRAPHICS_TYPE_LAST, VIR_ENUM_IMPL(virDomainGraphicsListen, VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_LAST,