From: Fiona Ebner <f.ebner@proxmox.com>
To: Dominik Csapak <d.csapak@proxmox.com>, pve-devel@lists.proxmox.com
Subject: Re: [PATCH qemu-server v4 9/9] hotplug: remove iothread if adding drive device failed
Date: Wed, 28 Oct 2026 14:59:57 +0100 [thread overview]
Message-ID: <e0395f45-a1b1-41fa-96df-803042564582@proxmox.com> (raw)
In-Reply-To: <20261023130324.451252-10-d.csapak@proxmox.com>
Am 23.10.26 um 3:04 PM schrieb Dominik Csapak:
> diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
> index 5be49090..95a8c6c1 100644
> --- a/src/PVE/QemuServer.pm
> +++ b/src/PVE/QemuServer.pm
> @@ -3913,6 +3913,8 @@ sub vm_deviceplug {
Above here are more calls that could fail and leave the iothread object
behind. We should expand the eval block and maybe have variables to
track which delete operations to do in the error case based on how far
we got. Or just attempt the delete operations always, shouldn't hurt either?
> if (my $err = $@) {
> eval { qemu_drivedel($vmid, $deviceid); };
> warn $@ if $@;
> + eval { qemu_iothread_del($vmid, $deviceid, $device) };
> + warn $@ if $@;
> die $err;
> }
> } elsif ($deviceid =~ m/^(virtioscsi|scsihw)(\d+)$/) {
> @@ -3932,7 +3934,14 @@ sub vm_deviceplug {
> }
>
> qemu_deviceadd($vmid, $devicefull);
This call should be in the eval too.
> - qemu_deviceaddverify($vmid, $deviceid);
> + eval { qemu_deviceaddverify($vmid, $deviceid) };
> + if (my $err = $@) {
> + if ($deviceid =~ m/^virtioscsi(\d+)$/ && $device->{iothread}) {
> + eval { qemu_iothread_del($vmid, $deviceid, $device) };
> + warn $@ if $@;
> + }
> + die $err;
> + }
> } elsif ($deviceid =~ m/^(scsi)(\d+)$/) {
> qemu_findorcreatescsihw($storecfg, $conf, $vmid, $device, $arch, $machine_type);
> qemu_driveadd($storecfg, $vmid, $device);
next prev parent reply other threads:[~2026-10-28 14:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-23 13:01 [PATCH qemu-server v4 0/9] add hotplug tests and fix uncovered bugs Dominik Csapak
2026-10-23 13:01 ` [PATCH qemu-server v4 1/9] tests: factor out useful commandline mocks for reuse Dominik Csapak
2026-10-23 13:01 ` [PATCH qemu-server v4 2/9] tests: factor out the diff generation Dominik Csapak
2026-10-23 13:01 ` [PATCH qemu-server v4 3/9] machine: factor out machine expanding Dominik Csapak
2026-10-23 13:01 ` [PATCH qemu-server v4 4/9] tests: hotplug: add initial hotplug test harness Dominik Csapak
2026-10-23 13:01 ` [PATCH qemu-server v4 5/9] tests: hotplug: add some test cases Dominik Csapak
2026-10-23 13:01 ` [PATCH qemu-server v4 6/9] tests: hotplug: add test case for adding scsi14 on qemu 11.1 Dominik Csapak
2026-10-23 13:01 ` [PATCH qemu-server v4 7/9] tests: hotplug: add cases for known defects Dominik Csapak
2026-10-23 13:01 ` [PATCH qemu-server v4 8/9] hotplug: fix hot unplugging tablet on aarch64 Dominik Csapak
2026-10-23 13:01 ` [PATCH qemu-server v4 9/9] hotplug: remove iothread if adding drive device failed Dominik Csapak
2026-10-28 13:59 ` Fiona Ebner [this message]
2026-10-28 13:52 ` applied (subset): [PATCH qemu-server v4 0/9] add hotplug tests and fix uncovered bugs Fiona Ebner
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=e0395f45-a1b1-41fa-96df-803042564582@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