RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 603851 - QMP: Can't reuse same 'id' when netdev_add fails
Summary: QMP: Can't reuse same 'id' when netdev_add fails
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm
Version: 6.0
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Markus Armbruster
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 559201
TreeView+ depends on / blocked
 
Reported: 2010-06-14 17:23 UTC by Luiz Capitulino
Modified: 2013-01-09 22:44 UTC (History)
6 users (show)

Fixed In Version: qemu-kvm-0.12.1.2-2.86.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-07-08 05:36:44 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Luiz Capitulino 2010-06-14 17:23:33 UTC
Description of problem:

If the netdev_add command fails, the 'id' issued with it is not freed and can't be reused in subsequent calls.

Version-Release number of selected component (if applicable):
qemu-kvm-0.12.1.2-2.73.el6

How reproducible:


Steps to Reproduce:
1. Run qemu-kvm with a QMP connection:

# qemu-kvm [...] -qmp tcp:localhost:4444,server

2. Connect with telnet and issue the capabilities command:

$ telnet localhost 4444
{ "execute": "qmp_capabilities" }

2. Issue an obviously wrong netdev_add command

{ "execute": "netdev_add", "arguments": { "type": "foobar", "id": "netdev1" } }

3. Issue the right one

{ "execute": "netdev_add", "arguments": { "type": "user", "id": "netdev1" } }

Actual results:

The valid command fails.

Expected results:

It should work, there's no reason to fail.

Additional info:

I have the impression that 'id' is leaking, but I didn't investigate further.

Comment 1 RHEL Program Management 2010-06-14 17:42:56 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.

Comment 2 Luiz Capitulino 2010-06-21 17:34:38 UTC
A patch to fix this issue has been submitted upstream:

http://lists.gnu.org/archive/html/qemu-devel/2010-06/msg02553.html

Comment 6 juzhang 2010-07-08 05:35:25 UTC
Reproduced on qemu-kvm-0.12.1.2-2.77.el6

Using the verification steps
After step4
{"error": {"class": "DuplicateId", "desc": "Duplicate ID 'hostnet2' for netdev", "data": {"object": "netdev", "id": "hostnet2"}}}

Verified on qemu-kvm-0.12.1.2-2.90.el6,pass

Steps:
1. boot guest enable qmp
#/usr/libexec/qemu-kvm -m 4G -smp 4 -drive file=/root/zhangjunyi/rhel6.64.qcow2,if=none,id=drive-virtio-disk0,boot=on,cache=none,format=qcow2 -device virtio-blk-pci,bus=pci.0,drive=drive-virtio-disk0,id=virtio-disk0  -device virtio-balloon-pci -cpu qemu64,+sse2,+x2apic -monitor stdio -vnc :10 -qmp tcp:0:4445,server,nowait -drive file=/root/zhangjunyi/boot.iso,if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,drive=drive-ide0-1-0 -boot order=cdn,menu=on -net none
2.Connect with telnet and issue the capabilities command:
$ telnet 10.66.91.89 4444
{ "execute": "qmp_capabilities" }
3.Issue an obviously wrong netdev_add command
{ "execute": "netdev_add", "arguments": { "type":"tap1","id":"hostnet2"}}

4. Issue the right one

{ "execute": "netdev_add", "arguments": { "type":"tap","id":"hostnet2"}}

5. repeat step4

{ "execute": "netdev_add", "arguments": { "type":"tap","id":"hostnet2"}}

Results:
After step3
{"error": {"class": "InvalidParameterValue", "desc": "Parameter 'type' expects a netdev backend type", "data": {"name": "type", "expected": "a netdev backend type"}}}

After step4
{"return": {}},hostnet2 was added.
(qemu) info network 
VLAN 0 devices:
Devices not on any VLAN:
  hostnet2: ifname=tap0,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown

After step5
{"error": {"class": "DuplicateId", "desc": "Duplicate ID 'hostnet2' for netdev", "data": {"object": "netdev", "id": "hostnet2"}}}

Comment 7 juzhang 2010-07-08 05:36:44 UTC
according to comment6,close this issue.


Note You need to log in before you can comment on or make changes to this bug.