summary refs log tree commit diff stats
path: root/util/filemonitor-inotify.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/filemonitor-inotify.c')
-rw-r--r--util/filemonitor-inotify.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/util/filemonitor-inotify.c b/util/filemonitor-inotify.c
index 3a72be037f..3eb29f860b 100644
--- a/util/filemonitor-inotify.c
+++ b/util/filemonitor-inotify.c
@@ -29,7 +29,7 @@
 
 struct QFileMonitor {
     int fd;
-
+    int nextid; /* watch ID counter */
     QemuMutex lock; /* protects dirs & idmap */
     GHashTable *dirs; /* dirname => QFileMonitorDir */
     GHashTable *idmap; /* inotify ID => dirname */
@@ -47,7 +47,6 @@ typedef struct {
 typedef struct {
     char *path;
     int id; /* inotify ID */
-    int nextid; /* watch ID counter */
     GArray *watches; /* QFileMonitorWatch elements */
 } QFileMonitorDir;
 
@@ -277,7 +276,7 @@ qemu_file_monitor_add_watch(QFileMonitor *mon,
         }
     }
 
-    watch.id = dir->nextid++;
+    watch.id = mon->nextid++;
     watch.filename = g_strdup(filename);
     watch.cb = cb;
     watch.opaque = opaque;