fixed blocking io emulation
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2090 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
15e6690aca
commit
6eb5733a3c
|
@ -308,6 +308,11 @@ void qemu_aio_wait(void)
|
||||||
{
|
{
|
||||||
sigset_t set;
|
sigset_t set;
|
||||||
int nb_sigs;
|
int nb_sigs;
|
||||||
|
|
||||||
|
#ifndef QEMU_TOOL
|
||||||
|
if (qemu_bh_poll())
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
sigemptyset(&set);
|
sigemptyset(&set);
|
||||||
sigaddset(&set, aio_sig_num);
|
sigaddset(&set, aio_sig_num);
|
||||||
sigwait(&set, &nb_sigs);
|
sigwait(&set, &nb_sigs);
|
||||||
|
|
6
vl.c
6
vl.c
|
@ -5200,19 +5200,23 @@ QEMUBH *qemu_bh_new(QEMUBHFunc *cb, void *opaque)
|
||||||
return bh;
|
return bh;
|
||||||
}
|
}
|
||||||
|
|
||||||
void qemu_bh_poll(void)
|
int qemu_bh_poll(void)
|
||||||
{
|
{
|
||||||
QEMUBH *bh, **pbh;
|
QEMUBH *bh, **pbh;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = 0;
|
||||||
for(;;) {
|
for(;;) {
|
||||||
pbh = &first_bh;
|
pbh = &first_bh;
|
||||||
bh = *pbh;
|
bh = *pbh;
|
||||||
if (!bh)
|
if (!bh)
|
||||||
break;
|
break;
|
||||||
|
ret = 1;
|
||||||
*pbh = bh->next;
|
*pbh = bh->next;
|
||||||
bh->scheduled = 0;
|
bh->scheduled = 0;
|
||||||
bh->cb(bh->opaque);
|
bh->cb(bh->opaque);
|
||||||
}
|
}
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void qemu_bh_schedule(QEMUBH *bh)
|
void qemu_bh_schedule(QEMUBH *bh)
|
||||||
|
|
2
vl.h
2
vl.h
|
@ -495,7 +495,7 @@ QEMUBH *qemu_bh_new(QEMUBHFunc *cb, void *opaque);
|
||||||
void qemu_bh_schedule(QEMUBH *bh);
|
void qemu_bh_schedule(QEMUBH *bh);
|
||||||
void qemu_bh_cancel(QEMUBH *bh);
|
void qemu_bh_cancel(QEMUBH *bh);
|
||||||
void qemu_bh_delete(QEMUBH *bh);
|
void qemu_bh_delete(QEMUBH *bh);
|
||||||
void qemu_bh_poll(void);
|
int qemu_bh_poll(void);
|
||||||
|
|
||||||
/* block.c */
|
/* block.c */
|
||||||
typedef struct BlockDriverState BlockDriverState;
|
typedef struct BlockDriverState BlockDriverState;
|
||||||
|
|
Loading…
Reference in a new issue