diff options
| author | Chunyan Liu | 2014-06-05 11:20:50 +0200 |
|---|---|---|
| committer | Stefan Hajnoczi | 2014-06-16 11:23:20 +0200 |
| commit | 4782183da39ec988b8290bbc0289c9f50ba33ea4 (patch) | |
| tree | e08f694a079cf365736e24aaa58f55422ecfb227 | |
| parent | QemuOpts: add qemu_opts_append to replace append_option_parameters (diff) | |
| download | qemu-4782183da39ec988b8290bbc0289c9f50ba33ea4.tar.gz qemu-4782183da39ec988b8290bbc0289c9f50ba33ea4.tar.xz qemu-4782183da39ec988b8290bbc0289c9f50ba33ea4.zip | |
QemuOpts: check NULL input for qemu_opts_del
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>
Reviewed-by: Leandro Dorileo <l@dorileo.org>
Signed-off-by: Chunyan Liu <cyliu@suse.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
| -rw-r--r-- | util/qemu-option.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/util/qemu-option.c b/util/qemu-option.c index 6acfb0eb41..40e1ff384a 100644 --- a/util/qemu-option.c +++ b/util/qemu-option.c @@ -1011,6 +1011,10 @@ void qemu_opts_del(QemuOpts *opts) { QemuOpt *opt; + if (opts == NULL) { + return; + } + for (;;) { opt = QTAILQ_FIRST(&opts->head); if (opt == NULL) |
