-
Notifications
You must be signed in to change notification settings - Fork 179
Disable interface multiqueue when starting guest with virtqemud in foreground mode #6558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -40,8 +40,18 @@ def run_shutdown_console(params, libvirtd, vm): | |||||||||||||||||||||||||||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| Start a vm with console connected and then shut it down. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| vm.start(autoconsole=True) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| vm.shutdown() | ||||||||||||||||||||||||||||||||||||||||||||||||||
| vm_xml = VMXML.new_from_inactive_dumpxml(vm.name) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| vm_xml_backup = vm_xml.copy() | ||||||||||||||||||||||||||||||||||||||||||||||||||
| try: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| iface = vm_xml.get_devices(device_type="interface")[0] | ||||||||||||||||||||||||||||||||||||||||||||||||||
| driver_dict = dict(iface.driver.driver_attr) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| driver_dict['queues'] = '1' | ||||||||||||||||||||||||||||||||||||||||||||||||||
| iface.driver = iface.new_driver(driver_attr=driver_dict) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| virsh.update_device(vm.name, iface.xml, debug=True) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| vm.start(autoconsole=True) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| vm.shutdown() | ||||||||||||||||||||||||||||||||||||||||||||||||||
| finally: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| vm_xml_backup.sync() | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+46
to
55
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix: update persistent XML instead of calling virsh.update_device with raw XML (and missing --config).
Apply this diff to persist the change before boot and wait for shutdown: - iface = vm_xml.get_devices(device_type="interface")[0]
- driver_dict = dict(iface.driver.driver_attr)
- driver_dict['queues'] = '1'
- iface.driver = iface.new_driver(driver_attr=driver_dict)
- virsh.update_device(vm.name, iface.xml, debug=True)
- vm.start(autoconsole=True)
- vm.shutdown()
+ # Disable NIC multiqueue persistently to avoid AVC attach_queue when qemu runs in foreground.
+ devices = vm_xml.devices
+ for dev in devices:
+ if getattr(dev, "device_tag", "") == "interface":
+ driver_attr = dict(getattr(getattr(dev, "driver", None), "driver_attr", {}) or {})
+ driver_attr["queues"] = "1"
+ dev.driver = dev.new_driver(driver_attr=driver_attr)
+ break
+ vm_xml.devices = devices
+ vm_xml.sync()
+ vm.start(autoconsole=True)
+ vm.shutdown()
+ vm.wait_for_shutdown()📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| def run_restart_console(params, libvirtd, vm): | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We used to have this workaround for managed save tests. Would you like to consider it ?
I also want to make sure if the current fix is a workaround, would it be removed someday ? If so, maybe we could consider adding a comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ac0d56b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's not a workaround since selinux-policy does not support running daemons from cli.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. I mean we could replace the 5 lines with
libvirt_vmxml.modify_vm_deviceif it's simply modifying vmxml