To simplify later using of qemu_opts_del, accept NULL input.
Reviewed-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Chunyan Liu <[email protected]>
---
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