Received: from eggs.gnu.org ([2001:4830:134:3::10]:42921) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDnU0-0004Pk-TI for qemu-devel@nongnu.org; Wed, 12 Feb 2014 23:01:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WDnTs-0003va-Eu for qemu-devel@nongnu.org; Wed, 12 Feb 2014 23:01:04 -0500 Received: from p02c11o144.mxlogic.net ([208.65.144.77]:40884) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDnTs-0003vM-8x for qemu-devel@nongnu.org; Wed, 12 Feb 2014 23:00:56 -0500 From: Chris Takemura Date: Wed, 12 Feb 2014 20:00:52 -0800 Message-ID: Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_CF218374378ctakemuraaxcientcom_" MIME-Version: 1.0 Subject: [Qemu-devel] Use of watch_pipe in xs_handle structure List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "qemu-devel@nongnu.org" --_000_CF218374378ctakemuraaxcientcom_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, I'm trying to debug a problem that causes qemu-dm to lock up with Xen HVM d= omains. We're using the qemu version that came with Xen 3.4.2. I know it'= s old, but we're stuck with it for a little while yet. I think the hang is related to thread synchronization and the xenstore, but= I'm not sure how it all fits together. In particular, I don't understand t= he lines in xs.c that handle the watch_pipe, e.g.: /* Kick users out of their select() loop. */ if (list_empty(&h->watch_list) && (h->watch_pipe[1] !=3D -1)) while (write(h->watch_pipe[1], body, 1) !=3D 1) continue; It looks to me like the other thread blocks while reading from the pipe, an= d the write allows it to continue. But this code seems like it does the sa= me thing as the condvar_signal call that comes slightly after, and therefor= e it seems like I could safely #ifndef USE_PTHREAD it out. Is this the cas= e? --_000_CF218374378ctakemuraaxcientcom_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
Hi,

=
I'm trying to debug a problem that causes qemu-dm to lock up with Xen = HVM domains.  We're using the qemu version that came with Xen 3.4.2.&n= bsp; I know it's old, but we're stuck with it for a little while yet.<= /div>

I think the hang is related to thread synchronizat= ion and the xenstore, but I'm not sure how it all fits together. In particu= lar, I don't understand the lines in xs.c that handle the watch_pipe, e.g.:=

        /* Kick users ou= t of their select() loop. */
      &nbs= p; if (list_empty(&h->watch_list) &&
   =         (h->watch_pipe[1] !=3D -1))
 = ;           while (write(h->watch_pipe[1], body= , 1) !=3D 1)
              &nb= sp; continue;

It looks to me like the other thread bloc= ks while reading from the pipe, and the write allows it to continue.  = But this code seems like it does the same thing as the condvar_signal call = that comes slightly after, and therefore it seems like I could safely #ifnd= ef USE_PTHREAD it out.  Is this the case?
--_000_CF218374378ctakemuraaxcientcom_--