From: "Philippe Mathieu-Daudé" <philippe.mathieu.daude@gmail.com>
To: qemu-devel@nongnu.org, Peter Maydell <peter.maydell@linaro.org>,
Paolo Bonzini <pbonzini@redhat.com>,
Akihiko Odaki <akihiko.odaki@gmail.com>
Cc: "Emanuele Giuseppe Esposito" <eesposit@redhat.com>,
"Kevin Wolf" <kwolf@redhat.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>
Subject: Re: [RFC PATCH-for-7.0 v4 0/2] cocoa: run qemu_init in the main thread
Date: Sat, 19 Mar 2022 14:56:08 +0100 [thread overview]
Message-ID: <342e06e6-8d38-d068-5686-eb13c70da93b@gmail.com> (raw)
In-Reply-To: <20220317125534.38706-1-philippe.mathieu.daude@gmail.com>
Hi Akihiko, Paolo, Peter.
On 17/3/22 13:55, Philippe Mathieu-Daudé wrote:
> From: Philippe Mathieu-Daudé <f4bug@amsat.org>
>
> Posting v4 in case someone want to iterate.
>
> Pending issue raised by Akihiko Odaki:
>
> * this actually breaks the "runas" option with ui/cocoa.
>
> [+NSApplication sharedApplication] calls issetugid() to see if
> setgid() or setuid() is called before and calls exit() if it evaluates
> true. It does not evaluate true without this patch since setgid() and
> setuid() are called after [+NSApplication sharedApplication]. This
> patch, however, changes the order and triggers the check.
>
> There are two options to solve the problem:
> 1. Move setgid and setuid calls after [+NSApplication
> sharedApplication] to let NSApplication initialize as the original
> user.
Akihiko, could you send a patch?
> 2. Do: [[NSUserDefaults standardUserDefaults] setBool:YES
> forKey:@"_NSAppAllowsNonTrustedUGID"]
>
> Option 2 would be preferred in terms of practicality since nobody
> would want to initialize NSApplication as the original user (usually
> superuser). However, _NSAppAllowsNonTrustedUGID is not documented by
> Apple.
What are your views on this problem for 7.0-rc1? Keep modifying cocoa
UI? Disable block layer assertions? Only disable them for Darwin?
> * Oudated comment in main():
>
> 1970 /*
> 1971 * Create the menu entries which depend on QEMU state (for consoles
> 1972 * and removeable devices). These make calls back into QEMU functions,
> 1973 * which is OK because at this point we know that the second thread
> 1974 * holds the iothread lock and is synchronously waiting for us to
> 1975 * finish.
> 1976 */
>
> (https://marc.info/?l=qemu-devel&m=164752136410805)
>
> Since v3:
> - Move qemu_event_init before cbowner alloc
> - Reduce main_thread scope to applicationDidFinishLaunching
> - Updated updateUIInfo() comment
> (s/cocoa_display_init/applicationDidFinishLaunching)
>
> Since v2:
> - Extracted code movement in preliminary patch
>
> v3: https://lore.kernel.org/qemu-devel/20220317115644.37276-1-philippe.mathieu.daude@gmail.com/
> v2: https://lore.kernel.org/qemu-devel/20220316160300.85438-1-philippe.mathieu.daude@gmail.com/
> v1: https://lore.kernel.org/qemu-devel/20220307151004.578069-1-pbonzini@redhat.com/
>
> Paolo Bonzini (1):
> ui/cocoa: run qemu_init in the main thread
>
> Philippe Mathieu-Daudé (1):
> ui/cocoa: Code movement
>
> softmmu/main.c | 12 ++--
> ui/cocoa.m | 161 ++++++++++++++++++++++---------------------------
> 2 files changed, 79 insertions(+), 94 deletions(-)
>
next prev parent reply other threads:[~2022-03-19 13:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-17 12:55 [RFC PATCH-for-7.0 v4 0/2] cocoa: run qemu_init in the main thread Philippe Mathieu-Daudé
2022-03-17 12:55 ` [RFC PATCH-for-7.0 v4 1/2] ui/cocoa: Code movement Philippe Mathieu-Daudé
2022-03-17 12:55 ` [RFC PATCH-for-7.0 v4 2/2] ui/cocoa: run qemu_init in the main thread Philippe Mathieu-Daudé
2022-03-19 13:56 ` Philippe Mathieu-Daudé [this message]
2022-03-19 14:15 ` [RFC PATCH-for-7.0 v4 0/2] cocoa: " Akihiko Odaki
2022-03-21 9:14 ` Paolo Bonzini
2022-03-21 9:33 ` Akihiko Odaki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=342e06e6-8d38-d068-5686-eb13c70da93b@gmail.com \
--to=philippe.mathieu.daude@gmail.com \
--cc=akihiko.odaki@gmail.com \
--cc=eesposit@redhat.com \
--cc=f4bug@amsat.org \
--cc=kraxel@redhat.com \
--cc=kwolf@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).