From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH qemu-server] fix #6680 (continued): do not use a top throttle node when using scsi-block
Date: Thu, 14 Aug 2025 18:45:07 +0200 [thread overview]
Message-ID: <20250814164529.694979-1-f.ebner@proxmox.com> (raw)
The throttle block driver does not support issuing ioctls. While the
driver could be patched in QEMU to pass along ioctls to the child,
that seems like a hack, because with scsi-block, throttle limits
already do not apply. This was already the case with '-drive' in
Proxmox VE 8.
Note that live mirroring would require special handling to make the
target be below a throttle node with the correct node name, but it
already is not supported for such disks:
> # qm disk move 103 scsi1 lvm
> unable to parse volume ID '/dev/sdg'
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/PVE/QemuServer/Blockdev.pm | 8 ++++++++
src/test/cfg2cmd/scsiblk.conf | 5 +++++
src/test/cfg2cmd/scsiblk.conf.cmd | 32 +++++++++++++++++++++++++++++++
3 files changed, 45 insertions(+)
create mode 100644 src/test/cfg2cmd/scsiblk.conf
create mode 100644 src/test/cfg2cmd/scsiblk.conf.cmd
diff --git a/src/PVE/QemuServer/Blockdev.pm b/src/PVE/QemuServer/Blockdev.pm
index f5798cbf..d4062148 100644
--- a/src/PVE/QemuServer/Blockdev.pm
+++ b/src/PVE/QemuServer/Blockdev.pm
@@ -478,6 +478,14 @@ sub generate_drive_blockdev {
};
}
+ if ($drive->{scsiblock}) {
+ # When using scsi-block for the front-end device, throttling would not work in any case, and
+ # the throttle block driver doesn't allow doing the necessary ioctls(), so don't attach a
+ # throttle filter. Implementing live mirroring for such disks would require special care!
+ $child->{'node-name'} = top_node_name($drive_id);
+ return $child;
+ }
+
# for fleecing and TPM backup, this is already the top node
return $child if $options->{fleecing} || $options->{'tpm-backup'} || $options->{'no-throttle'};
diff --git a/src/test/cfg2cmd/scsiblk.conf b/src/test/cfg2cmd/scsiblk.conf
new file mode 100644
index 00000000..c767cef6
--- /dev/null
+++ b/src/test/cfg2cmd/scsiblk.conf
@@ -0,0 +1,5 @@
+boot: order=scsi0
+meta: creation-qemu=10.0.2,ctime=1755189639
+scsi0: /dev/sdg,scsiblock=1,size=32G
+smbios1: uuid=d47e2d5c-7068-46d4-9733-ff94083e28f6
+vmgenid: 0a212e2f-0d9a-4006-971e-17be9fcf3efe
diff --git a/src/test/cfg2cmd/scsiblk.conf.cmd b/src/test/cfg2cmd/scsiblk.conf.cmd
new file mode 100644
index 00000000..3f99b405
--- /dev/null
+++ b/src/test/cfg2cmd/scsiblk.conf.cmd
@@ -0,0 +1,32 @@
+/usr/bin/kvm \
+ -id 8006 \
+ -name 'vm8006,debug-threads=on' \
+ -no-shutdown \
+ -chardev 'socket,id=qmp,path=/var/run/qemu-server/8006.qmp,server=on,wait=off' \
+ -mon 'chardev=qmp,mode=control' \
+ -chardev 'socket,id=qmp-event,path=/var/run/qmeventd.sock,reconnect-ms=5000' \
+ -mon 'chardev=qmp-event,mode=control' \
+ -pidfile /var/run/qemu-server/8006.pid \
+ -daemonize \
+ -smbios 'type=1,uuid=d47e2d5c-7068-46d4-9733-ff94083e28f6' \
+ -smp '1,sockets=1,cores=1,maxcpus=1' \
+ -nodefaults \
+ -boot 'menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg' \
+ -vnc 'unix:/var/run/qemu-server/8006.vnc,password=on' \
+ -cpu kvm64,enforce,+kvm_pv_eoi,+kvm_pv_unhalt,+lahf_lm,+sep \
+ -m 512 \
+ -object '{"id":"throttle-drive-scsi0","limits":{},"qom-type":"throttle-group"}' \
+ -global 'PIIX4_PM.disable_s3=1' \
+ -global 'PIIX4_PM.disable_s4=1' \
+ -device 'pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e' \
+ -device 'pci-bridge,id=pci.2,chassis_nr=2,bus=pci.0,addr=0x1f' \
+ -device 'vmgenid,guid=0a212e2f-0d9a-4006-971e-17be9fcf3efe' \
+ -device 'piix3-usb-uhci,id=uhci,bus=pci.0,addr=0x1.0x2' \
+ -device 'usb-tablet,id=tablet,bus=uhci.0,port=1' \
+ -device 'VGA,id=vga,bus=pci.0,addr=0x2' \
+ -device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \
+ -iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \
+ -device 'lsi,id=scsihw0,bus=pci.0,addr=0x5' \
+ -blockdev '{"cache":{"direct":true,"no-flush":false},"detect-zeroes":"on","discard":"ignore","driver":"raw","file":{"aio":"io_uring","cache":{"direct":true,"no-flush":false},"detect-zeroes":"on","discard":"ignore","driver":"host_device","filename":"/dev/sdg","node-name":"e8c91179e47ae3eb292a03618be5cf4","read-only":false},"node-name":"drive-scsi0","read-only":false}' \
+ -device 'scsi-hd,bus=scsihw0.0,scsi-id=0,drive=drive-scsi0,id=scsi0,device_id=drive-scsi0,bootindex=100,write-cache=on' \
+ -machine 'type=pc+pve0'
--
2.47.2
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next reply other threads:[~2025-08-14 16:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-14 16:45 Fiona Ebner [this message]
2025-08-26 7:56 ` [pve-devel] applied: " Thomas Lamprecht
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=20250814164529.694979-1-f.ebner@proxmox.com \
--to=f.ebner@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.