Commit Graph

39 Commits

Author SHA1 Message Date
Marek Marczykowski-Górecki
2aa0de3d5b
tools: remove qvm-ls tool and related integration in qubes.property
qvm-ls tool (as all other tools) will be accessing properties through
API, so no need (nor sense) for this tool-specific attributes in
qubes.property. The only somehow used was ls_width, and in fact it made
the output unnecessary wide.

The tool itself is already moved to core-mgmt-client repository.

QubesOS/qubes-issues#853
2017-05-12 14:25:27 +02:00
Bahtiar `kalkin-` Gadimov
5bc7a8f9e3
Fix pylint warning no-else-return 2017-04-15 23:49:41 +02:00
Marek Marczykowski-Górecki
35d1167893
qubes/vm/net: fix name of argument for property-del event handler
Since enforcing keyword arguments for event handlers, it's important now.
2017-03-16 20:04:05 +01:00
Marek Marczykowski-Górecki
2d2672ec58
vm/qubesvm: convert firewall_conf into dumb, read-only property
Don't allow anything else than firewall.xml.
2017-03-16 20:04:03 +01:00
Wojtek Porczyk
417cb6e912 qubes/vm/mix/net: fix event arguments
Arguments to events are now keyword-only and require exact names.
2017-03-06 17:20:57 +01:00
Wojtek Porczyk
be53db4db9 qubes/events: they accept only keyword arguments
Positional arguments are hereby deprecated, with immediate effect.

QubesOS/qubes-issues#2622
2017-02-21 14:46:42 +01:00
Wojtek Porczyk
d74567d65f qubes: port core to python3
fixes QubesOS/qubes-issues#2074
2017-01-20 16:42:51 +01:00
Marek Marczykowski-Górecki
28d4feb0d0
qubes: fix network-related functions
- cleanup_vifs crash when non-networked VM is running
- type error in get_vms_connected_to (store VM objects, not qid)
2016-11-26 04:08:58 +01:00
Wojtek Porczyk
37bfd0d2a3 Merge remote-tracking branch 'marmarek/core3-fake-ip' into core3-devel 2016-11-15 17:40:30 +01:00
Marek Marczykowski-Górecki
38fc504ca0
qubes/vm/net: set mapped IP info before attaching network
Set parameters for possibly hiding domain's real IP before attaching
network to it, otherwise we'll have race condition with vif-route-qubes
script.

QubesOS/qubes-issues#1143
2016-11-01 00:37:43 +01:00
Marek Marczykowski-Górecki
b4fa8cdce3
qubes/vm/net: use domain's "visible IP" for a gateway address
This is the IP known to the domain itself and downstream domains. It may
be a different one than seen be its upstream domain.

Related to QubesOS/qubes-issues#1143`
2016-11-01 00:30:11 +01:00
Marek Marczykowski-Górecki
b8145595a9
qubes/vm/net: allow setting custom IP
Fixes QubesOS/qubes-issues#1477
2016-10-31 03:04:13 +01:00
Marek Marczykowski-Górecki
2c6c476410
qubes/vm/net: add feature of hiding real IP from the VM
This helps hiding VM IP for anonymous VMs (Whonix) even when some
application leak it. VM will know only some fake IP, which should be set
to something as common as possible.
The feature is mostly implemented at (Proxy)VM side using NAT in
separate network namespace. Core here is only passing arguments to it.
It is designed the way that multiple VMs can use the same IP and still
do not interfere with each other. Even more: it is possible to address
each of them (using their "native" IP), even when multiple of them share
the same "fake" IP.

Original approach (marmarek/old-qubes-core-admin#2) used network script
arguments by appending them to script name, but libxl in Xen >= 4.6
fixed that side effect and it isn't possible anymore. So use QubesDB
instead.

From user POV, this adds 3 "features":
 - net/fake-ip - IP address visible in the VM
 - net/fake-gateway - default gateway in the VM
 - net/fake-netmask - network mask
The feature is enabled if net/fake-ip is set (to some IP address) and is
different than VM native IP. All of those "features" can be set on
template, to affect all of VMs.
Firewall rules etc in (Proxy)VM should still be applied to VM "native"
IP.

Fixes QubesOS/qubes-issues#1143
2016-10-31 02:06:01 +01:00
Wojtek Porczyk
8edbf0e406 qubes: Document all the events
fixes QubesOS/qubes-issues#1811
2016-10-25 17:11:38 +02:00
Marek Marczykowski-Górecki
cdc97730cd
qubes/firewall: apply only IPv4 rules
Currently dom0 do not assign IPv6 addresses for VMs, so there is no
sense in IPv6 firewall yet.

QubesOS/qubes-issues#1815
2016-09-19 20:36:32 +02:00
Marek Marczykowski-Górecki
e01f7b97d9
qubes/vm: plug in new firewall code, create QubesDB entries
QubesOS/qubes-issues#1815
2016-09-19 20:36:31 +02:00
Marek Marczykowski-Górecki
f6bc61997a
qubes/vm: fix handling dynamic netvm change
Correctly detach network before attaching new one.
2016-09-08 04:17:48 +02:00
Bahtiar `kalkin-` Gadimov
b712d0f6f3
Remove unexpected property 2016-08-29 00:05:18 +02:00
Wojtek Porczyk
d28ab908cc Network and storage fixes 2016-06-29 16:42:35 +02:00
Bahtiar `kalkin-` Gadimov
87ae5a3b65
Fix qvm-start 2016-06-21 17:44:35 +02:00
Bahtiar `kalkin-` Gadimov
91ee455a37 NetVMMixin add docstrings & fix pylint errors 2016-06-16 17:06:19 +02:00
Bahtiar `kalkin-` Gadimov
b77c36b224 Remove NetVMMixin.vif() 2016-06-16 17:01:34 +02:00
Wojtek Porczyk
677a3e51f4 Move libvirt XML network device to jinja 2016-06-16 13:29:15 +02:00
Wojtek Porczyk
6ade5736d7 pylint fixes 2016-06-10 21:27:29 +02:00
Marek Marczykowski-Górecki
5e2b617c6f qubes/vm: fix parameters for some even handlers 2016-06-02 13:10:43 +02:00
Marek Marczykowski-Górecki
2bb73ab0a1 qubes/vm: add validators for many properties 2016-06-02 13:10:28 +02:00
Marek Marczykowski-Górecki
b24ab45d00 qubes/vm: fix network attach/detach 2016-06-02 12:28:53 +02:00
Wojtek Porczyk
786884ad7a qubes: fix netvm properties and tests
fixes QubesOS/qubes-issues#1816
2016-05-19 03:02:23 +02:00
Wojtek Porczyk
63c09a090c qubes: Combat import cycles
This commit eliminates import statements happening in the middle of the
file (between two classes definition). The cycles are still there. The
only magic module is qubes itself.
2016-05-05 14:33:09 +02:00
Wojtek Porczyk
29d0baa944 qubes/vm/mix/net: By default MAC is constant
MAC address was one place, where qid was leaked to the VM. Different MAC
addresses are not needed, since we do routing, not switching.
2016-03-21 11:44:59 +01:00
Wojtek Porczyk
04cc2099f7 HVM part 2 2016-03-21 11:44:54 +01:00
Wojtek Porczyk
d766b8e110 qubes: Fix "unify event names" 2016-03-21 11:43:33 +01:00
Marek Marczykowski-Górecki
3b1238f7cf vm: stub for new firewall API
- introduce 'firewall-changed' event
 - add reload_firewall_for_vm stub function

Should that function be private, called only from appropriate event
handlers?

QubesOS/qubes-issues#1815
2016-03-21 11:43:33 +01:00
Marek Marczykowski-Górecki
c9cad71d03 vm/mix/net: create vm.connected_vms dynamically
It is much less error-prone way. Previous approach didn't worked because
VMs weren't added here at 'domain-init'/'domain-loaded' event. And even
after adding such handlers it wasn't working because of
QubesOS/qubes-issues#1816.

It may be a little slower, but since it isn't used so often
(starting/stopping VM and reloading firewall), shouldn't be a problem.
2016-03-21 11:43:33 +01:00
Marek Marczykowski-Górecki
3e3213e7c7 Redo "core: do not reset firewal when setting netvm=none"
Apparently it got lost in merge.

QubesOS/qubes-issues#862
2016-03-21 11:43:33 +01:00
Wojtek Porczyk
75dd882b83 qubes: Unify event names
Events will be named <object>-[pre-]-<verb>, where verb is in infinitive
form.
2016-03-21 11:43:32 +01:00
Wojtek Porczyk
c47e29ed50 Fix most errors from pylint 2016-03-03 01:14:54 +01:00
Wojtek Porczyk
9eafa57539 Merge remote-tracking branch 'marmarek/master' into core3-devel
The following list is bollocks. There were many, many more.

Conflicts:
    core-modules/003QubesTemplateVm.py
    core-modules/005QubesNetVm.py
    core/qubes.py
    core/storage/__init__.py
    core/storage/xen.py
    doc/qvm-tools/qvm-pci.rst
    doc/qvm-tools/qvm-prefs.rst
    qubes/tools/qmemmand.py
    qvm-tools/qvm-create
    qvm-tools/qvm-prefs
    qvm-tools/qvm-start
    tests/__init__.py
    vm-config/xen-vm-template-hvm.xml

This commit took 2 days (26-27.01.2016) and put our friendship to test.
    --Wojtek and Marek
2016-03-03 01:13:51 +01:00
Wojtek Porczyk
01319e391f qubes: port netvm
From now, there are no separate NetVM and ProxyVM class, but property
"provides_network".
2016-03-03 00:46:05 +01:00