[libvirt PATCH 4/6] src: don't include ref count in debug messages / probes

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

 



The ref count will be private to the GObject base class
and we must not peek at it, even for debugging messages.

Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>
---
 src/admin/libvirt-admin.c       | 3 +--
 src/libvirt-domain-checkpoint.c | 3 +--
 src/libvirt-domain-snapshot.c   | 3 +--
 src/libvirt-domain.c            | 2 +-
 src/libvirt-host.c              | 2 +-
 src/libvirt-interface.c         | 2 +-
 src/libvirt-network.c           | 6 ++----
 src/libvirt-nodedev.c           | 2 +-
 src/libvirt-nwfilter.c          | 6 ++----
 src/libvirt-secret.c            | 3 +--
 src/libvirt-storage.c           | 4 ++--
 src/libvirt-stream.c            | 3 +--
 src/libvirt_qemu_probes.d       | 8 ++++----
 src/qemu/qemu_monitor.c         | 7 ++-----
 14 files changed, 21 insertions(+), 33 deletions(-)

diff --git a/src/admin/libvirt-admin.c b/src/admin/libvirt-admin.c
index 1d4ac51296..b7f21275cb 100644
--- a/src/admin/libvirt-admin.c
+++ b/src/admin/libvirt-admin.c
@@ -322,8 +322,7 @@ virAdmConnectClose(virAdmConnectPtr conn)
 int
 virAdmConnectRef(virAdmConnectPtr conn)
 {
-    VIR_DEBUG("conn=%p refs=%d", conn,
-              conn ? conn->parent.parent.u.s.refs : 0);
+    VIR_DEBUG("conn=%p", conn);
 
     virResetLastError();
     virCheckAdmConnectReturn(conn, -1);
diff --git a/src/libvirt-domain-checkpoint.c b/src/libvirt-domain-checkpoint.c
index 432c2d5a52..50627c486c 100644
--- a/src/libvirt-domain-checkpoint.c
+++ b/src/libvirt-domain-checkpoint.c
@@ -535,8 +535,7 @@ virDomainCheckpointDelete(virDomainCheckpointPtr checkpoint,
 int
 virDomainCheckpointRef(virDomainCheckpointPtr checkpoint)
 {
-    VIR_DEBUG("checkpoint=%p, refs=%d", checkpoint,
-              checkpoint ? checkpoint->parent.u.s.refs : 0);
+    VIR_DEBUG("checkpoint=%p", checkpoint);
 
     virResetLastError();
 
diff --git a/src/libvirt-domain-snapshot.c b/src/libvirt-domain-snapshot.c
index 33593e11e9..f856e5b9b8 100644
--- a/src/libvirt-domain-snapshot.c
+++ b/src/libvirt-domain-snapshot.c
@@ -1080,8 +1080,7 @@ virDomainSnapshotDelete(virDomainSnapshotPtr snapshot,
 int
 virDomainSnapshotRef(virDomainSnapshotPtr snapshot)
 {
-    VIR_DEBUG("snapshot=%p, refs=%d", snapshot,
-              snapshot ? snapshot->parent.u.s.refs : 0);
+    VIR_DEBUG("snapshot=%p", snapshot);
 
     virResetLastError();
 
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index 37f864b7b0..60b5e65fc3 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -590,7 +590,7 @@ virDomainFree(virDomainPtr domain)
 int
 virDomainRef(virDomainPtr domain)
 {
-    VIR_DOMAIN_DEBUG(domain, "refs=%d", domain ? domain->parent.u.s.refs : 0);
+    VIR_DOMAIN_DEBUG(domain);
 
     virResetLastError();
 
diff --git a/src/libvirt-host.c b/src/libvirt-host.c
index bc3d1d2803..07d13585f4 100644
--- a/src/libvirt-host.c
+++ b/src/libvirt-host.c
@@ -51,7 +51,7 @@ VIR_LOG_INIT("libvirt.host");
 int
 virConnectRef(virConnectPtr conn)
 {
-    VIR_DEBUG("conn=%p refs=%d", conn, conn ? conn->parent.parent.u.s.refs : 0);
+    VIR_DEBUG("conn=%p", conn);
 
     virResetLastError();
 
diff --git a/src/libvirt-interface.c b/src/libvirt-interface.c
index 2d2df68131..5eb5980483 100644
--- a/src/libvirt-interface.c
+++ b/src/libvirt-interface.c
@@ -642,7 +642,7 @@ virInterfaceDestroy(virInterfacePtr iface, unsigned int flags)
 int
 virInterfaceRef(virInterfacePtr iface)
 {
-    VIR_DEBUG("iface=%p refs=%d", iface, iface ? iface->parent.u.s.refs : 0);
+    VIR_DEBUG("iface=%p", iface);
 
     virResetLastError();
 
diff --git a/src/libvirt-network.c b/src/libvirt-network.c
index 09e24fb0a8..f691b672c7 100644
--- a/src/libvirt-network.c
+++ b/src/libvirt-network.c
@@ -679,8 +679,7 @@ virNetworkFree(virNetworkPtr network)
 int
 virNetworkRef(virNetworkPtr network)
 {
-    VIR_DEBUG("network=%p refs=%d", network,
-              network ? network->parent.u.s.refs : 0);
+    VIR_DEBUG("network=%p", network);
 
     virResetLastError();
 
@@ -1714,8 +1713,7 @@ virNetworkPortFree(virNetworkPortPtr port)
 int
 virNetworkPortRef(virNetworkPortPtr port)
 {
-    VIR_DEBUG("port=%p refs=%d", port,
-              port ? port->parent.u.s.refs : 0);
+    VIR_DEBUG("port=%p", port);
 
     virResetLastError();
 
diff --git a/src/libvirt-nodedev.c b/src/libvirt-nodedev.c
index dce46b7181..cdec123568 100644
--- a/src/libvirt-nodedev.c
+++ b/src/libvirt-nodedev.c
@@ -477,7 +477,7 @@ virNodeDeviceFree(virNodeDevicePtr dev)
 int
 virNodeDeviceRef(virNodeDevicePtr dev)
 {
-    VIR_DEBUG("dev=%p refs=%d", dev, dev ? dev->parent.u.s.refs : 0);
+    VIR_DEBUG("dev=%p", dev);
 
     virResetLastError();
 
diff --git a/src/libvirt-nwfilter.c b/src/libvirt-nwfilter.c
index d28220db8a..e299385895 100644
--- a/src/libvirt-nwfilter.c
+++ b/src/libvirt-nwfilter.c
@@ -503,8 +503,7 @@ virNWFilterGetXMLDesc(virNWFilterPtr nwfilter, unsigned int flags)
 int
 virNWFilterRef(virNWFilterPtr nwfilter)
 {
-    VIR_DEBUG("nwfilter=%p refs=%d", nwfilter,
-              nwfilter ? nwfilter->parent.u.s.refs : 0);
+    VIR_DEBUG("nwfilter=%p", nwfilter);
 
     virResetLastError();
 
@@ -820,8 +819,7 @@ virNWFilterBindingGetXMLDesc(virNWFilterBindingPtr binding, unsigned int flags)
 int
 virNWFilterBindingRef(virNWFilterBindingPtr binding)
 {
-    VIR_DEBUG("binding=%p refs=%d", binding,
-              binding ? binding->parent.u.s.refs : 0);
+    VIR_DEBUG("binding=%p", binding);
 
     virResetLastError();
 
diff --git a/src/libvirt-secret.c b/src/libvirt-secret.c
index 33cbdd7b0b..75d40f53dc 100644
--- a/src/libvirt-secret.c
+++ b/src/libvirt-secret.c
@@ -658,8 +658,7 @@ virSecretUndefine(virSecretPtr secret)
 int
 virSecretRef(virSecretPtr secret)
 {
-    VIR_DEBUG("secret=%p refs=%d", secret,
-              secret ? secret->parent.u.s.refs : 0);
+    VIR_DEBUG("secret=%p", secret);
 
     virResetLastError();
 
diff --git a/src/libvirt-storage.c b/src/libvirt-storage.c
index 0406fe84d3..a45c8b98c1 100644
--- a/src/libvirt-storage.c
+++ b/src/libvirt-storage.c
@@ -872,7 +872,7 @@ virStoragePoolFree(virStoragePoolPtr pool)
 int
 virStoragePoolRef(virStoragePoolPtr pool)
 {
-    VIR_DEBUG("pool=%p refs=%d", pool, pool ? pool->parent.u.s.refs : 0);
+    VIR_DEBUG("pool=%p", pool);
 
     virResetLastError();
 
@@ -1909,7 +1909,7 @@ virStorageVolFree(virStorageVolPtr vol)
 int
 virStorageVolRef(virStorageVolPtr vol)
 {
-    VIR_DEBUG("vol=%p refs=%d", vol, vol ? vol->parent.u.s.refs : 0);
+    VIR_DEBUG("vol=%p", vol);
 
     virResetLastError();
 
diff --git a/src/libvirt-stream.c b/src/libvirt-stream.c
index 41b9cc1445..aeb7562018 100644
--- a/src/libvirt-stream.c
+++ b/src/libvirt-stream.c
@@ -85,8 +85,7 @@ virStreamNew(virConnectPtr conn,
 int
 virStreamRef(virStreamPtr stream)
 {
-    VIR_DEBUG("stream=%p refs=%d", stream,
-              stream ? stream->parent.u.s.refs : 0);
+    VIR_DEBUG("stream=%p", stream);
 
     virResetLastError();
 
diff --git a/src/libvirt_qemu_probes.d b/src/libvirt_qemu_probes.d
index e4449a9922..5bcac7667b 100644
--- a/src/libvirt_qemu_probes.d
+++ b/src/libvirt_qemu_probes.d
@@ -4,10 +4,10 @@ provider libvirt {
         # binary: libvirtd
         # module: libvirt/connection-driver/libvirt_driver_qemu.so
         # Monitor lifecycle
-        probe qemu_monitor_new(void *mon, int refs, int fd);
-        probe qemu_monitor_ref(void *mon, int refs);
-        probe qemu_monitor_unref(void *mon, int refs);
-        probe qemu_monitor_close(void *monm, int refs);
+        probe qemu_monitor_new(void *mon, int fd);
+        probe qemu_monitor_ref(void *mon);
+        probe qemu_monitor_unref(void *mon);
+        probe qemu_monitor_close(void *monm);
 
         # High level monitor message processing
         probe qemu_monitor_send_msg(void *mon, const char *msg, int fd);
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index ff7d66eee5..94fae66708 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -714,9 +714,7 @@ qemuMonitorOpenInternal(virDomainObjPtr vm,
     virObjectLock(mon);
     qemuMonitorRegister(mon);
 
-    PROBE(QEMU_MONITOR_NEW,
-          "mon=%p refs=%d fd=%d",
-          mon, mon->parent.parent.u.s.refs, mon->fd);
+    PROBE(QEMU_MONITOR_NEW, "mon=%p fd=%d", mon, mon->fd);
     virObjectUnlock(mon);
 
     return mon;
@@ -865,8 +863,7 @@ qemuMonitorClose(qemuMonitorPtr mon)
         return;
 
     virObjectLock(mon);
-    PROBE(QEMU_MONITOR_CLOSE,
-          "mon=%p refs=%d", mon, mon->parent.parent.u.s.refs);
+    PROBE(QEMU_MONITOR_CLOSE, "mon=%p", mon);
 
     qemuMonitorSetDomainLogLocked(mon, NULL, NULL, NULL);
 
-- 
2.24.1




[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]

  Powered by Linux