Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign up"timezone" HVM pref still doesn't work #1437
Comments
marmarek
added
bug
C: core
P: major
labels
Jan 6, 2016
marmarek
added this to the Release 3.0 updates milestone
Jan 6, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
plushambush
Sep 7, 2016
- The first problem (positive offset) can be fixed with a simple patch:
--- 01QubesHVm.py 2016-09-07 18:52:37.394008910 +0300
+++ 01QubesHVm.py.new 2016-09-07 18:52:23.155008444 +0300
@@ -73,7 +73,8 @@
attrs['maxmem'].pop('save')
attrs['maxmem']['func'] = lambda x: self.memory
attrs['timezone'] = { 'default': 'localtime',
- 'save': lambda: str(self.timezone) }
+ 'save': lambda: str(self.timezone),
+ 'func': lambda x: str(x) }
attrs['qrexec_installed'] = { 'default': False,
'attr': '_qrexec_installed',
'save': lambda: str(self._qrexec_installed) }
@@ -249,11 +250,11 @@
params['time_basis'] = 'localtime'
params['timeoffset'] = '0'
elif self.timezone.isdigit():
- params['time_basis'] = 'UTC'
+ params['time_basis'] = 'utc'
params['timeoffset'] = self.timezone
else:
print >>sys.stderr, "WARNING: invalid 'timezone' value: %s" % self.timezone
- params['time_basis'] = 'UTC'
+ params['time_basis'] = 'utc'
params['timeoffset'] = '0'
return params
I can make a pull request with this commit if it's ok
- The second problem (negative offset) is OptionParser's (Optik) module (used by qvm-prefs) issue:
It treats any "-" followed by a character as (short) option token and thus can not recognize a negative integer.
elif arg[:1] == "-" and len(arg) > 1:
# process a cluster of short options (possibly with
# value(s) for the last one only)
self._process_short_opts(rargs, values)
Imho this can be completely fixed only by replacing option parsing module with some other or doing dirty tricks by inheriting OptionParser and overwriting some parsing methods in inherited class.
I managed to fix it and get it working but only for the case of a single property value like
qvm-prefs -s <vmname> <property> <negative integer value>
it still throws an error when one try to set a property with multiple values (are there any?) of which some are negative integers like
qvm-prefs -s <vmname> <property> <value1> <value2> <negative integer value3> <value4> ...
plushambush
commented
Sep 7, 2016
I can make a pull request with this commit if it's ok
Imho this can be completely fixed only by replacing option parsing module with some other or doing dirty tricks by inheriting OptionParser and overwriting some parsing methods in inherited class. I managed to fix it and get it working but only for the case of a single property value like |
mattmccutchen commentedNov 19, 2015
When setting the timezone pref for my Windows HVM in an attempt to fix the time in the VM, using qubes-core-dom0-3.0.25-1.fc20.x86_64, I still observe the following problems noted in #1184:
AttributeError: 'int' object has no attribute 'lower'): Looks like the check actually causing the boot problem is this one, not the one that was changed in #1184.qvm-prefs: error: no such option: -3): Looks like no attempt was made to fix this in #1184.I cannot reopen #1184 so I'm filing a new bug report. My original problem (which I'll report separately to qubes-users) ended up being unrelated to this pref, so this bug is low priority to me.