[pve-devel] [PATCH] enable virtio-ring0 by default for qemu >=2.3

Alexandre Derumier aderumier at odiso.com
Mon Jun 1 14:50:04 CEST 2015


for qemu >=2.3 to not break live migration of old machines

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

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index f3cd41e..e6c45c6 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -2947,6 +2947,12 @@ sub config_to_command {
 	push @$devices, '-device', 'virtserialport,chardev=qga0,name=org.qemu.guest_agent.0';
     }
 
+    if (qemu_machine_feature_enabled ($machine_type, $kvmver, 2, 3)) {
+	my $pciaddr = print_pci_addr("virtioring0", $bridges);
+	push @$devices, '-object', "rng-random,filename=/dev/random,id=rng0";
+	push @$devices, '-device', "virtio-rng-pci,id=virtioring0,rng=rng0$pciaddr";
+    }
+
     my $spice_port;
 
     if ($qxlnum) {
@@ -4695,6 +4701,7 @@ sub print_pci_addr {
 	'net29' => { bus => 1, addr => 24 },
 	'net30' => { bus => 1, addr => 25 },
 	'net31' => { bus => 1, addr => 26 },
+	'virtioring0' => { bus => 1, addr => 27 },
 	'virtio6' => { bus => 2, addr => 1 },
 	'virtio7' => { bus => 2, addr => 2 },
 	'virtio8' => { bus => 2, addr => 3 },
-- 
2.1.4




More information about the pve-devel mailing list