Message ID | 1397152467-17186-11-git-send-email-cyliu@suse.com |
---|---|
State | New |
Headers | show |
On Fri, Apr 11, 2014 at 01:54:06AM +0800, Chunyan Liu wrote: > To simplify later using of qemu_opts_del, accept NULL input. > > Reviewed-by: Eric Blake <eblake@redhat.com> > Signed-off-by: Chunyan Liu <cyliu@suse.com> > --- > util/qemu-option.c | 4 ++++ > 1 file changed, 4 insertions(+) Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
diff --git a/util/qemu-option.c b/util/qemu-option.c index d1e4d94..6222cd6 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)