cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wid...@apache.org
Subject git commit: updated refs/heads/CLOUDSTACK-8489 to 8d53021
Date Wed, 20 May 2015 11:28:26 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/CLOUDSTACK-8489 [created] 8d5302187


CLOUDSTACK-8489: Set smbios information for guest

This allows a guest to easily detect that it is running inside CloudStack
and see which UUID it has.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/8d530218
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/8d530218
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/8d530218

Branch: refs/heads/CLOUDSTACK-8489
Commit: 8d5302187ef57c5741f3cbcecf55451a97fc1bf1
Parents: ab7473e
Author: Wido den Hollander <wido@widodh.nl>
Authored: Wed May 20 13:27:24 2015 +0200
Committer: Wido den Hollander <wido@widodh.nl>
Committed: Wed May 20 13:27:24 2015 +0200

----------------------------------------------------------------------
 .../kvm/resource/LibvirtComputingResource.java       |  3 ++-
 .../cloud/hypervisor/kvm/resource/LibvirtVMDef.java  | 15 +++++++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d530218/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
index 995a8cf..13f8dc5 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
@@ -1824,6 +1824,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements
Serv
         }
         guest.setGuestArch(vmTO.getArch());
         guest.setMachineType("pc");
+        guest.setUuid(uuid);
         guest.setBootOrder(GuestDef.bootOrder.CDROM);
         guest.setBootOrder(GuestDef.bootOrder.HARDISK);
 
@@ -3324,4 +3325,4 @@ public class LibvirtComputingResource extends ServerResourceBase implements
Serv
         }
         return device;
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d530218/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java
index 9be12c3..25ad8e9 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java
@@ -59,6 +59,7 @@ public class LibvirtVMDef {
         private String _initrd;
         private String _root;
         private String _cmdline;
+        private String _uuid;
         private final List<bootOrder> _bootdevs = new ArrayList<bootOrder>();
         private String _machine;
 
@@ -93,10 +94,23 @@ public class LibvirtVMDef {
             _bootdevs.add(order);
         }
 
+        public void setUuid(String uuid) {
+            _uuid = uuid;
+        }
+
         @Override
         public String toString() {
             if (_type == guestType.KVM) {
                 StringBuilder guestDef = new StringBuilder();
+
+                guestDef.append("<sysinfo type='smbios'>\n");
+                guestDef.append("<system>\n");
+                guestDef.append("<entry name='manufacturer'>Apache Software Foundation</entry>\n");
+                guestDef.append("<entry name='product'>CloudStack " + _type.toString()
+ " Hypervisor</entry>\n");
+                guestDef.append("<entry name='uuid'>" + _uuid + "</entry>\n");
+                guestDef.append("</system>\n");
+                guestDef.append("</sysinfo>\n");
+
                 guestDef.append("<os>\n");
                 guestDef.append("<type ");
                 if (_arch != null) {
@@ -111,6 +125,7 @@ public class LibvirtVMDef {
                         guestDef.append("<boot dev='" + bo + "'/>\n");
                     }
                 }
+                guestDef.append("<smbios mode='sysinfo'/>\n");
                 guestDef.append("</os>\n");
                 return guestDef.toString();
             } else if (_type == guestType.LXC) {


Mime
View raw message