Skip to content
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

Current implementation on qom/qmp hook are not useful on change device config. #1583

Closed
eebssk1 opened this issue Jan 17, 2025 · 2 comments
Closed

Comments

@eebssk1
Copy link

eebssk1 commented Jan 17, 2025

I was trying to change a nic setting via qmp since it's dynamically added.
However it failed to do so.

Failed to run QMP command {"arguments":{"path":"/machine/peripheral/dev-incus_eth0","property":"guest_rsc_ext","value":true},"execute":"qom-set"} at pre-start stage: Attempt to set property 'guest_rsc_ext' on anonymous device (type 'virtio-net-device') after it was realized

It looks like the config is locked as const after adding.

Probably It is better to add a config option that allow adding extra args/keyvalue to such command for each (dynamic) device, just like raw.qemu.conf

@stgraber
Copy link
Member

That's why we have the QEMU scriptlet support and extra logic being added as part of #1400

I personally have a few weird VMs (ESXi) which use the scriptlet hook to get some of the existing NIC properties, then remove the current entries and add them back with differing config (driver in my case), then kick a VM reboot to have the config be properly active.

The work that @bensmrs is doing in #1400 will make some of that even easier.

For complex cases we've found the scriptlet method to be the more flexible and reliable option as every time we tried to put some logic around messing with QMP/QOM objects we've kept running into timing issues, limitations and the like...

@bensmrs
Copy link
Contributor

bensmrs commented Jan 17, 2025

I was trying to change a nic setting via qmp since it's dynamically added.

Veeeery few changes are allowed on devices once they are realized. And working with NICs this way can prove very challenging.

It looks like the config is locked as const after adding.

Welcome to QMP hell :)

Probably It is better to add a config option that allow adding extra args/keyvalue to such command for each (dynamic) device, just like raw.qemu.conf

I wouldn’t say “better”, as there are (very niche) cases where it actually works the way we want.

The work that @bensmrs is doing in #1400 will make some of that even easier.

Yeah, you’ll be able to patch your device at the newly-introduced config stage when the PR is reviewed. Just wait for the next release :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants