[pve-devel] r5289 - qemu-server/trunk

svn-commits at proxmox.com svn-commits at proxmox.com
Wed Oct 27 11:25:29 CEST 2010


Author: dietmar
Date: 2010-10-27 09:25:29 +0000 (Wed, 27 Oct 2010)
New Revision: 5289

Modified:
   qemu-server/trunk/ChangeLog
   qemu-server/trunk/Makefile
   qemu-server/trunk/QemuServer.pm
   qemu-server/trunk/changelog.Debian
   qemu-server/trunk/qemu.init.d
Log:


Modified: qemu-server/trunk/ChangeLog
===================================================================
--- qemu-server/trunk/ChangeLog	2010-10-27 08:26:10 UTC (rev 5288)
+++ qemu-server/trunk/ChangeLog	2010-10-27 09:25:29 UTC (rev 5289)
@@ -1,3 +1,11 @@
+2010-10-27  Proxmox Support Team  <support at proxmox.com>
+
+	* QemuServer.pm (config_to_command): use new -netdev syntax for
+	network devices (enable tcp offload settings, use vhost=on for
+	virtio-net)
+
+	* qemu.init.d:  try to load vhost_net module
+
 2010-10-13  Proxmox Support Team  <support at proxmox.com>
 
 	* qmrestore (run_command): use larger block size for dd (bs=256k)

Modified: qemu-server/trunk/Makefile
===================================================================
--- qemu-server/trunk/Makefile	2010-10-27 08:26:10 UTC (rev 5288)
+++ qemu-server/trunk/Makefile	2010-10-27 09:25:29 UTC (rev 5289)
@@ -2,7 +2,7 @@
 
 VERSION=1.1
 PACKAGE=qemu-server
-PKGREL=22
+PKGREL=23
 
 DESTDIR=
 PREFIX=/usr

Modified: qemu-server/trunk/QemuServer.pm
===================================================================
--- qemu-server/trunk/QemuServer.pm	2010-10-27 08:26:10 UTC (rev 5288)
+++ qemu-server/trunk/QemuServer.pm	2010-10-27 09:25:29 UTC (rev 5289)
@@ -236,6 +236,8 @@
 
 }
 
+my $kernel_has_vhost_net = -c '/dev/vhost-net';
+
 sub disknames {
     # order is important - used to autoselect boot disk
     return ((map { "ide$_" } (0 .. ($MAX_IDE_DISKS - 1))),  
@@ -1404,11 +1406,25 @@
 	    $foundnet = 1;
 
 	    my $ifname = "vmtab${vmid}i$i";
-	    push @$cmd, '-net', "tap,vlan=$i,ifname=$ifname,script=/var/lib/qemu-server/bridge-vlan";
 
+	    if ($vernum <= 13000) {
+		push @$cmd, '-net', "tap,vlan=$i,ifname=$ifname,script=/var/lib/qemu-server/bridge-vlan";
+	    }
+
 	    foreach my $nic (@{$vlan->{nics}}) {
-		$use_virtio = 1 if $nic->{model} eq 'virtio';
-		push @$cmd, '-net', "nic,vlan=$i,model=$nic->{model},macaddr=$nic->{macaddr}";
+		my $device = $nic->{model};
+		my $vhostparam = '';
+		if ($nic->{model} eq 'virtio') {
+		    $use_virtio = 1;
+		    $device = 'virtio-net-pci';
+		    $vhostparam = ',vhost=on' if $kernel_has_vhost_net;
+		};
+		if ($vernum <= 13000) {
+		    push @$cmd, '-net', "nic,vlan=$i,model=$nic->{model},macaddr=$nic->{macaddr}";
+		} else {
+		    push @$cmd, '-netdev', "type=tap,id=$ifname,ifname=$ifname,script=/var/lib/qemu-server/bridge-vlan$vhostparam";
+		    push @$cmd, '-device', "$device,mac=$nic->{macaddr},netdev=$ifname";
+		}
 	    }
 
 	}

Modified: qemu-server/trunk/changelog.Debian
===================================================================
--- qemu-server/trunk/changelog.Debian	2010-10-27 08:26:10 UTC (rev 5288)
+++ qemu-server/trunk/changelog.Debian	2010-10-27 09:25:29 UTC (rev 5289)
@@ -1,3 +1,10 @@
+qemu-server (1.1-23) unstable; urgency=low
+
+  * use new -netdev syntax for network devices. This enables tcp offload
+    settings, and we can use 'vhost=on' for virtio-net
+
+ -- Proxmox Support Team <support at proxmox.com>  Wed, 27 Oct 2010 11:23:50 +0200
+
 qemu-server (1.1-22) unstable; urgency=low
 
   * use bs=256K instead of bs=256k

Modified: qemu-server/trunk/qemu.init.d
===================================================================
--- qemu-server/trunk/qemu.init.d	2010-10-27 08:26:10 UTC (rev 5288)
+++ qemu-server/trunk/qemu.init.d	2010-10-27 09:25:29 UTC (rev 5289)
@@ -23,6 +23,8 @@
 	(egrep '^flags.*vmx' /proc/cpuinfo >/dev/null && modprobe -q kvm-intel) || 
 	echo "unable to load kvm module"
 
+	modprobe -q vhost_net || true
+
 	$PROG startall
 	;;
   stop)



More information about the pve-devel mailing list