net: delete QemuOpts when net_client_init() fails.
authorYoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp>
Mon, 21 Jun 2010 01:41:36 +0000 (10:41 +0900)
committerLuiz Capitulino <lcapitulino@redhat.com>
Thu, 1 Jul 2010 17:27:13 +0000 (14:27 -0300)
commitd44ec6a3b52a05b49139d6e6d5a915c280f1edc4
treea2757a108b6f7490b4cb668d42e2d24607e3c26f
parent662d8e33f79563e95ad393000575c1345e595945
net: delete QemuOpts when net_client_init() fails.

This fixes the following scenario using QMP.

First, put a bogus argument "foo" to "type", which results in an error.
{"execute": "netdev_add", "arguments": { "type": "foo", "id": "netdev1" } }
Then, call it again with correct argument "user".
{"execute": "netdev_add", "arguments": { "type": "user", "id": "netdev1" } }
This results in "DuplicatedId" error.

Because the first command was invalid, it should be able to reuse the
same "id", and the second command should work.

Reported-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
net.c