Message ID | 1398762521-25733-12-git-send-email-cyliu@suse.com |
---|---|
State | New |
Headers | show |
On Tue, Apr 29, 2014 at 05:08:20PM +0800, Chunyan Liu wrote: > To simplify later using of qemu_opts_del, accept NULL input. > > Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> > Reviewed-by: Eric Blake <eblake@redhat.com> > Signed-off-by: Chunyan Liu <cyliu@suse.com> Reviewed-by: Leandro Dorileo <l@dorileo.org> > --- > util/qemu-option.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/util/qemu-option.c b/util/qemu-option.c > index 4de99b3..2667e16 100644 > --- a/util/qemu-option.c > +++ b/util/qemu-option.c > @@ -1010,6 +1010,10 @@ void qemu_opts_del(QemuOpts *opts) > { > QemuOpt *opt; > > + if (opts == NULL) { > + return; > + } > + > for (;;) { > opt = QTAILQ_FIRST(&opts->head); > if (opt == NULL) > -- > 1.8.4.5 > >
diff --git a/util/qemu-option.c b/util/qemu-option.c index 4de99b3..2667e16 100644 --- a/util/qemu-option.c +++ b/util/qemu-option.c @@ -1010,6 +1010,10 @@ void qemu_opts_del(QemuOpts *opts) { QemuOpt *opt; + if (opts == NULL) { + return; + } + for (;;) { opt = QTAILQ_FIRST(&opts->head); if (opt == NULL)