On Thu, 20 Oct 2022 12:39:41 +0200
Paolo Bonzini wrote:
> On 10/19/22 17:57, Daniel P. Berrangé wrote:
> >> +if (my_id == -1) {
> >> +my_id = getpid() + qatomic_fetch_inc(&counter);
> >> +}
> >> +return my_id;
> > This doesn't look safe for linux-user when we fork, but don't e
On 10/19/22 17:57, Daniel P. Berrangé wrote:
+if (my_id == -1) {
+my_id = getpid() + qatomic_fetch_inc(&counter);
+}
+return my_id;
This doesn't look safe for linux-user when we fork, but don't exec.
Linux-user won't ever get here, however bsd-user might. We should have
g
On Wed, 19 Oct 2022 16:57:54 +0100
Daniel P. Berrangé wrote:
> On Wed, Oct 19, 2022 at 05:16:50PM +0200, Greg Kurz wrote:
> > A subsequent patch needs to be able to differentiate the main QEMU
> > thread from other threads. An obvious way to do so is to compare
> > log_thread_id() and getpid(), b
On Wed, Oct 19, 2022 at 05:16:50PM +0200, Greg Kurz wrote:
> A subsequent patch needs to be able to differentiate the main QEMU
> thread from other threads. An obvious way to do so is to compare
> log_thread_id() and getpid(), based on the fact that they are equal
> for the main thread on systems t
A subsequent patch needs to be able to differentiate the main QEMU
thread from other threads. An obvious way to do so is to compare
log_thread_id() and getpid(), based on the fact that they are equal
for the main thread on systems that have the gettid() syscall (e.g.
linux).
Adapt the fallback cod