Bug 1414734
Summary: | q35 chipset - hotplugged devices do not show up in VM | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Martin Tessun <mtessun> |
Component: | qemu-kvm-rhev | Assignee: | Marcel Apfelbaum <marcel> |
Status: | CLOSED DUPLICATE | QA Contact: | jingzhao <jinzhao> |
Severity: | high | Docs Contact: | |
Priority: | high | ||
Version: | 7.4 | CC: | chayang, hhuang, jinzhao, juzhang, laine, virt-maint |
Target Milestone: | rc | ||
Target Release: | 7.4 | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2017-02-10 14:39:04 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Martin Tessun
2017-01-19 10:49:55 UTC
Hi Laine, Can you please have a look on virsh usage to see if there are any issues? Specifically: "attach-interface --domain rhel72-q35 --type network --source default --model virtio --live" Is this the "right way" to do it? It seems to be a 'simple' hotplug operation, how libvirt will do it? Thanks, Marcel The libvirt you're using is too old to have the code that properly places devices on a pcie-root-port rather than on a pci-bridge slot. RHEL 7.3 doesn't have any of that. See Bug 1330024. Without those patches, in order to properly do hotplug on Q35, you'll need to take a couple of extra steps: 1) add at least one unused pcie-root-port to the domain config while the guest is shutdown. You can do this with "virsh edit", adding something like this inside the <devices> element: <controller type='pci' model='pci-root-port'/> Add as many root-ports as the number of devices you think you will want to hot-plug. 2) run "virsh dumpxml" on the domain, and note the value of the "index" attribute that was assigned to the new pcie-root-ports you added. 3) start the guest 4) create an XML file for the device you want to hotplug, e.g.: <interface type='network'> <source network='default'/> <model type='virtio'/> <address type='pci' bus='N'/> </interface> where "N" is the index value from one of the newly added pcie-root-ports. 5) instead of "virsh attach-interface ..." use "virsh attach-device" NB: if you specify "--live" but not "--config" on the commandline, the device will be attached to the current running guest instance, but won't be added to the persistent domain config, so the next time you start the guest the new device will be gone. Additionally, since this is an interface device, a new random MAC address will be generated for the device each time this is done, and the guest OS's config will get cluttered with lots of netdev config (since it will think that it's a completely new device each time). If the above works, then we should either close this as NOTABUG, or as a duplicate of Bug 1330024 (In reply to Laine Stump from comment #2) > The libvirt you're using is too old to have the code that properly places > devices on a pcie-root-port rather than on a pci-bridge slot. RHEL 7.3 > doesn't have any of that. See Bug 1330024. > > Without those patches, in order to properly do hotplug on Q35, you'll need > to take a couple of extra steps: > > 1) add at least one unused pcie-root-port to the domain config while the > guest is shutdown. You can do this with "virsh edit", adding something like > this inside the <devices> element: > > > <controller type='pci' model='pci-root-port'/> > > Add as many root-ports as the number of devices you think you will want to > hot-plug. Ok. This must be pcie-root-port. So I added one controller via: <controller type='pci' model='pcie-root-port'/> This one got index='3' at startup. > > 2) run "virsh dumpxml" on the domain, and note the value of the "index" > attribute that was assigned to the new pcie-root-ports you added. > > 3) start the guest > > 4) create an XML file for the device you want to hotplug, e.g.: > > <interface type='network'> > <source network='default'/> > <model type='virtio'/> > <address type='pci' bus='N'/> > </interface> > > where "N" is the index value from one of the newly added pcie-root-ports. > > 5) instead of "virsh attach-interface ..." use "virsh attach-device" > So done this and it works as expected, so the device was hotplugged as expected. > If the above works, then we should either close this as NOTABUG, or as a > duplicate of Bug 1330024 *** This bug has been marked as a duplicate of bug 1330024 *** |