diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-06-18 09:32:50 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-06-18 09:32:50 +0100 |
commit | 0a9b2d786bbda43e056ae835dba758a74c26ec43 (patch) | |
tree | 93f16507bd958ff34fea933bfc1ee19c4f199acc /extras/mini-os/blkfront.c | |
parent | dbd56b5c30b26127b97504cbd560bf9460a04d26 (diff) | |
download | xen-0a9b2d786bbda43e056ae835dba758a74c26ec43.tar.gz xen-0a9b2d786bbda43e056ae835dba758a74c26ec43.tar.bz2 xen-0a9b2d786bbda43e056ae835dba758a74c26ec43.zip |
stubdom: fix using minios frontends directly when libc is actived
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
Diffstat (limited to 'extras/mini-os/blkfront.c')
-rw-r--r-- | extras/mini-os/blkfront.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/extras/mini-os/blkfront.c b/extras/mini-os/blkfront.c index e2ac965434..9e5411bce6 100644 --- a/extras/mini-os/blkfront.c +++ b/extras/mini-os/blkfront.c @@ -63,7 +63,8 @@ void blkfront_handler(evtchn_port_t port, struct pt_regs *regs, void *data) struct blkfront_dev *dev = data; int fd = dev->fd; - files[fd].read = 1; + if (fd != -1) + files[fd].read = 1; #endif wake_up(&blkfront_queue); } @@ -105,6 +106,9 @@ struct blkfront_dev *init_blkfront(char *nodename, struct blkfront_info *info) dev = malloc(sizeof(*dev)); memset(dev, 0, sizeof(*dev)); dev->nodename = strdup(nodename); +#ifdef HAVE_LIBC + dev->fd = -1; +#endif snprintf(path, sizeof(path), "%s/backend-id", nodename); dev->dom = xenbus_read_integer(path); @@ -418,8 +422,10 @@ int blkfront_aio_poll(struct blkfront_dev *dev) moretodo: #ifdef HAVE_LIBC - files[dev->fd].read = 0; - mb(); /* Make sure to let the handler set read to 1 before we start looking at the ring */ + if (dev->fd != -1) { + files[dev->fd].read = 0; + mb(); /* Make sure to let the handler set read to 1 before we start looking at the ring */ + } #endif rp = dev->ring.sring->rsp_prod; |