[PATCH] virtinst: Add 'clock' parameter for hvm guest installs

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

 



The attached patch adds a 'clock' key to the full virt guest parameters
dictionary in virtinst. The main reasoning for this is to specify 'localtime'
instead of 'utc' for a windows guest. If no guest type is specified, the
generated xml doesn't contain a clock field and uses libvirt's default, which
is the current action.

Thanks,
Cole


diff -r 81d9288672cb virtinst/FullVirtGuest.py
--- a/virtinst/FullVirtGuest.py	Tue Dec 11 11:45:06 2007 -0500
+++ b/virtinst/FullVirtGuest.py	Fri Dec 14 16:32:22 2007 -0500
@@ -34,6 +34,7 @@ class FullVirtGuest(Guest.XenGuest):
     OS_TYPES = { "linux": { "label": "Linux", \
                             "acpi": True, \
                             "apic": True, \
+                            "clock": "utc",\
                             "continue": False, \
                             "input": [ "mouse", "ps2"],
                             "variants": { "rhel2.1": { "label": "Red Hat Enterprise Linux 2.1", "distro": "rhel" }, \
@@ -54,6 +55,7 @@ class FullVirtGuest(Guest.XenGuest):
                  "windows": { "label": "Windows", \
                               "acpi": True, \
                               "apic": True, \
+                              "clock": "localtime",\
                               "continue": True, \
                               "input": [ "tablet", "usb"],
                               "variants": { "winxp": { "label": "Microsoft Windows XP", \
@@ -69,6 +71,7 @@ class FullVirtGuest(Guest.XenGuest):
                  "unix": { "label": "UNIX", \
                            "acpi": True,
                            "apic": True,
+                           "clock": "utc",\
                            "continue": False, \
                            "input": [ "mouse", "ps2"],
                            "variants": { "solaris9": { "label": "Sun Solaris 9" }, \
@@ -80,6 +83,7 @@ class FullVirtGuest(Guest.XenGuest):
                  "other": { "label": "Other", \
                             "acpi": True,
                             "apic": True,
+                            "clock": "utc",
                             "continue": False,
                             "input": [ "mouse", "ps2"],
                             "variants": { "msdos": { "label": "MS-DOS", \
@@ -197,7 +201,21 @@ class FullVirtGuest(Guest.XenGuest):
         if osblob is None:
             return None
 
-        return "%s\n  %s" % (osblob, self._get_features_xml())
+        clockxml = self._get_clock_xml()
+        if clockxml is not None:
+            return "%s\n  %s\n  %s" % (osblob, self._get_features_xml(), \
+                                       clockxml)
+        else:
+            return "%s\n  %s" % (osblob, self._get_features_xml())
+
+    def _get_clock_xml(self):
+        if self.os_type is not None and \
+           FullVirtGuest.OS_TYPES[self.os_type].has_key("clock"):
+            return "<clock offset=\"%s\"/>" % \
+                   FullVirtGuest.OS_TYPES[self.os_type]["clock"]
+        else:
+            return None
 
     def _get_device_xml(self, install = True):
         if self.emulator is None:
_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/et-mgmt-tools

[Index of Archives]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux