Sanitization of input value is tricky here, and also very important at
the same time. If property define value type (and it's something more
specific than 'str'), use that. Otherwise allow only printable ASCII
characters, and let appropriate event and setter handle value.
At this point I've reviewed all QubesVM properties in this category and
added appropriate setters where needed.
QubesOS/qubes-issues#2622
Don't allow characters potentially interfering with qrexec. To be on the
safe side, allow only alphanumeric characters + very few selected
punctuations.
Split it into two functions: validate_name - context-less verification,
and actual _setter_name which perform additional verification in
context of actual VM.
Switch to qubes.exc.* exceptions where appropriate.
This commit makes sure that the Python list vms_list is not mutated
while the code is iterating through it. To the best of my knowledge,
this is a problematic operation.
To rectify this issue, a new temporary list is instantiated, and
the VM objects that have shut down are appended to the temporary list,
which is afterwards used to remove the shut-down VM objects from the
vms_list.
Signed-off-by: M. Vefa Bicakci <m.v.b@runbox.com>
Prior to this commit, the qubes-core.service inherited systemd's default
timeout value of 90 seconds. With slow hard disk drives, this caused the
dom0 shut-down sequence to proceed even if some VMs were still not fully
shut down at the time of dom0 shut down.
This commit aims to avoid this issue by setting the service stop timeout to
180 seconds.
Signed-off-by: M. Vefa Bicakci <m.v.b@runbox.com>
Prior to this commit, qvm-shutdown had a limitation where only one
VM name could be passed in via the command line for shutting down.
This commit removes the aforementioned limitation by adapting the
code for multiple command line arguments.
Signed-off-by: M. Vefa Bicakci <m.v.b@runbox.com>
As discussed/agreed, this commit removes the dates from the manual pages
belonging to the qubes-* and qvm-* utilities, except for that of
qvm-shutdown, which is handled by another commit.
qvm-trim-template manually assemble device dict, fix it to include
also 'desc' field, as it is now checked.
Fixes ba4dec5 "qvm-block: fix checking attached status of disk image files"
Pylint deprecated-method report interferes with asyncio.ensure_future
compatibility monkeypatch. The function asyncio.async was renamed
between 3.4.3 (fc23) and 3.4.4 (what is currently on Travis). For
reference, debian stable has 3.4.2.
This reverts commit 0f1672dc63.
Bring it back. Lets not revert the whole feature just because required
package exists only in qubes-builder, not in some online repository.
Also, this revert didn't go as planned - there was a reference to a
'passphrase' local variable, but it wasn't assigned any value.
Cc: @woju
This will allow more flexible API usage, especially when using mgmt API
- we need to use VM type as string there.
We don't lose any flexibility here - VM class names needs to be uniquely
identified by a string (used in qubes.xml) anyway.