[libvirt] [PATCH 5/8] Introduce generic RPC server objects

Daniel P. Berrange berrange at redhat.com
Thu Dec 16 11:36:35 UTC 2010


On Thu, Dec 09, 2010 at 04:09:20PM -0700, Eric Blake wrote:
> On 12/01/2010 10:26 AM, Daniel P. Berrange wrote:
> > +
> > +    if (virNetServerProgramDispatch(prog,
> > +                                    srv,
> > +                                    job->client,
> > +                                    job->msg) < 0) {
> > +        job->msg = NULL;
> > +        goto error;
> > +    }
> 
> Should this call be run while the virNetServerLock is still held, or
> should we drop and reacquire the lock to allow other virNetServer
> threads to make progress during the arbitrarily long dispatch?

Yes, the new posting does proper lock drop+reacquire now.

> > +#if 0
> > +    reprocess:
> > +        for (i = 0 ; i < srv->nclients ; i++) {
> > +            int inactive;
> 
> Any reason to keep this block of code, since you commented it out?

Yep, I uncommented it now and made it work

> > +static void
> > +virNetServerProgramFormatError(virNetServerProgramPtr prog,
> > +                               void *rerr,
> > +                               int code,
> > +                               const char *fmt,
> > +                               ...)
> > +{
> > +    va_list args;
> > +    char msgbuf[1024];
> > +    char *msg = msgbuf;
> > +
> > +    va_start(args, fmt);
> > +    vsnprintf(msgbuf, sizeof msgbuf, fmt, args);
> 
> Should we do something special if the message got truncated at
> sizeof(msgbuf)?

This and all similar methods have gone. We use normal
internal error reporting APIs in libvirtd now.

Daniel




More information about the libvir-list mailing list