[libvirt] [PATCH 2/9] Add a <graphics> type for SPICE protocol

Daniel P. Berrange berrange at redhat.com
Tue Nov 9 11:05:44 UTC 2010


On Mon, Nov 08, 2010 at 04:20:51PM -0700, Eric Blake wrote:
> On 11/08/2010 12:27 PM, Daniel P. Berrange wrote:
> > This adds an element
> > 
> >  <graphics type='spice' port='5903' tlsPort='5904' autoport='yes' listen='127.0.0.1'/>
> > 
> > This is the bare minimum that should be exposed in the guest
> > config for SPICE. Other parameters are better handled as per
> > host level configuration tunables
> > 
> > @@ -3214,6 +3221,50 @@ virDomainGraphicsDefParseXML(xmlNodePtr node, int flags) {
> >              def->data.desktop.fullscreen = 0;
> >  
> >          def->data.desktop.display = virXMLPropString(node, "display");
> > +    } else if (def->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE) {
> > +        char *port = virXMLPropString(node, "port");
> > +        char *tlsPort;
> > +        char *autoport;
> > +
> > +        if (port) {
> > +            if (virStrToLong_i(port, NULL, 10, &def->data.spice.port) < 0) {
> > +                virDomainReportError(VIR_ERR_INTERNAL_ERROR,
> > +                                     _("cannot parse spice port %s"), port);
> > +                VIR_FREE(port);
> > +                goto error;
> > +            }
> 
> Still missing validation that data.spice.port got assigned something
> less than 0x10000.  But I'm not sure it should hold up the series.
> 
> > @@ -544,6 +545,14 @@ struct _virDomainGraphicsDef {
> >              char *display;
> >              unsigned int fullscreen :1;
> >          } desktop;
> > +        struct {
> > +            int port;
> > +            int tlsPort;
> > +            char *listenAddr;
> 
> No response to my question in 3/10 about whether we should use
> virSocketAddr instead of a raw string?
> https://www.redhat.com/archives/libvir-list/2010-November/msg00154.html

Sorry, I meant to reply to that patch. Basically my goal was to make the
SPICE stuff look the same as the VNC stuff. All the issues you raise
apply to the VNC stuff, and even to other parts of the domain_conf.h
like chardevs. So we mass port to virSocketAddr would be nicer.


Daniel
-- 
|: Red Hat, Engineering, London    -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :|
|: http://autobuild.org        -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|




More information about the libvir-list mailing list