From: Fiona Ebner <f.ebner@proxmox.com>
To: Dominik Csapak <d.csapak@proxmox.com>, pve-devel@lists.proxmox.com
Subject: Re: [PATCH qemu-server 1/6] tests: hotplug: add initial hotplug test harness
Date: Mon, 14 Sep 2026 10:05:21 +0200 [thread overview]
Message-ID: <17c26d82-8068-4a5b-8120-a8507fc34319@proxmox.com> (raw)
In-Reply-To: <ceecc432-1440-467a-95da-253b5662a741@proxmox.com>
Am 11.09.26 um 12:08 PM schrieb Dominik Csapak:
> On 9/10/26 4:24 PM, Fiona Ebner wrote:
>> Am 10.09.26 um 1:09 PM schrieb Dominik Csapak:
> [snip]>> +
>>> +# the hotplug helpers wait between retries when verifying
>>> (un)plugged devices, do not wait in tests
>>> +BEGIN {
>>> + *CORE::GLOBAL::sleep = sub { return 0; };
>>> +}
>>
>> Why is this necessary in the tests? We control whether adding or
>> removing a device works in the tests, so I feel like this sweeps
>> something under the rug that we could improve in qemu-server. Does
>> qemu-server (sometimes) call {add,del}verify() when {add,del}() failed?
>
>
> The issue here is the hmp device_add call does not fail directly,
> but returns the text (which can contain an error) so we always
> call verify after (and when testing the hotplug issues etc. this is what
> fails, not the device_add)
>
> IMO in the long-term we should not use the hmp calls at all which would
> clean this up a bit, but in the meantime not overriding the sleep here
> just makes the tests longer for the variants where the adding fails..
>
> Not sure what exactly can come back from a hmp call, so treating all
> non-empty returned strings as an error has a bit of regression potential.
I suppose we could match for 'Error:' since hmp_handle_error() adds that
prefix. But fully agree, in the long run, not using
human-monitor-command, but the direct QMP calls is better :)
I'm fine with keeping the hack, but please add a comment.
>
>
> [snip]>> +
>>> +# The buses a machine provides on its own. Everything else (PCI
>>> bridges, SCSI and USB controllers)
>>> +# comes from devices on the command line or from the config files
>>> read via -readconfig.
>>> +sub machine_buses($conf, $machine) {
>>
>> default_buses_for_machine(). Can't we somehow get this from qemu-server?
>> I'd like to avoid the need to duplicate/hard-code this here.
>>
>
> aside from starting a vm and querying with qmp (which i think
> is overkill) i'm not aware of any way how to get that info out
> of qemu.
Okay, fair :)
>
>>> + return { map { $_ => 1 } qw(pcie.0) } if $machine =~ m/^virt/;
>>> + return { map { $_ => 1 } ('pcie.0', map { "ide.$_" } 0 .. 5) }
>>> + if PVE::QemuServer::Machine::machine_type_is_q35($conf);
>>> + return { map { $_ => 1 } qw(pci.0 ide.0 ide.1) };
>>> +}
>>> +
> [snip]
>>> +
>>> +# QEMU resolves the unversioned aliases 'pc', 'q35' and 'virt' to
>>> the versioned default machine of
>>> +# the running binary, which is also what query-machines reports for
>>> the running VM. The pve version
>>> +# is kept as it was requested on the command line.
>>> +sub resolve_machine_alias($machine) {
>>
>> Can't you use the windows_get_pinned_machine_version() function here?
>> I'd like to avoid duplicate fucntions for things that already exist. We
>> could also drop the 'windows_' prefix if we want, the function itself is
>> not concerned with that, we just use it only for Windows.
>>
>
> it's hard because we get here the +pveX prefix sometimes, but
> windows_get_pinned_machine_verions does not work with that, and possibly
> adds one itself, so we'd have to check for that afterwards too
>
> not sure this is worth it just to save on one extra aliias list?
>
> i also don't see an obvious way to restructure the machine code
> to achieve what we want here
>
> basically we sometimes get here 'pc+pve0' but actually want
> 'pc-i440fx-X.Y+pve0'
>
> I'll try though
Thanks! If it doesn't work out, I'm fine with keeping the current one.
next prev parent reply other threads:[~2026-09-14 8:05 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-10 11:00 [PATCH qemu-server 0/6] add hotplug tests and fix uncovered bugs Dominik Csapak
2026-09-10 11:00 ` [PATCH qemu-server 1/6] tests: hotplug: add initial hotplug test harness Dominik Csapak
2026-09-10 14:24 ` Fiona Ebner
2026-09-11 10:08 ` Dominik Csapak
2026-09-14 8:05 ` Fiona Ebner [this message]
2026-09-10 11:00 ` [PATCH qemu-server 2/6] tests: hotplug: add some test cases Dominik Csapak
2026-09-10 14:24 ` Fiona Ebner
2026-09-11 10:11 ` Dominik Csapak
2026-09-14 8:09 ` Fiona Ebner
2026-09-10 11:00 ` [PATCH qemu-server 3/6] tests: hotplug: add cases for known defects Dominik Csapak
2026-09-10 11:00 ` [PATCH qemu-server 4/6] tests: hotplug: add test case for adding scsi14 on qemu 11.1 Dominik Csapak
2026-09-10 11:00 ` [PATCH qemu-server 5/6] hotplug: fix vm_deviceplug call for 'tablet' and 'keyboard' on aarch64 Dominik Csapak
2026-09-10 11:00 ` [PATCH qemu-server 6/6] hotplug: remove iothread if adding drive device failed Dominik Csapak
2026-09-14 8:58 ` superseded: [PATCH qemu-server 0/6] add hotplug tests and fix uncovered bugs Dominik Csapak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=17c26d82-8068-4a5b-8120-a8507fc34319@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=d.csapak@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox