Commit Graph

53 Commits

Author SHA1 Message Date
Wojtek Porczyk
17ac6cb225 core3: boolean properties can be set explicitely 2015-10-05 12:46:14 +02:00
Wojtek Porczyk
b4d51b016b core3: some properties can be set only once
Some properties should not be changed by user at will (like UUID). The
solution is to make them write-once, so they will be set when loading
from XML and frozen for the lifespan of the object holding the property.
When desperately needed, users may edit XML by hand.

fixes QubesOS/qubes-issues#1235
2015-10-05 12:46:14 +02:00
Wojtek Porczyk
12329e7b35 qubes/vm/qubesvm: fix log initialisation 2015-10-05 12:46:14 +02:00
Wojtek Porczyk
0fbee4dc10 core3: more fixes 2015-10-05 12:46:13 +02:00
Wojtek Porczyk
80d664441d core3: fixes from Marek
This is adapted from commit 90a50dca406e3d40c88ea338566e0460589df7a3.
2015-10-05 12:46:13 +02:00
Wojtek Porczyk
6241859dc8 qubes: Fix PropertyHolder.property_get_default
And test cases, some of them stubs.
2015-09-28 18:20:28 +02:00
Wojtek Porczyk
136b3b36b8 qubes/tools/qubes-create: add --property option 2015-09-28 18:20:28 +02:00
Wojtek Porczyk
cb62545007 qubes: fix qid generation 2015-09-28 18:20:07 +02:00
Wojtek Porczyk
ff7d89700a qubes/tools: port qvm-create 2015-06-30 17:18:24 +02:00
Wojtek Porczyk
7832f23d5d qubes: minor fix 2015-06-29 17:39:29 +02:00
Wojtek Porczyk
d4147c52bd qubes: Fix property-set events signature 2015-06-29 17:39:29 +02:00
Wojtek Porczyk
7f16e0a73b qubes: disable events by default not to interfere with loading from XML 2015-06-29 17:39:28 +02:00
Wojtek Porczyk
8e690c6858 qubes: fix saving Label 2015-06-29 17:39:28 +02:00
Wojtek Porczyk
d5f2e6ab74 qubes: rework qubes.xml handling
Now it more closely aligns with old core2 semantics. New semantics will
have to wait for qubesd.
2015-06-29 17:39:28 +02:00
Wojtek Porczyk
9a5703d5ea pylint fix 2015-06-29 17:39:28 +02:00
Wojtek Porczyk
142521317c qubes: Documentation for qubes.tools
And first documentation for qubes.tools.qvm_ls.
2015-06-29 17:39:28 +02:00
Wojtek Porczyk
6a4820c381 qubes/tools: qvm-ls 2015-06-29 17:39:28 +02:00
Wojtek Porczyk
5d9b92a039 qubes: pylint fixes (minor programming errors) 2015-06-29 17:39:28 +02:00
Wojtek Porczyk
186b277418 qubes/vm: fix logging 2015-06-29 17:39:27 +02:00
Wojtek Porczyk
45977fc873 qubes: fix VM instantiation and loading 2015-06-29 17:39:27 +02:00
Wojtek Porczyk
8c437f4053 qubes: unify PropertyHolder API
get_props_list() -> property_list()
_init_property() -> _property_init()
2015-06-29 17:39:27 +02:00
Wojtek Porczyk
6798790e1f qubes: pylint fixes (fix signatures) 2015-06-29 17:39:27 +02:00
Wojtek Porczyk
adb144acfe qubes: pylint fixes (small mistakes and wrong names) 2015-06-29 17:39:27 +02:00
Wojtek Porczyk
4a85c823c3 qubes: pylint fixes (qualify imported variables) 2015-06-29 17:39:27 +02:00
Wojtek Porczyk
bf29d5e5b5 qubes: pylint fixes (disable unfounded messages) 2015-06-29 17:39:27 +02:00
Wojtek Porczyk
ac1739df6b qubes: pylint fixes (fix imports) 2015-06-29 17:39:27 +02:00
Wojtek Porczyk
ee06e7d7a2 qubes: documentation and licence fixes 2015-06-29 17:39:27 +02:00
Wojtek Porczyk
cdc3df66c8 qubes: pylint fixes (mostly whitespace) 2015-06-29 17:39:27 +02:00
Wojtek Porczyk
d937d39c9e qubes: fix Qubes instantiation 2015-06-29 17:39:26 +02:00
Jason Mehring
0dbcdb8c0d qubes: pep8 fixes
-------------------------------------------------------------------------------
ISSUES:
-------------------------------------------------------------------------------

- Some auto-corrected code (when line is too long) may still be over-indented.
  It can be manually chaged and it will be left alone, or is it acceptable as
  I am not sure how strict your rule is for under-indented lines for which
  context.  If you want this only indented 4 spaces, I can work on it some more.
  [Also @ ~line:385 in new file]

  For example, __init__.py:382
  OLD:
    def __contains__(self, key):
        return any((key == vm or key == vm.qid or key == vm.name) for vm in self)

  NEW:
    def __contains__(self, key):
        return any((key == vm or key == vm.qid or key == vm.name)
                   for vm in self)

- will not detect if there are more than 2 spaces between function methods

-------------------------------------------------------------------------------
FIXED:
-------------------------------------------------------------------------------
- Now uses the most horizontial space and does not use excessive lines when
  splitting a line

- __init__:489
  - '#' comments being indented for some lines and not others; would like no indent
  - Only happens if line preceeding comment ends in a ':'

E128 - Fix visual indentation
E128 - Fix a badly indented line [Now allows under-indented lines]

E309 - Add missing blank line (after class declaration) [No longer adds it]

E303 - Remove extra blank lines [Now allows 2 blank lines between function defs]
       [TODO: Create definition to enforce this]

Conflicts:
	qubes/__init__.py
2015-06-29 17:39:26 +02:00
Jason Mehring
6504da9524 qubes: changed a test for None from == None to is None
Conflicts:
	qubes/__init__.py
2015-06-29 17:39:26 +02:00
Wojtek Porczyk
af154b53fe qubes: change names of XML generating methods
Methods returning lxml.etree.Elements are called xml_ or lvxml_, meant for
qubes.xml or libvirt respectively.

Acknowledgement:
This commit is a result of core3 review by Marek.
2015-06-29 17:39:26 +02:00
Wojtek Porczyk
92eca8edb9 qubes: Fix comments accross the code
Acknowledgement:
This commit is a result of core3 review by Marek.
2015-06-29 17:39:25 +02:00
Wojtek Porczyk
091ffa5444 qubes: Add parser for property docstring
From now, docstrings in properties cannot contain sphinx-specific features,
because there is no sphinx in dom0.
2015-06-29 17:39:25 +02:00
Wojtek Porczyk
7971342811 qubes: Make get_props_list a classmethod
Same for get_property_def.
2015-06-29 17:39:25 +02:00
Wojtek Porczyk
1deb3221c7 qubes: fix netvm semantics WRT default values
Automatic acquiring default*_netvm, default_template and {clock,update}vm is no
more. This will be moved to firstboot. Advanced users (those, who elect not to
autoconfig their initial VMs) will have to deal with that.

Acknowledgement:
This commit is a result of core3 review by Marek.
2015-06-29 17:39:25 +02:00
Wojtek Porczyk
c2a35c02b4 qubes: Cache QubesHost requests, fix xen-specific members
Acknowledgement:
This commit is a result of core3 review by Marek.
2015-06-29 17:39:25 +02:00
Wojtek Porczyk
2a62780ea2 qubes: add property-del events 2015-06-29 17:39:25 +02:00
Wojtek Porczyk
6ec86ec9f7 qubes: property may be unset by assinging DEFAULT
Introducing qubes.property.DEFAULT special value, which may be assigned to any
property. Result is the same as del'ing a property.
2015-06-29 17:39:25 +02:00
Wojtek Porczyk
9fa3d60d0b qubes/events: fix event handling order
Events are divided into "pre" and "post" events. "Pre" events fire handlers in
MRO, "post" fire them in reverse.
2015-06-29 17:39:24 +02:00
Wojtek Porczyk
41fef46db2 core3 move: QubesVM
This is a big commit and probably incomplete. Tests will follow.
2015-06-29 17:39:24 +02:00
Wojtek Porczyk
1a032ecf2a core3: basic global events and their documentation 2015-06-29 17:39:24 +02:00
Wojtek Porczyk
855a434879 core3: event framework adjusted for global Qubes object
From now, global events are emitted by qubes.Qubes object and handlers are registered there.
2015-06-29 17:39:24 +02:00
Wojtek Porczyk
b623a71d87 core3 move: QubesVmCollection
This got split to qubes.Qubes and qubes.VMCollection.
From now on, VMCollection is a stupid bag. Some parts went elsewhere.
2015-06-29 17:39:23 +02:00
Wojtek Porczyk
6146c8e466 QubesVmLabel: XML parsing 2015-06-29 17:39:23 +02:00
Wojtek Porczyk
f3673dd34c core3 move: class QubesVmLabel 2015-06-29 17:39:23 +02:00
Wojtek Porczyk
778571fe8d core3 move: class QubesHost 2015-06-29 17:39:23 +02:00
Wojtek Porczyk
320cb096f6 qubes: drop dry_run 2015-06-29 17:39:22 +02:00
Wojtek Porczyk
57d35fbc4c qubes: fix qubes.QubesVMMConnection
fix logical error in resetting offline_mode
and drop redundant _common_getter()
2015-06-29 17:39:22 +02:00
Wojtek Porczyk
cec3db993d core3 move: class QubesVMMConnection 2015-06-29 17:39:22 +02:00