]> git.proxmox.com Git - qemu.git/commit
net: Reject non-netdevs in qmp_netdev_del()
authorStefan Hajnoczi <stefanha@redhat.com>
Wed, 24 Oct 2012 12:34:12 +0000 (14:34 +0200)
committerStefan Hajnoczi <stefanha@redhat.com>
Thu, 1 Nov 2012 10:05:57 +0000 (11:05 +0100)
commit645c9496f7083c105ecd32f32532496af6aadf62
tree06ccb22d23f9ba29ef073367d5fe926d7ef7e7c6
parentf0e3ac70341febed02591b61b579723279783053
net: Reject non-netdevs in qmp_netdev_del()

The netdev_del command crashes when given a -net device, because it
calls qemu_opts_del(NULL).

Check that this is a -netdev before attempting to delete it and the
QemuOpts.

Note the subtle change from qemu_find_opts_err("netdev", errp) to
qemu_find_opts_err("netdev", NULL).  Since "netdev" is a built in
options group and we don't check for NULL return anyway, there's no use
in passing errp here.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
net.c