WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] Fix the Qcow issue

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] Fix the Qcow issue
From: "Cui, Dexuan" <dexuan.cui@xxxxxxxxx>
Date: Wed, 20 Jun 2007 19:06:24 +0800
Delivery-date: Wed, 20 Jun 2007 04:04:26 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcezAk8LTgUWhyQjRYi04ZrPdgNmKAAJ00bw
Thread-topic: [PATCH] Fix the Qcow issue

The Qemu 0.9 we're using is actually multi-threaded because

1) The "AIO" in Qemu 0.9 means using the library librt -- this library actually just uses pthreads to "emulate" AIO;

2) In main() -> xenstore_parse_domain_config() -> xs_watch(), one other pthread is created.

Normally by default, SIGUSR2 is not blocked, so the signal masks of SIGUSR2 in all the threads are unblocked.

 

When creating HVM guest, if we use the Qcow format image file, in the main thread, Qcow uses SIGUSR2 to be notified of the completion of the request after it issues an AIO request; in tools/ioemu/block.c: bdrv_read_em(), in some point between bdrv_aio_read() and qemu_aio_wait(), Dom0 may send a SIGUSR2 to Qemu immediately to indicate the completion of an AIO request -- since at the moment SIGUSR2 in main thread is blocked by qemu_aio_wait_start(), the signal may be delivered to one non-main thread, causing the signal handler of SIGUSR2 is invoked, then the main thread hangs in qemu_aio_wait()->syswait()…

 

The attached patch blocks SIGUSR2 at the beginning of Qemu’s main(), so it ensures SIGUSR2 is blocked by default when a new thread is created, then only the threads that use the signal unblock it.

 

Signed-off-by: Dexuan Cui <dexuan.cui@xxxxxxxxx>

 

Attachment: fix-qcow.patch
Description: fix-qcow.patch

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] Fix the Qcow issue, Cui, Dexuan <=