Skip to content
  • Stefan Hajnoczi's avatar
    net: Reject non-netdevs in qmp_netdev_del() · 645c9496
    Stefan Hajnoczi authored
    
    
    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: default avatarStefan Hajnoczi <stefanha@redhat.com>
    645c9496