summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPeter Maydell2019-04-02 15:52:17 +0200
committerPeter Maydell2019-04-02 15:52:17 +0200
commit436960c95946007aca713330e7a488a6f2e0696f (patch)
tree2ee2842fa097887052aa09c4f409af7a6367e193 /include
parentMerge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging (diff)
parentfilemon: fix watch IDs to avoid potential wraparound issues (diff)
downloadqemu-436960c95946007aca713330e7a488a6f2e0696f.tar.gz
qemu-436960c95946007aca713330e7a488a6f2e0696f.tar.xz
qemu-436960c95946007aca713330e7a488a6f2e0696f.zip
Merge remote-tracking branch 'remotes/berrange/tags/filemon-next-pull-request' into staging
filemon: various fixes / improvements to file monitor for USB MTP Ensure watch IDs unique within a monitor and avoid integer wraparound issues when many watches are set & unset over time. # gpg: Signature made Tue 02 Apr 2019 13:53:40 BST # gpg: using RSA key BE86EBB415104FDF # gpg: Good signature from "Daniel P. Berrange <dan@berrange.com>" [full] # gpg: aka "Daniel P. Berrange <berrange@redhat.com>" [full] # Primary key fingerprint: DAF3 A6FD B26B 6291 2D0E 8E3F BE86 EBB4 1510 4FDF * remotes/berrange/tags/filemon-next-pull-request: filemon: fix watch IDs to avoid potential wraparound issues filemon: ensure watch IDs are unique to QFileMonitor scope tests: refactor file monitor test to make it more understandable Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/authz/listfile.h2
-rw-r--r--include/qemu/filemonitor.h16
2 files changed, 9 insertions, 9 deletions
diff --git a/include/authz/listfile.h b/include/authz/listfile.h
index ebbd5a4288..0d618c903c 100644
--- a/include/authz/listfile.h
+++ b/include/authz/listfile.h
@@ -92,7 +92,7 @@ struct QAuthZListFile {
char *filename;
bool refresh;
QFileMonitor *file_monitor;
- int file_watch;
+ int64_t file_watch;
};
diff --git a/include/qemu/filemonitor.h b/include/qemu/filemonitor.h
index cd031832ed..64267d09b2 100644
--- a/include/qemu/filemonitor.h
+++ b/include/qemu/filemonitor.h
@@ -52,7 +52,7 @@ typedef enum {
* empty.
*
*/
-typedef void (*QFileMonitorHandler)(int id,
+typedef void (*QFileMonitorHandler)(int64_t id,
QFileMonitorEvent event,
const char *filename,
void *opaque);
@@ -103,12 +103,12 @@ void qemu_file_monitor_free(QFileMonitor *mon);
*
* Returns: a positive integer watch ID, or -1 on error
*/
-int qemu_file_monitor_add_watch(QFileMonitor *mon,
- const char *dirpath,
- const char *filename,
- QFileMonitorHandler cb,
- void *opaque,
- Error **errp);
+int64_t qemu_file_monitor_add_watch(QFileMonitor *mon,
+ const char *dirpath,
+ const char *filename,
+ QFileMonitorHandler cb,
+ void *opaque,
+ Error **errp);
/**
* qemu_file_monitor_remove_watch:
@@ -123,6 +123,6 @@ int qemu_file_monitor_add_watch(QFileMonitor *mon,
*/
void qemu_file_monitor_remove_watch(QFileMonitor *mon,
const char *dirpath,
- int id);
+ int64_t id);
#endif /* QEMU_FILE_MONITOR_H */