[libvirt] [PATCH] Quieten virsh schedinfo for shutoff domain

John Levon john.levon at sun.com
Mon Jan 26 11:27:22 UTC 2009


On Mon, Jan 26, 2009 at 10:54:23AM +0000, Richard W.M. Jones wrote:

> On Thu, Jan 22, 2009 at 05:49:12PM -0800, john.levon at sun.com wrote:
> > +    /*
> > +     * If it's not running, we can't help.
> > +     */
> > +    if (domain->id < 0)
> > +        return NULL;
> 
> NACK.  Unfortunately you shouldn't return from a function without
> setting an error (and you have to set an error exactly once otherwise
> earlier errors get overwritten).
> 
> Perhaps if you want to silence the error, you can silence it in the
> calling code, eg. in virsh, by matching on the appropriate virterror
> fields, eg error->code ?

The calling code isn't in virsh, it's in xen_unified. The XenStore
driver indeed cannot deal with non-running domains. I maintain this is
the correct behaviour for a sub-driver (a driver should certainly set an
error). We already have enough problems with overly eager error
reporting (try a virsh start non-existent-dom !), let's not make it
worse.

regards
john




More information about the libvir-list mailing list