-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On Thu, May 03, 2018 at 09:50:26PM +0200, donoban wrote:
> On 05/03/18 16:08, donoban wrote:
> > Hi,
> >
> > I saw Qube Manager should handle dbus signals from
> > 'DomainManager1' for a fast and cheap refreshing of VMs status.
> >
> > Is anybody currently working on this? If not I think I could do it.
> > I started playing with pydbus and I think the current code doesn't
> > need a very big rewrite for handling all relevant events.
>
> I am near achieve this. However I see a little problem with current API.
>
> Dbus objects relative to Qubes domains use 'qid' as identifier, like:
>
> /org/qubes/DomainManager1/domains/13
>
> but VMCollection uses VM names as key so I can't retrieve directly an
> vm object using a 'qid'.
>
> This only affects to domain creation (for the other cases the vm was
> already loaded into a dict) but maybe would be nice to have a direct
> way to get a vm by 'qid'.
There is ongoing work on domains widget to use qubesadmin module
directly (skipping dbus layer). Copying Marta, who is working on it.
Long story short - dbus services was introduced before we've decided to
implement Admin API in 4.0 (initial plan was to have it in 4.1 or
later). But since we've done it in 4.0, there is very little sense to
use dbus, which serve similar purpose (provide info and events about
domains), but adds additional complexity.
As for Qube Manager, there is a little problem - events handling in
qubesadmin is based on asyncio python module. At the same time, both GTK
and Qt use its own event loop. We have it worked out for GTK, using
gbulb module[1][2], it's simple. But we haven't tried it with Qt. In
theory there is quamash module for it, so hopefully that's simple too.
One catch is that, similar to gbulb, there is no package for it in
Fedora... For gbulb we've created one[6], probably the same needed for
quamash.
By using qubesadmin directly, you avoid this qid problem and
additionally things are simpler and there is less places where state can
get out of sync.
Events handling in qubesadmin: docs[4], example usage[5]:
events_dispatcher = qubesadmin.events.EventsDispatcher(
args.app)
events_dispatcher.add_handler('backup-progress',
functools.partial(print_progress, profile_name))
events_task = asyncio.ensure_future(
events_dispatcher.listen_for_events())
List of domain related events can be found here:
https://dev.qubes-os.org/projects/core-admin/en/latest/qubes-vm/qubesvm.html
[1]
https://github.com/nathan-hoad/gbulb
[2]
https://github.com/QubesOS/qubes-dbus/blob/master/qubesdbus/service.py#L37
[3]
https://github.com/harvimt/quamash
[4]
https://dev.qubes-os.org/projects/core-admin-client/en/latest/qubesadmin.events.html#module-qubesadmin.events
[5]
https://github.com/QubesOS/qubes-core-admin-client/blob/master/qubesadmin/tools/qvm_backup.py#L195-L199
[6]
https://github.com/QubesOS/qubes-linux-gbulb
- --
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAlrro5UACgkQ24/THMrX
1yySSwf/TZJhCqBBa07Pyev6tW5p9ikH/I0AvVYrFuIoewcJziyQjfyJQDWjKYjx
EHwzfYIdMr8oaa5reaJhcvEG6x/G0WkRd0SFWhZi03evAPtahrnvqwGfZmzMMruF
YaoMeRqvqHXTqLYAu+T4BAxsTXrKwnAh1lxEeYqJWw4aQcQu5b+r130ZkpdTDVqy
2d8iNR/OM6fY4M+F6Hy0Z6cj3EtbdTAsI7na0y4UZPKbt3ZmC6ixK097BYfIbs+b
2xuGdpfdfoEiH9j2CFv9TVAzLotpcs/0oJ8Y2bjC22cDUkCDLkbZ+JzsoZsv8ezQ
7XDTJp4u8Y8XMZWcv+lvJeMbGaSL1Q==
=0rMb
-----END PGP SIGNATURE-----