Commit Graph

120 Commits

Author SHA1 Message Date
Rusty Bird
a0d6327532
qvm-backup-restore: remove orphaned --replace-template option 2018-02-23 02:09:03 +00:00
Marek Marczykowski-Górecki
5a4577417f
Merge remote-tracking branch 'qubesos/pr/53'
* qubesos/pr/53:
  template-postprocess: fast path for file-reflink, like file
2018-02-14 04:45:59 +01:00
Rusty Bird
e6466c3783
template-postprocess: fast path for file-reflink, like file
I don't know if any template currently hits this code path, even the
fedora-26-minimal root.img is large enough to be split into multiple
parts. Maybe Arch Linux?

Related to https://github.com/QubesOS/qubes-core-admin/pull/188
2018-02-12 21:51:01 +00:00
Christopher Laprise
30dd7acaa9
Fix dom0 restore 2018-02-01 22:21:24 -05:00
Marek Marczykowski-Górecki
3d4f626515
Merge remote-tracking branch 'qubesos/pr/51'
* qubesos/pr/51:
  qvm-run: wait for X11 in --dispvm --gui case
  vm/DispVM: use 'qrexec_timeout' also for call connection timeout
2018-01-15 03:23:54 +01:00
Rusty Bird
c83deccdd3
qvm-run: wait for X11 in --dispvm --gui case
'qvm-run --dispvm' cannot easily make a separate qubes.WaitForSession
call. Instead, if --gui is active, pass the new WaitForSession argument
to qubes.VMShell, which will do the equivalent.

The unit tests have been copied (in slightly adapted form) from commit
a620f02e2a

Fixes QubesOS/qubes-issues#3012
Closes QubesOS/qubes-core-admin-client#49
2018-01-14 18:36:46 +00:00
Marek Marczykowski-Górecki
04f8d85819
base: make WrapperObjectsCollection behave like a dict
In core-admin matching collections are real dicts, so clone this API
behaviour here too. Specific changes:
 - iteration yields keys, not values
 - implement values and items methods

Additionally fix keys method, it was broken on python2 (list have no
copy method).
2018-01-12 05:29:40 +01:00
Marek Marczykowski-Górecki
8584ca4057
tools/qvm-ls: clarify that disk usage is in percents 2018-01-12 05:29:40 +01:00
Marek Marczykowski-Górecki
b16f3ab79b
tools/qvm-ls: add --network and --disk compatibility options
Shortcuts for new --format=...
2018-01-12 05:29:39 +01:00
Marek Marczykowski-Górecki
080b563ae2
tools/qvm-ls: add --raw-list option for compatibility with R3.2
There was an option to list just VM names, useful for scripting.
Preserve that for compatibility.
2018-01-12 05:29:39 +01:00
Marek Marczykowski-Górecki
0533703ddf
tools/qvm-ls: allow list only selected VMs
Restore possibility to list only some VMs, by naming them on command
line.
2018-01-12 05:29:39 +01:00
Marek Marczykowski-Górecki
4af13d5445
tools: fix handling optional domain list
It wasn't possible to use QubesArgumentParser(vmname_nargs=...) for
optional domain list - the option forced usage of either --all or
explicit domain list.
2018-01-12 05:27:57 +01:00
Marek Marczykowski-Górecki
9b5546f1b0
tools/qvm-start: add naive waiting for cdrom device
When starting a VM with --cdrom=some-vm:/some/path/to.iso, it can be
started only when loop device matching the path is available. For now,
add naive waiting (while ... sleep(1)) for it. Later it might worth
converting it to events handling.
2018-01-12 05:27:57 +01:00
Rusty Bird
58cecf6b3f
qvm-device/block: Alias '--ro' to '--option read-only=yes'
It's quicker to type and compatible with pre-R4.0 habits/scripts.
2018-01-10 19:30:30 +00:00
Marek Marczykowski-Górecki
51a89a9e77
Merge remote-tracking branch 'qubesos/pr/44'
* qubesos/pr/44:
  Fix style else-return
  tests: update qvm-template-process and qvm-remove tests
  Add --force to manpage.
  Avoid cloning installed_by_rpm
  Print vm list before prompt
  Use --force instead of --yes
  Toggle installed_by_rpm in template tool
  Fix error message grammar
  Add --yes option and confirm prompt.
2018-01-06 14:54:32 +01:00
Christopher Laprise
acd5f2e524
Fix style else-return 2018-01-05 23:13:24 -05:00
Christopher Laprise
8b03c9cc9c
Print vm list before prompt 2018-01-02 01:51:01 -05:00
Christopher Laprise
91928ae0c6
Use --force instead of --yes 2018-01-02 01:33:20 -05:00
Christopher Laprise
f7d27cdcdc
Toggle installed_by_rpm in template tool 2018-01-02 01:19:06 -05:00
Christopher Laprise
ac7461d1e8
Fix error message grammar 2018-01-02 00:42:47 -05:00
Christopher Laprise
ed11346977
Add --yes option and confirm prompt. 2017-12-29 14:17:30 -05:00
Marek Marczykowski-Górecki
917df5a8c5
tools/qvm-ls: fix handling columns with underscore
Mangling column type was inconsistent, resulting in
KeyError('VIRT_MODE').
2017-12-29 03:24:22 +01:00
Marek Marczykowski-Górecki
c2281fefc8
Merge remote-tracking branch 'qubesos/pr/43'
* qubesos/pr/43:
  Fix dom0-related issues
2017-12-22 17:19:59 +01:00
Christopher Laprise
c6bc4f05cb
Fix dom0-related issues 2017-12-11 10:16:53 -05:00
Marek Marczykowski-Górecki
bc9fd47aa0
Another approach for making qvm-shutdown nice for tests 2017-12-10 22:52:29 +01:00
Marek Marczykowski-Górecki
448fbb8309
make qvm-shutdown nice for unit tests
Make it deterministic.
2017-12-10 22:39:39 +01:00
Marek Marczykowski-Górecki
3541b7d883
Merge remote-tracking branch 'qubesos/pr/42'
* qubesos/pr/42:
  verify-only avoid dom0 handler
  Fix verify-only
  Issue #3303
2017-12-10 22:24:55 +01:00
Christopher Laprise
f86c640d65
Fix verify-only 2017-12-06 21:31:30 -05:00
Marek Marczykowski-Górecki
cb069367d5
Merge remote-tracking branch 'qubesos/pr/41'
* qubesos/pr/41:
  Remove dead code
2017-12-05 22:23:02 +01:00
Jean-Philippe Ouellet
123aa28e87
Remove dead code 2017-11-30 06:57:03 -05:00
Jean-Philippe Ouellet
16ae4a64b6
Disable spinner if --raw-data 2017-11-30 06:48:03 -05:00
Jean-Philippe Ouellet
b52371f614
Fix qvm-ls --raw-data 2017-11-29 21:33:50 -05:00
Marek Marczykowski-Górecki
afe4eef15f
Merge remote-tracking branch 'qubesos/pr/38'
* qubesos/pr/38:
  Restore correct colors in verbose mode
  Fix setting stderr default coloring policy
2017-11-20 13:04:42 +01:00
Jean-Philippe Ouellet
6afe5a98c2
Restore correct colors in verbose mode
Restore stderr color when printing to stderr, not stdout color
2017-11-20 00:45:53 -05:00
Jean-Philippe Ouellet
57bf88aa30
Fix setting stderr default coloring policy
stderr default should be set if stderr is None, not if stdout is None
2017-11-20 00:44:07 -05:00
qubesuser
dbd2f0ee06 remove format_doc and docutils import
This wastes 100-200ms loading and removing markup every run and none
of the strings contain any markup anyway...
2017-11-10 16:31:45 +01:00
Marek Marczykowski-Górecki
dc5afa56bf
Merge remote-tracking branch 'qubesos/pr/35'
* qubesos/pr/35:
  make qvm-run work for non-blocking stdin
2017-11-07 22:22:29 +01:00
qubesuser
cb644eb174 make qvm-run work for non-blocking stdin
The main process sometimes sets fd 1 to O_NONBLOCK, and since in the
terminal case fd 0 and 1 are the same fd, this also results in fd 0
being non-blocking, causing qvm-run to crash with EAGAIN.

So just make the code work for both blocking and non-blocking stdin.
2017-11-07 20:43:16 +01:00
Marek Marczykowski-Górecki
7bcab46f96
tools/qvm-shutdown: fix handling shutdown timeout for multiple VMs
When some VM timeout on shutdown, the tool will try to kill all of them,
but at this point some of them may be already powered off (not all
hanged during shutdown, but only some). Handle this
situation instead of crashing. And add appropriate test.
2017-10-28 22:40:24 +02:00
Marek Marczykowski-Górecki
2fac77da6f
Document device attach options in man page
Fixes QubesOS/qubes-issues#3204
2017-10-24 03:24:43 +02:00
Marek Marczykowski-Górecki
8981e71b88
tools: fix handling qvm-run --no-autostart
Fixes QubesOS/qubes-issues#3083
2017-10-19 14:55:33 +02:00
Marek Marczykowski-Górecki
cbdc2170b4
tools: clarify that qvm-backup needs absolute path
Fixes QubesOS/qubes-issues#3066
2017-10-16 03:09:10 +02:00
Marek Marczykowski-Górecki
0187588531
tools: adjust qvm-start message and logic, update tests
QubesOS/qubes-issues#3130
2017-10-08 18:17:03 +02:00
Marek Marczykowski-Górecki
bf4c9bacb4
Merge remote-tracking branch 'qubesos/pr/28'
* qubesos/pr/28:
  qvm-start: exit if domain running and no --skip-if-running
2017-10-08 17:14:47 +02:00
Marek Marczykowski-Górecki
559cc9b0d6
tools/qvm-start: fix starting a VM with cdrom image
1. Output of `losetup` command contains `\n` - strip it.
2. Provide read-only option - if device info hasn't propagated to qubesd
yet, it will not be set automatically.

Fixes QubesOS/qubes-issues#3146
2017-10-04 15:18:28 +02:00
Marek Marczykowski-Górecki
8476afc306
tools: finish 'qvm-volume revert' implementation, add tests
It wasn't aware of snapshot identifier, fix that. Also update to use
VM:VOLUME syntax, not POOL:VID.
2017-10-02 21:12:17 +02:00
Marek Marczykowski-Górecki
edcaed537a
Always use QubesVM objects, instead of AppVM/TemplateVM etc
Very few calls at client side really needs VM class name. So, even in
non-blind mode use just QubesVM class, to avoid strange cases depending
on blind mode being enabled or not. Then, have VM class name in 'klass'
property. If known at object creation time, cache it, otherwise query
qubesd at first access.
2017-10-02 21:12:16 +02:00
Mindy Preston
76c4a6421b qvm-start: exit if domain running and no --skip-if-running 2017-09-27 17:15:52 -05:00
Marek Marczykowski-Górecki
ab9a57a544
tools: fix qvm-run --help
QubesOS/qubes-issues#
2017-09-20 22:53:30 +02:00
Marek Marczykowski-Górecki
5e2638ab5e
tools: restore qvm-start --cdrom and similar options
Booting a VM from cdrom require attaching the device before VM startup,
which is possible only in persistent mode. But for qvm-start --cdrom
adding a cdrom only temporarily, use new update_persistence() function
to convert the assignment to temporary one.

Fixes QubesOS/qubes-issues#3055
2017-09-05 08:33:47 +02:00