[libvirt] Concerning umlInotifyEvent

Daniel P. Berrange berrange at redhat.com
Sun Nov 30 18:38:11 UTC 2008


On Sun, Nov 30, 2008 at 03:17:04PM +0000, Ron Yorston wrote:
> At the top of umlInotifyEvent in uml_driver.c there is this test:
> 
>     if (watch != driver->inotifyWatch)
>         return;
> 
> This doesn't seem to be correct.  I have to comment out the test to get
> libvirtd to work with UML.

That's a symptom of a bug earlier on. Try this patch:

Index: src/uml_driver.c
===================================================================
RCS file: /data/cvs/libvirt/src/uml_driver.c,v
retrieving revision 1.4
diff -u -p -r1.4 uml_driver.c
--- src/uml_driver.c	28 Nov 2008 12:03:20 -0000	1.4
+++ src/uml_driver.c	30 Nov 2008 18:34:43 -0000
@@ -348,16 +348,16 @@ umlStartup(void) {
         return -1;
     }
 
-    if ((uml_driver->inotifyWatch =
-         inotify_add_watch(uml_driver->inotifyFD,
-                           uml_driver->monitorDir,
-                           IN_CREATE | IN_MODIFY | IN_DELETE)) < 0) {
+    if (inotify_add_watch(uml_driver->inotifyFD,
+                          uml_driver->monitorDir,
+                          IN_CREATE | IN_MODIFY | IN_DELETE) < 0) {
         umlShutdown();
         return -1;
     }
 
-    if (virEventAddHandle(uml_driver->inotifyFD, POLLIN,
-                          umlInotifyEvent, uml_driver, NULL) < 0) {
+    if ((uml_driver->inotifyWatch =
+         virEventAddHandle(uml_driver->inotifyFD, POLLIN,
+                           umlInotifyEvent, uml_driver, NULL)) < 0) {
         umlShutdown();
         return -1;
     }


Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|




More information about the libvir-list mailing list