Re: [libvirt] [PATCH] Remove redundant monitorWatch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Daniel P. Berrange wrote:
> On Mon, Feb 16, 2009 at 06:42:11PM -0500, Cole Robinson wrote:
>> For some reason there are two VMDef members being used to keep track of
>> monitor event handles: monitor_watch and monitorWatch. Remove the latter.
> 
> Can you remove the 'monitor_watch' instead - all the other variables
> in the domain_conf.h structs use leading capital letters for separating
> words, and not underscores.
> 

Yup, sorry for not noticing that before.

Updated patch attached.

Thanks,
Cole
commit a70387b6075d9a9d663a7fb1f9a1309324327bc8
Author: Cole (Work Acct) <crobinso@virt1.(none)>
Date:   Thu Feb 26 22:18:58 2009 -0500

    Remove redundant monitor watch variable (s/monitor_watch/monitorWatch/)

diff --git a/src/domain_conf.c b/src/domain_conf.c
index 622665c..603b87b 100644
--- a/src/domain_conf.c
+++ b/src/domain_conf.c
@@ -503,7 +503,7 @@ virDomainObjPtr virDomainAssignDef(virConnectPtr conn,
     virDomainObjLock(domain);
     domain->state = VIR_DOMAIN_SHUTOFF;
     domain->def = def;
-    domain->monitor_watch = -1;
+    domain->monitorWatch = -1;
     domain->monitor = -1;
 
     if (VIR_REALLOC_N(doms->objs, doms->count + 1) < 0) {
diff --git a/src/domain_conf.h b/src/domain_conf.h
index b6f6b43..491df06 100644
--- a/src/domain_conf.h
+++ b/src/domain_conf.h
@@ -473,7 +473,6 @@ struct _virDomainObj {
     virMutex lock;
 
     int monitor;
-    int monitor_watch;
     char *monitorpath;
     int monitorWatch;
     int logfile;
diff --git a/src/qemu_driver.c b/src/qemu_driver.c
index a8a2ae7..34854dd 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -775,9 +775,9 @@ static int qemudOpenMonitor(virConnectPtr conn,
         goto error;
     }
 
-    if ((vm->monitor_watch = virEventAddHandle(vm->monitor, 0,
-                                               qemudDispatchVMEvent,
-                                               driver, NULL)) < 0)
+    if ((vm->monitorWatch = virEventAddHandle(vm->monitor, 0,
+                                              qemudDispatchVMEvent,
+                                              driver, NULL)) < 0)
         goto error;
 
 
@@ -1329,9 +1329,9 @@ static void qemudShutdownVMDaemon(virConnectPtr conn ATTRIBUTE_UNUSED,
                              _("Failed to send SIGTERM to %s (%d)"),
                              vm->def->name, vm->pid);
 
-    if (vm->monitor_watch != -1) {
-        virEventRemoveHandle(vm->monitor_watch);
-        vm->monitor_watch = -1;
+    if (vm->monitorWatch != -1) {
+        virEventRemoveHandle(vm->monitorWatch);
+        vm->monitorWatch = -1;
     }
 
     if (close(vm->logfile) < 0) {
@@ -1379,7 +1379,7 @@ qemudDispatchVMEvent(int watch, int fd, int events, void *opaque) {
         virDomainObjPtr tmpvm = driver->domains.objs[i];
         virDomainObjLock(tmpvm);
         if (virDomainIsActive(tmpvm) &&
-            tmpvm->monitor_watch == watch) {
+            tmpvm->monitorWatch == watch) {
             vm = tmpvm;
             break;
         }
--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]