[PATCH v2 9/9] qemu: Place helper processes into the same trusted group

Dario Faggioli dfaggioli at suse.com
Fri Jul 15 07:48:09 UTC 2022


On Wed, 2022-07-13 at 17:25 +0100, Daniel P. Berrangé wrote:
> It would need to use SCOPE_THREAD_GROUP, except even that is not
> sufficient
> as the helper may have fork+exec'd another helper by this point, and
> our
> call will only affect the first process.
> 
> IOW, to set core scheduling cookies on the helpers, we need to set
> them
> upfront at the time we spawn the helper.
> 
> IOW, during startup, IIUC, we need to fork  a dummy process solely to
> call PR_SCHED_CORE_CREATE. Then when forking anything else, whether a
> helper, or QEMU itself, we need to pull the cookie from that dummy
> process, and then finally kill that dummy process.
> 
Yes. Not pretty, but if forks are involved, that's the solution, I
think.

An alternative would be to create/pull the cookie in the main process
(the one that forks all the helpers), then do fork all helpers, and
then "clear" the cookie for it.

But I guess that would be even worse...

Regards
-- 
Dario Faggioli, Ph.D
http://about.me/dario.faggioli
Virtualization Software Engineer
SUSE Labs, SUSE https://www.suse.com/
-------------------------------------------------------------------
<<This happens because _I_ choose it to happen!>> (Raistlin Majere)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20220715/d3768cd6/attachment.sig>


More information about the libvir-list mailing list