[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC v9 15/27] notifier: Add a function to set the notifier
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [RFC v9 15/27] notifier: Add a function to set the notifier |
Date: |
Wed, 18 Jul 2012 16:07:42 +0100 |
Although past users only needed to test and clear event notifiers, it is
useful to be able to set them too.
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
event_notifier.c | 7 +++++++
event_notifier.h | 1 +
2 files changed, 8 insertions(+)
diff --git a/event_notifier.c b/event_notifier.c
index 0b82981..006adc5 100644
--- a/event_notifier.c
+++ b/event_notifier.c
@@ -59,3 +59,10 @@ int event_notifier_test(EventNotifier *e)
}
return r == sizeof(value);
}
+
+int event_notifier_set(EventNotifier *e)
+{
+ uint64_t value = 1;
+ int r = write(e->fd, &value, sizeof(value));
+ return r == sizeof(value);
+}
diff --git a/event_notifier.h b/event_notifier.h
index 886222c..46a22f8 100644
--- a/event_notifier.h
+++ b/event_notifier.h
@@ -24,5 +24,6 @@ void event_notifier_cleanup(EventNotifier *);
int event_notifier_get_fd(EventNotifier *);
int event_notifier_test_and_clear(EventNotifier *);
int event_notifier_test(EventNotifier *);
+int event_notifier_set(EventNotifier *);
#endif
--
1.7.10.4
- [Qemu-devel] [RFC v9 00/27] virtio: virtio-blk data plane, Stefan Hajnoczi, 2012/07/18
- [Qemu-devel] [RFC v9 01/27] virtio-blk: Remove virtqueue request handling code, Stefan Hajnoczi, 2012/07/18
- [Qemu-devel] [RFC v9 03/27] virtio-blk: Data plane thread event loop, Stefan Hajnoczi, 2012/07/18
- [Qemu-devel] [RFC v9 02/27] virtio-blk: Set up host notifier for data plane, Stefan Hajnoczi, 2012/07/18
- [Qemu-devel] [RFC v9 04/27] virtio-blk: Map vring, Stefan Hajnoczi, 2012/07/18
- [Qemu-devel] [RFC v9 15/27] notifier: Add a function to set the notifier,
Stefan Hajnoczi <=
- [Qemu-devel] [RFC v9 05/27] virtio-blk: Do cheapest possible memory mapping, Stefan Hajnoczi, 2012/07/18
- [Qemu-devel] [RFC v9 07/27] virtio-blk: Put dataplane code into its own directory, Stefan Hajnoczi, 2012/07/18
- [Qemu-devel] [RFC v9 09/27] virtio-blk: Add Linux AIO queue, Stefan Hajnoczi, 2012/07/18
- [Qemu-devel] [RFC v9 10/27] virtio-blk: Stop data plane thread cleanly, Stefan Hajnoczi, 2012/07/18
- [Qemu-devel] [RFC v9 23/27] virtio-blk: Stub out SCSI commands, Stefan Hajnoczi, 2012/07/18
- [Qemu-devel] [RFC v9 13/27] virtio-blk: Increase max requests for indirect vring, Stefan Hajnoczi, 2012/07/18
- [Qemu-devel] [RFC v9 06/27] virtio-blk: Take PCI memory range into account, Stefan Hajnoczi, 2012/07/18