[PATCH virtinst] support 'kvm' domain type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If domain type is 'kvm', the randomMAC() will think it's a invalid key then
set default 'xen' type mac address. It's a real error for cloning a kvm guest,
the guest mac address will be changed to 'xen' type address.

RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=798909   

* virtinst/util.py (randomMAC): add 'kvm' domain type.

Signed-off-by: Alex Jia <ajia@xxxxxxxxxx>
---
 virtinst/util.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/virtinst/util.py b/virtinst/util.py
index 17c873b..8866793 100644
--- a/virtinst/util.py
+++ b/virtinst/util.py
@@ -200,7 +200,8 @@ def randomMAC(type="xen"):
 
     @return: MAC address string
     """
-    ouis = { 'xen': [ 0x00, 0x16, 0x3E ], 'qemu': [ 0x52, 0x54, 0x00 ] }
+    ouis = dict.fromkeys(['qemu', 'kvm'], [ 0x52, 0x54, 0x00 ])
+    ouis.update(dict.fromkeys(['xen'], [ 0x00, 0x16, 0x3E ]))
 
     try:
         oui = ouis[type]
-- 
1.7.1


[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux