aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2014-09-29 16:07:55 +0200
committerStefan Hajnoczi <stefanha@redhat.com>2014-10-03 10:30:33 +0100
commitfbf28a4328123b3259d100eedc0e6f5b7f8bf186 (patch)
tree18d8f7c2c1ba743c652cede62414f157e8772d47
parent18fe46d79a6de61cb2c379fb610d834ef658d84b (diff)
block: Drop superfluous conditionals around qemu_opts_del()
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 1411999675-14533-1-git-send-email-armbru@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
-rw-r--r--blockdev.c4
-rw-r--r--qemu-img.c4
-rw-r--r--qemu-nbd.c4
3 files changed, 3 insertions, 9 deletions
diff --git a/blockdev.c b/blockdev.c
index ad436488b7..2f441c5343 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -224,9 +224,7 @@ void drive_info_del(DriveInfo *dinfo)
if (!dinfo) {
return;
}
- if (dinfo->opts) {
- qemu_opts_del(dinfo->opts);
- }
+ qemu_opts_del(dinfo->opts);
g_free(dinfo->id);
QTAILQ_REMOVE(&drives, dinfo, next);
g_free(dinfo->serial);
diff --git a/qemu-img.c b/qemu-img.c
index ea4bbae546..27b85dbda4 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -1736,9 +1736,7 @@ out:
qemu_opts_del(opts);
qemu_opts_free(create_opts);
qemu_vfree(buf);
- if (sn_opts) {
- qemu_opts_del(sn_opts);
- }
+ qemu_opts_del(sn_opts);
if (out_bs) {
bdrv_unref(out_bs);
}
diff --git a/qemu-nbd.c b/qemu-nbd.c
index fa603382d4..b524b3420f 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -778,9 +778,7 @@ int main(int argc, char **argv)
unlink(sockpath);
}
- if (sn_opts) {
- qemu_opts_del(sn_opts);
- }
+ qemu_opts_del(sn_opts);
if (device) {
void *ret;