Bug 1124314 - incorrect event reported by QMP on hot plugging an in-use VF to guest
Summary: incorrect event reported by QMP on hot plugging an in-use VF to guest
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm
Version: 6.6
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Marcel Apfelbaum
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-29 08:19 UTC by Chao Yang
Modified: 2014-10-14 07:03 UTC (History)
11 users (show)

Fixed In Version: qemu-kvm-0.12.1.2-2.440.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-10-14 07:03:05 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:1490 normal SHIPPED_LIVE qemu-kvm bug fix and enhancement update 2014-10-14 01:28:27 UTC

Description Chao Yang 2014-07-29 08:19:30 UTC
Description of problem:
Hot plug a VF to guest:
{"execute":"device_add","arguments":{"driver":"pci-assign","host":"0000:04:01.5","id":"hostnet_VF"}}

QMP reports:
{"return": {}} <-- this is expected

Hot plug same VF to guest:
{"execute":"device_add","arguments":{"driver":"pci-assign","host":"0000:04:01.5","id":"VF-1-5"}}

QMP reports:
{"timestamp": {"seconds": 1406621436, "microseconds": 707748}, "event": "DEVICE_DELETED", "data": {"device": "VF-1-5"}}
{"error": {"class": "DeviceInitFailed", "desc": "Device 'pci-assign' could not be initialized", "data": {"device": "pci-assign"}}}

The event is "DEVICE_DELETED" which doesn't describe the act.


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

How reproducible:
100%

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Marcel Apfelbaum 2014-08-11 09:01:55 UTC
Hi Chao,
As you can see in the response: DeviceInitFailed", "desc": "Device 'pci-assign' could not be initialized.

So {"return": {}} can't be expected, there is a problem with the hot plug.

I see here 2 problems:
1. A minor one: The DEVICE_DELETED event is emitted, even if the device is not plugged in the first place.
2. Hot plug of VF fails <-- the big problem.
Do you agree?

Some questions:
1. Does this happen in 6.5? (Is this a regression)
2. Does it work with upstream QEMU?

Thanks,
Marcel

Comment 3 Chao Yang 2014-08-11 10:31:41 UTC
(In reply to Marcel Apfelbaum from comment #2)
> Hi Chao,

Hi Marcel,

> As you can see in the response: DeviceInitFailed", "desc": "Device
> 'pci-assign' could not be initialized.
> 
> So {"return": {}} can't be expected, there is a problem with the hot plug.
> 
> I see here 2 problems:
> 1. A minor one: The DEVICE_DELETED event is emitted, even if the device is
> not plugged in the first place.

Yes, I agree.

> 2. Hot plug of VF fails <-- the big problem.
> Do you agree?
>
Hot plug of same VF fails, this is expected since it has been hot added already.
Therefore I think the problem is item 1. 
 
> Some questions:
> 1. Does this happen in 6.5? (Is this a regression)

No "event": "DEVICE_DELETED" with latest 6.5.z qemu-kvm which is qemu-kvm-0.12.1.2-2.415.el6_5.14.x86_64. So this is a regression.

Adding 'Regression' keyword.

> 2. Does it work with upstream QEMU?
> 
Still worth a try?

> Thanks,
> Marcel

Comment 5 Chao Yang 2014-08-11 10:46:28 UTC
Cannot reproduce on qemu-kvm-427, but reproducible on qemu-kvm-429, I didn't try qemu-kvm-428 since it was deleted.

Comment 8 Marcel Apfelbaum 2014-08-17 19:48:50 UTC
This is not a regression since the DEVICE_DELETED event was not thrown before
this release. It can be see as a new feature with a bug.

The bug itself has little impact on the product but also the fix is no real danger to this version.
I think we can get the fix in.

Comment 9 Jeff Nelson 2014-08-20 20:59:09 UTC
Fix included in qemu-kvm-0.12.1.2-2.440.el6

Comment 11 Chao Yang 2014-08-21 07:50:42 UTC
Verified with qemu-kvm-0.12.1.2-2.440.el6.x86_64.

{"execute":"qmp_capabilities"}
{"return": {}}
{"execute":"device_add","arguments":{"driver":"pci-assign","host":"0000:04:01.0","id":"hostnet_VF"}}
{"return": {}}
{"execute":"device_add","arguments":{"driver":"pci-assign","host":"0000:04:01.0","id":"hostnet"}}
{"error": {"class": "DeviceInitFailed", "desc": "Device 'pci-assign' could not be initialized", "data": {"device": "pci-assign"}}}

As per above, this issue has fixed. 
Moving to VERIFIED.

Comment 12 errata-xmlrpc 2014-10-14 07:03:05 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-1490.html


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