Changes to fix bugs in the support of topologies of 1 socket with hyperthreading
[osm/openvim.git] / osm_openvim / host_thread.py
index 1a03c7f..620f25c 100644 (file)
@@ -435,8 +435,7 @@ class host_thread(threading.Thread):
         if topo == None and 'metadata' in dev_list[0]:
             topo = dev_list[0]['metadata'].get('topology', None)
     #name
-        name = server.get('name','') + "_" + server['uuid']
-        name = name[:58]  #qemu impose a length  limit of 59 chars or not start. Using 58
+        name = server.get('name', '')[:28] + "_" + server['uuid'][:28] #qemu impose a length  limit of 59 chars or not start. Using 58
         text += self.inc_tab() + "<name>" + name+ "</name>"
     #uuid
         text += self.tab() + "<uuid>" + server['uuid'] + "</uuid>" 
@@ -519,7 +518,7 @@ class host_thread(threading.Thread):
         if topo == "oneSocket:hyperthreading":
             if vcpus % 2 != 0:
                 return -1, 'Cannot expose hyperthreading with an odd number of vcpus'
-            text += self.tab() + "<cpu mode='host-model'> <topology sockets='1' cores='%d' threads='2' /> </cpu>" % vcpus/2
+            text += self.tab() + "<cpu mode='host-model'> <topology sockets='1' cores='%d' threads='2' /> </cpu>" % (vcpus/2)
         elif windows_os or topo == "oneSocket":
             text += self.tab() + "<cpu mode='host-model'> <topology sockets='1' cores='%d' threads='1' /> </cpu>" % vcpus
         else: