[libvirt] PATCH: Fix NULL checks in openvz driver
Daniel Veillard
veillard at redhat.com
Mon Sep 8 10:35:55 UTC 2008
On Mon, Sep 08, 2008 at 11:51:28AM +0200, Jim Meyering wrote:
> "Daniel P. Berrange" <berrange at redhat.com> wrote:
> > On Fri, Sep 05, 2008 at 05:40:16PM +0200, Jim Meyering wrote:
> ...
> >> All looks correct.
> >> However, I'm a little nervous about hard-coding those '[3]'s.
> >> What if someone inserts a new --foo option somewhere before
> >> the NULL place-holder, or otherwise rearranges the options?
> >> Then we'll have to remember to update that "3" below to e.g., "4".
> >> Easy to miss that...
> >
> > I just realized there is a much simpler way todo this...
> ...
> > - const char *prog[] = {VZCTL, "--quiet", "stop", vm->def->name, NULL};
> > + const char *prog[] = {VZCTL, "--quiet", "stop", vm ? vm->def->name : NULL, NULL};
>
> Ahh... much better ;-)
> ACK
Okay, fine by me too !
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel at veillard.com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
More information about the libvir-list
mailing list