[NEW PATCH] BZ#716705 refuse to start VMs with "unknown" host osname (via gerrit-bot)

Dan Kenigsberg danken at redhat.com
Mon Jun 27 17:57:57 UTC 2011


New patch submitted by Dan Kenigsberg (danken at redhat.com)

You can review this change at: http://gerrit.usersys.redhat.com/623

commit 3cfe2b9f15705eec9c749fd173bf5634e8919bde
Author: Dan Kenigsberg <danken at redhat.com>
Date:   Sun Jun 26 16:54:41 2011 +0300

    BZ#716705 refuse to start VMs with "unknown" host osname
    
    If, due to misconfiguration, the host os is an recognizable, refuse to
    start new VMs as the os name should be passed to the guest bios.
    
    Change-Id: Ia41ef922d2393acb9b62ff8daed9974f2eb79b4c

diff --git a/vdsm/libvirtvm.py b/vdsm/libvirtvm.py
index 518d7ba..22511e9 100644
--- a/vdsm/libvirtvm.py
+++ b/vdsm/libvirtvm.py
@@ -825,6 +825,9 @@ class LibvirtVm(vm.Vm):
         domxml.appendOs()
 
         osd = caps.osversion()
+
+        assert osd['name'] != caps.OSName.UNKNOWN
+
         domxml.appendSysinfo(
             osname=osd.get('name', ''),
             osversion=osd.get('version', '') + '-' + osd.get('release', ''),




More information about the vdsm-patches mailing list