search for: handle_input

Displaying 20 results from an estimated 61 matches for "handle_input".

2007 Nov 27
2
[PATCH] Make xenstored EOF-safe
....cz> Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com> diff -r 6fd17d0dcbcd tools/xenstore/xenstored_core.c --- a/tools/xenstore/xenstored_core.c Tue Nov 27 12:49:16 2007 +0000 +++ b/tools/xenstore/xenstored_core.c Tue Nov 27 14:56:35 2007 +0000 @@ -1266,7 +1266,7 @@ static void handle_input(struct connecti if (in->inhdr) { bytes = conn->read(conn, in->hdr.raw + in->used, sizeof(in->hdr) - in->used); - if (bytes < 0) + if (bytes <= 0) goto bad_client; in->used += bytes; if (in->used != sizeof(in->hdr)) @@ -1288,7 +1288,7 @@ stat...
2007 Jul 20
2
[PATCH] Remove -static from Documentation/lguest/Makefile
...igned int size, unsigned int line) { - if (addr >= LGUEST_GUEST_TOP || addr + size >= LGUEST_GUEST_TOP) + if (addr >= top || addr + size >= top) errx(1, "%s:%i: Invalid address %li", __FILE__, line, addr); return (void *)addr; } @@ -629,24 +630,26 @@ static void handle_input(int fd, struct } } -static struct lguest_device_desc *new_dev_desc(u16 type, u16 features, - u16 num_pages) -{ - static unsigned long top = LGUEST_GUEST_TOP; - struct lguest_device_desc *desc; - - desc = malloc(sizeof(*desc)); - desc->type = type; - desc->num_pages = num_page...
2007 Jul 20
2
[PATCH] Remove -static from Documentation/lguest/Makefile
...igned int size, unsigned int line) { - if (addr >= LGUEST_GUEST_TOP || addr + size >= LGUEST_GUEST_TOP) + if (addr >= top || addr + size >= top) errx(1, "%s:%i: Invalid address %li", __FILE__, line, addr); return (void *)addr; } @@ -629,24 +630,26 @@ static void handle_input(int fd, struct } } -static struct lguest_device_desc *new_dev_desc(u16 type, u16 features, - u16 num_pages) -{ - static unsigned long top = LGUEST_GUEST_TOP; - struct lguest_device_desc *desc; - - desc = malloc(sizeof(*desc)); - desc->type = type; - desc->num_pages = num_page...
2007 Apr 18
0
[RFC/PATCH LGUEST X86_64 07/13] lguest64 loader
...bool verbose; +#define verbose(args...) \ + do { if (verbose) printf(args); fflush(stdout); } while(0) + +struct devices +{ + fd_set infds; + int max_infd; + + struct device *dev; +}; + +struct device +{ + struct device *next; + struct lguest_device_desc *desc; + void *mem; + + /* Watch this fd if handle_input non-NULL. */ + int fd; + int (*handle_input)(int fd, struct device *me); + + /* Watch DMA to this address if handle_input non-NULL. */ + unsigned long watch_address; + u32 (*handle_output)(int fd, const struct iovec *iov, + unsigned int num, struct device *me); + + /* Device-specific data. *...
2007 Apr 18
0
[RFC/PATCH LGUEST X86_64 07/13] lguest64 loader
...bool verbose; +#define verbose(args...) \ + do { if (verbose) printf(args); fflush(stdout); } while(0) + +struct devices +{ + fd_set infds; + int max_infd; + + struct device *dev; +}; + +struct device +{ + struct device *next; + struct lguest_device_desc *desc; + void *mem; + + /* Watch this fd if handle_input non-NULL. */ + int fd; + int (*handle_input)(int fd, struct device *me); + + /* Watch DMA to this address if handle_input non-NULL. */ + unsigned long watch_address; + u32 (*handle_output)(int fd, const struct iovec *iov, + unsigned int num, struct device *me); + + /* Device-specific data. *...
2007 May 09
0
[patch 9/9] lguest: the documentation, example launcher
...+#define verbose(args...) \ + do { if (verbose) printf(args); } while(0) + +struct device_list +{ + fd_set infds; + int max_infd; + + struct device *dev; + struct device **lastdev; +}; + +struct device +{ + struct device *next; + struct lguest_device_desc *desc; + void *mem; + + /* Watch this fd if handle_input non-NULL. */ + int fd; + bool (*handle_input)(int fd, struct device *me); + + /* Watch DMA to this key if handle_input non-NULL. */ + unsigned long watch_key; + u32 (*handle_output)(int fd, const struct iovec *iov, + unsigned int num, struct device *me); + + /* Device-specific data. */ + voi...
2007 May 09
0
[patch 9/9] lguest: the documentation, example launcher
...+#define verbose(args...) \ + do { if (verbose) printf(args); } while(0) + +struct device_list +{ + fd_set infds; + int max_infd; + + struct device *dev; + struct device **lastdev; +}; + +struct device +{ + struct device *next; + struct lguest_device_desc *desc; + void *mem; + + /* Watch this fd if handle_input non-NULL. */ + int fd; + bool (*handle_input)(int fd, struct device *me); + + /* Watch DMA to this key if handle_input non-NULL. */ + unsigned long watch_key; + u32 (*handle_output)(int fd, const struct iovec *iov, + unsigned int num, struct device *me); + + /* Device-specific data. */ + voi...
2011 Oct 31
3
[PATCH] xenstored: Fix processing of zero-length messages
...ore/xenstored_core.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c index 5d308ca..9e6c2c7 100644 --- a/tools/xenstore/xenstored_core.c +++ b/tools/xenstore/xenstored_core.c @@ -1297,7 +1297,6 @@ static void handle_input(struct connection *conn) goto bad_client; in->used = 0; in->inhdr = false; - return; } bytes = conn->read(conn, in->buffer + in->used, -- 1.7.6.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xens...
2007 Apr 18
1
[PATCH] Lguest launcher, child starving parent
...fds); - } kill(getppid(), SIGUSR1); + /* wait for parent response */ + if (read(pipefd, &ignorefd, sizeof(ignorefd)) == 0) + exit(0); + if (ignorefd >= 0) + FD_CLR(ignorefd, &devices->infds); } } @@ -594,6 +594,7 @@ static void handle_output(int fd, unsign static void handle_input(int fd, int childfd, struct device_list *devices) { struct timeval poll = { .tv_sec = 0, .tv_usec = 0 }; + int fdok = -1; for (;;) { struct device *i; @@ -608,7 +609,9 @@ static void handle_input(int fd, int chi FD_CLR(i->fd, &devices->infds); /* Tell child to ignore...
2007 Apr 18
1
[PATCH] Lguest launcher, child starving parent
...fds); - } kill(getppid(), SIGUSR1); + /* wait for parent response */ + if (read(pipefd, &ignorefd, sizeof(ignorefd)) == 0) + exit(0); + if (ignorefd >= 0) + FD_CLR(ignorefd, &devices->infds); } } @@ -594,6 +594,7 @@ static void handle_output(int fd, unsign static void handle_input(int fd, int childfd, struct device_list *devices) { struct timeval poll = { .tv_sec = 0, .tv_usec = 0 }; + int fdok = -1; for (;;) { struct device *i; @@ -608,7 +609,9 @@ static void handle_input(int fd, int chi FD_CLR(i->fd, &devices->infds); /* Tell child to ignore...
2007 Sep 17
4
Xenstored: eliminate double free and fixes for memory leak
Please review. This patch fixes a few problems: a. In handle_input(), which is called from main() in xenstored_core.c, the conn->in is freed when there is no error, but conn is freed when there is error. This is inconsistent. Moreover, the conn is freed again upon exit from handle_input(), inside the main. b. Another problem is that perms_to_strings() ret...
2007 Apr 18
1
[PATCH 0/2] Use a single loader for i386 and x86_64
...+typedef unsigned long (*load_function)(int, void *, unsigned long, + unsigned long *, const char *, unsigned long *, + unsigned long *); + #define PAGE_PRESENT 0x7 /* Present, RW, Execute */ #define NET_PEERNUM 1 @@ -63,8 +74,8 @@ struct device /* Watch DMA to this address if handle_input non-NULL. */ unsigned long watch_address; - u32 (*handle_output)(int fd, const struct iovec *iov, - unsigned int num, struct device *me); + unsigned long (*handle_output)(int fd, const struct iovec *iov, + unsigned int num, struct device *me); /* Device-specific data. */ void...
2007 Apr 18
1
[PATCH 0/2] Use a single loader for i386 and x86_64
...+typedef unsigned long (*load_function)(int, void *, unsigned long, + unsigned long *, const char *, unsigned long *, + unsigned long *); + #define PAGE_PRESENT 0x7 /* Present, RW, Execute */ #define NET_PEERNUM 1 @@ -63,8 +74,8 @@ struct device /* Watch DMA to this address if handle_input non-NULL. */ unsigned long watch_address; - u32 (*handle_output)(int fd, const struct iovec *iov, - unsigned int num, struct device *me); + unsigned long (*handle_output)(int fd, const struct iovec *iov, + unsigned int num, struct device *me); /* Device-specific data. */ void...
2014 Oct 24
5
[PATCH RFC 00/11] qemu: towards virtio-1 host support
...{ + f &= ~(1 << (VIRTIO_F_VERSION_1 - 32)); + } if (index > 0) { return f; } diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c index 2814017..bf6101d 100644 --- a/hw/virtio/virtio-rng.c +++ b/hw/virtio/virtio-rng.c @@ -101,6 +101,9 @@ static void handle_input(VirtIODevice *vdev, VirtQueue *vq) static uint32_t get_features(VirtIODevice *vdev, unsigned int index, uint32_t f) { + if (index == 1) { + f &= ~(1 << (VIRTIO_F_VERSION_1 - 32)); + } return f; } > - blk has some features removed under 1.0, > specificall...
2014 Oct 24
5
[PATCH RFC 00/11] qemu: towards virtio-1 host support
...{ + f &= ~(1 << (VIRTIO_F_VERSION_1 - 32)); + } if (index > 0) { return f; } diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c index 2814017..bf6101d 100644 --- a/hw/virtio/virtio-rng.c +++ b/hw/virtio/virtio-rng.c @@ -101,6 +101,9 @@ static void handle_input(VirtIODevice *vdev, VirtQueue *vq) static uint32_t get_features(VirtIODevice *vdev, unsigned int index, uint32_t f) { + if (index == 1) { + f &= ~(1 << (VIRTIO_F_VERSION_1 - 32)); + } return f; } > - blk has some features removed under 1.0, > specificall...
2007 Dec 20
5
[PATCH 0/16] lguest: introduce vcpu structure
this patch makes room for the vcpu structure in lguest, already used in this very same way at lguest64. It's the first part of our plan to have lguest and lguest64 unified too. When two dogs hang out, you don't have new puppies right in the other day. Some time has to be elapsed. They have to grow first. In this same spirit, having these patches _do not_ mean smp guests can be launched
2007 Dec 20
5
[PATCH 0/16] lguest: introduce vcpu structure
this patch makes room for the vcpu structure in lguest, already used in this very same way at lguest64. It's the first part of our plan to have lguest and lguest64 unified too. When two dogs hang out, you don't have new puppies right in the other day. Some time has to be elapsed. They have to grow first. In this same spirit, having these patches _do not_ mean smp guests can be launched
2014 Oct 28
0
[PATCH RFC 00/11] qemu: towards virtio-1 host support
...RSION_1 - 32)); > + } > if (index > 0) { > return f; > } > diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c > index 2814017..bf6101d 100644 > --- a/hw/virtio/virtio-rng.c > +++ b/hw/virtio/virtio-rng.c > @@ -101,6 +101,9 @@ static void handle_input(VirtIODevice *vdev, VirtQueue *vq) > > static uint32_t get_features(VirtIODevice *vdev, unsigned int index, uint32_t f) > { > + if (index == 1) { > + f &= ~(1 << (VIRTIO_F_VERSION_1 - 32)); > + } > return f; > } > > > > > -...
2007 Dec 21
0
[kvm-devel] [Virtio-for-kvm] [PATCH 1/13] [Mostly resend] virtio additions
...u(v16) (v16) #define le32_to_cpu(v32) (v32) -#define le64_to_cpu(v32) (v64) +#define le64_to_cpu(v64) (v64) /*L:100 The Launcher code itself takes us out into userspace, that scary place * where pointers run wild and free! Unfortunately, like most userspace @@ -980,54 +980,44 @@ static void handle_input(int fd) * * All devices need a descriptor so the Guest knows it exists, and a "struct * device" so the Launcher can keep track of it. We have common helper - * routines to allocate them. - * - * This routine allocates a new "struct lguest_device_desc" from descriptor - *...
2007 Dec 21
0
[kvm-devel] [Virtio-for-kvm] [PATCH 1/13] [Mostly resend] virtio additions
...u(v16) (v16) #define le32_to_cpu(v32) (v32) -#define le64_to_cpu(v32) (v64) +#define le64_to_cpu(v64) (v64) /*L:100 The Launcher code itself takes us out into userspace, that scary place * where pointers run wild and free! Unfortunately, like most userspace @@ -980,54 +980,44 @@ static void handle_input(int fd) * * All devices need a descriptor so the Guest knows it exists, and a "struct * device" so the Launcher can keep track of it. We have common helper - * routines to allocate them. - * - * This routine allocates a new "struct lguest_device_desc" from descriptor - *...