[pve-devel] [PATCH] add iothread/dataplane support

Alexandre Derumier aderumier at odiso.com
Fri Oct 10 04:05:44 CEST 2014


new config option:

iothread: 1|0

This enable iothread/dataplane support, to improve io performance on fast storages

Currently block jobs don't work yet, it's planned for qemu 2.2.
So it's better to not expose yet this option in gui.

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/QemuServer.pm |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 2058131..8abeb92 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -152,6 +152,12 @@ mkdir $lock_dir;
 my $pcisysfs = "/sys/bus/pci";
 
 my $confdesc = {
+    iothread => {
+	optional => 1,
+	type => 'boolean',
+	description => "Enable iothread dataplane.",
+	default => 0,
+    },
     onboot => {
 	optional => 1,
 	type => 'boolean',
@@ -1090,6 +1096,7 @@ sub print_drivedevice_full {
     if ($drive->{interface} eq 'virtio') {
 	my $pciaddr = print_pci_addr("$drive->{interface}$drive->{index}", $bridges);
 	$device = "virtio-blk-pci,drive=drive-$drive->{interface}$drive->{index},id=$drive->{interface}$drive->{index}$pciaddr";
+	$device .= ",iothread=iothread0" if $conf->{iothread};
     } elsif ($drive->{interface} eq 'scsi') {
 	$maxdev = ($conf->{scsihw} && ($conf->{scsihw} !~ m/^lsi/)) ? 256 : 7;
 	my $controller = int($drive->{index} / $maxdev);
@@ -2438,6 +2445,8 @@ sub config_to_command {
 	push @$cmd, '-smbios', "type=1,$conf->{smbios1}";
     }
 
+    push @$cmd, '-object', "iothread,id=iothread0" if $conf->{iothread};
+
     if ($q35) {
 	# the q35 chipset support native usb2, so we enable usb controller 
 	# by default for this machine type
-- 
1.7.10.4




More information about the pve-devel mailing list