-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On Thu, Dec 14, 2017 at 06:41:22PM -0500, Jean-Philippe Ouellet wrote: > On Thu, Dec 14, 2017 at 8:48 AM, Wojtek Porczyk > <[email protected]> wrote: > > On Wed, Dec 13, 2017 at 09:19:59PM -0500, Jean-Philippe Ouellet wrote: > >> Hello, > >> > >> There are some events with specific names after a colon, e.g.: > >> - device-pre-attach:block > >> - device-list-attached:pci > >> - property-set:netvm > >> etc. > >> > >> and sometimes the same names show up both with and without colons, e.g.: > >> in core-admin/qubes/vm/__init__.py: > >> self.vm.fire_event('domain-feature-delete', feature=key) > >> self.vm.fire_event('domain-feature-set', feature=key, > >> value=value, > >> self.vm.fire_event('domain-feature-set', feature=key, > >> value=value) > >> > >> in desktop-linux-common/qubesappmenusext/__init__.py: > >> @qubes.ext.handler('domain-feature-set:internal') > >> > >> I think this specific with/without colons mismatch is a bug, but > >> perhaps the original intention was that two events would be fired, one > >> foo-bar:specific and one foo-bar, as a means of pre-filtering which > >> events you care about? I could see this being useful for e.g. > >> listening on generic property-setting for all properties, but idk. > > > > If there is no explicit fire_*() with this name with colon (maybe calculated > > as 'domain-feature-set:' + variable), this is a bug, and IIUC it will cause > > the handler in qubesappmenuext (desktop-linux-common) not to fire. > > Indeed. Patch here: > https://github.com/QubesOS/qubes-desktop-linux-common/pull/7 > > I'm still not sure whether that's the right way to fix it though. > Perhaps the event firing (and tests) should be changed to match the > existing handler instead? Idk.
I think better fix it the other way around. Otherwise (almost?) every event handler for domain-feature-set even would be cluttered with 'if feature == ...'. In practice handlers are for some particular feature. If someone want to listen for multiple events at once, it's possible to register handler for '*' (but not 'domain-feature-set:*'). It is rare case anyway. BTW the same bug applies to tags (domain-tag-add/domain-tag-delete). - -- 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/THMrX1ywFAlo8U2QACgkQ24/THMrX 1yz9iggAloy1vHStEJUpkxvlTCxyLLDnJfWQ4kRTaqGLZszzN8CABTUm8gOQQPR8 8JAOb0ks7/YJgJ0lbCB9tqoE34cgUds8BTlcj9g0gZBwu2lykafUpSUJgEWiZcSH rs957gkw7BjpquqeQs+rGX2GrDvIFv4rqYfr2RxRPoIvTKCOOsCBPH0tb2jrfXvB VKr1IOvvfvmKOo7w4J5WdYF8nPOTBDeovUlkalCMWCTEnY7G0y89pCzgu6j8JcJ+ v42HJKcTHcK+DK3lMBmajkITqYGEzMTO6HGwIfW3phxJphAgrxTk4H2QxnYlkgMa /TQm9yd7MFLo4l4DOtySrCN/kVwMCw== =m9gC -----END PGP SIGNATURE----- -- You received this message because you are subscribed to the Google Groups "qubes-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/qubes-devel/20171222003545.GJ1135%40mail-itl. For more options, visit https://groups.google.com/d/optout.
