Introduce a VIR_ATTR_UNUSED macro to annotate parameters that are unused in
functions.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/domain.c | 78 +++++++++++++++++++++++++++++------------------------------
src/events.c | 12 ++++-----
src/main.c | 12 ++++-----
src/manager.c | 4 +--
src/util.h | 2 ++
5 files changed, 55 insertions(+), 53 deletions(-)
diff --git a/src/domain.c b/src/domain.c
index bbe27b9..5527778 100644
--- a/src/domain.c
+++ b/src/domain.c
@@ -2,13 +2,13 @@
#include "util.h"
static int
-virtDBusDomainGetName(sd_bus *bus,
+virtDBusDomainGetName(sd_bus *bus VIR_ATTR_UNUSED,
const char *path,
- const char *interface,
- const char *property,
+ const char *interface VIR_ATTR_UNUSED,
+ const char *property VIR_ATTR_UNUSED,
sd_bus_message *reply,
void *userdata,
- sd_bus_error *error)
+ sd_bus_error *error VIR_ATTR_UNUSED)
{
virtDBusManager *manager = userdata;
_cleanup_(virtDBusUtilVirDomainFreep) virDomainPtr domain = NULL;
@@ -26,13 +26,13 @@ virtDBusDomainGetName(sd_bus *bus,
}
static int
-virtDBusDomainGetUUID(sd_bus *bus,
+virtDBusDomainGetUUID(sd_bus *bus VIR_ATTR_UNUSED,
const char *path,
- const char *interface,
- const char *property,
+ const char *interface VIR_ATTR_UNUSED,
+ const char *property VIR_ATTR_UNUSED,
sd_bus_message *reply,
void *userdata,
- sd_bus_error *error)
+ sd_bus_error *error VIR_ATTR_UNUSED)
{
virtDBusManager *manager = userdata;
_cleanup_(virtDBusUtilVirDomainFreep) virDomainPtr domain = NULL;
@@ -48,13 +48,13 @@ virtDBusDomainGetUUID(sd_bus *bus,
}
static int
-virtDBusDomainGetId(sd_bus *bus,
+virtDBusDomainGetId(sd_bus *bus VIR_ATTR_UNUSED,
const char *path,
- const char *interface,
- const char *property,
+ const char *interface VIR_ATTR_UNUSED,
+ const char *property VIR_ATTR_UNUSED,
sd_bus_message *reply,
void *userdata,
- sd_bus_error *error)
+ sd_bus_error *error VIR_ATTR_UNUSED)
{
virtDBusManager *manager = userdata;
_cleanup_(virtDBusUtilVirDomainFreep) virDomainPtr domain = NULL;
@@ -67,13 +67,13 @@ virtDBusDomainGetId(sd_bus *bus,
}
static int
-virtDBusDomainGetVcpus(sd_bus *bus,
+virtDBusDomainGetVcpus(sd_bus *bus VIR_ATTR_UNUSED,
const char *path,
- const char *interface,
- const char *property,
+ const char *interface VIR_ATTR_UNUSED,
+ const char *property VIR_ATTR_UNUSED,
sd_bus_message *reply,
void *userdata,
- sd_bus_error *error)
+ sd_bus_error *error VIR_ATTR_UNUSED)
{
virtDBusManager *manager = userdata;
_cleanup_(virtDBusUtilVirDomainFreep) virDomainPtr domain = NULL;
@@ -86,13 +86,13 @@ virtDBusDomainGetVcpus(sd_bus *bus,
}
static int
-virtDBusDomainGetOsType(sd_bus *bus,
+virtDBusDomainGetOsType(sd_bus *bus VIR_ATTR_UNUSED,
const char *path,
- const char *interface,
- const char *property,
+ const char *interface VIR_ATTR_UNUSED,
+ const char *property VIR_ATTR_UNUSED,
sd_bus_message *reply,
void *userdata,
- sd_bus_error *error)
+ sd_bus_error *error VIR_ATTR_UNUSED)
{
virtDBusManager *manager = userdata;
_cleanup_(virtDBusUtilVirDomainFreep) virDomainPtr domain = NULL;
@@ -110,13 +110,13 @@ virtDBusDomainGetOsType(sd_bus *bus,
}
static int
-virtDBusDomainGetActive(sd_bus *bus,
+virtDBusDomainGetActive(sd_bus *bus VIR_ATTR_UNUSED,
const char *path,
- const char *interface,
- const char *property,
+ const char *interface VIR_ATTR_UNUSED,
+ const char *property VIR_ATTR_UNUSED,
sd_bus_message *reply,
void *userdata,
- sd_bus_error *error)
+ sd_bus_error *error VIR_ATTR_UNUSED)
{
virtDBusManager *manager = userdata;
_cleanup_(virtDBusUtilVirDomainFreep) virDomainPtr domain = NULL;
@@ -134,13 +134,13 @@ virtDBusDomainGetActive(sd_bus *bus,
}
static int
-virtDBusDomainGetPersistent(sd_bus *bus,
+virtDBusDomainGetPersistent(sd_bus *bus VIR_ATTR_UNUSED,
const char *path,
- const char *interface,
- const char *property,
+ const char *interface VIR_ATTR_UNUSED,
+ const char *property VIR_ATTR_UNUSED,
sd_bus_message *reply,
void *userdata,
- sd_bus_error *error)
+ sd_bus_error *error VIR_ATTR_UNUSED)
{
virtDBusManager *manager = userdata;
_cleanup_(virtDBusUtilVirDomainFreep) virDomainPtr domain = NULL;
@@ -158,13 +158,13 @@ virtDBusDomainGetPersistent(sd_bus *bus,
}
static int
-virtDBusDomainGetState(sd_bus *bus,
+virtDBusDomainGetState(sd_bus *bus VIR_ATTR_UNUSED,
const char *path,
- const char *interface,
- const char *property,
+ const char *interface VIR_ATTR_UNUSED,
+ const char *property VIR_ATTR_UNUSED,
sd_bus_message *reply,
void *userdata,
- sd_bus_error *error)
+ sd_bus_error *error VIR_ATTR_UNUSED)
{
virtDBusManager *manager = userdata;
_cleanup_(virtDBusUtilVirDomainFreep) virDomainPtr domain = NULL;
@@ -209,13 +209,13 @@ virtDBusDomainGetState(sd_bus *bus,
}
static int
-virtDBusDomainGetAutostart(sd_bus *bus,
+virtDBusDomainGetAutostart(sd_bus *bus VIR_ATTR_UNUSED,
const char *path,
- const char *interface,
- const char *property,
+ const char *interface VIR_ATTR_UNUSED,
+ const char *property VIR_ATTR_UNUSED,
sd_bus_message *reply,
void *userdata,
- sd_bus_error *error)
+ sd_bus_error *error VIR_ATTR_UNUSED)
{
virtDBusManager *manager = userdata;
_cleanup_(virtDBusUtilVirDomainFreep) virDomainPtr domain = NULL;
@@ -502,12 +502,12 @@ static const sd_bus_vtable virt_domain_vtable[] = {
};
static int
-virtDBusDomainLookup(sd_bus *bus,
+virtDBusDomainLookup(sd_bus *bus VIR_ATTR_UNUSED,
const char *path,
- const char *interface,
+ const char *interface VIR_ATTR_UNUSED,
void *userdata,
void **found,
- sd_bus_error *error)
+ sd_bus_error *error VIR_ATTR_UNUSED)
{
virtDBusManager *manager = userdata;
_cleanup_(virtDBusUtilFreep) char *name = NULL;
diff --git a/src/events.c b/src/events.c
index f8fe839..731ef02 100644
--- a/src/events.c
+++ b/src/events.c
@@ -6,10 +6,10 @@
#include <systemd/sd-bus.h>
static int
-virtDBusEventsDomainLifecycle(virConnectPtr connection,
+virtDBusEventsDomainLifecycle(virConnectPtr connection VIR_ATTR_UNUSED,
virDomainPtr domain,
int event,
- int detail,
+ int detail VIR_ATTR_UNUSED,
void *opaque)
{
virtDBusManager *manager = opaque;
@@ -70,7 +70,7 @@ virtDBusEventsDomainLifecycle(virConnectPtr connection,
}
static int
-virtDBusEventsDomainDeviceAdded(virConnectPtr connection,
+virtDBusEventsDomainDeviceAdded(virConnectPtr connection VIR_ATTR_UNUSED,
virDomainPtr domain,
const char *device,
void *opaque)
@@ -98,7 +98,7 @@ virtDBusEventsDomainDeviceAdded(virConnectPtr connection,
}
static int
-virtDBusEventsDomainDeviceRemoved(virConnectPtr connection,
+virtDBusEventsDomainDeviceRemoved(virConnectPtr connection VIR_ATTR_UNUSED,
virDomainPtr domain,
const char *device,
void *opaque)
@@ -126,7 +126,7 @@ virtDBusEventsDomainDeviceRemoved(virConnectPtr connection,
}
static int
-virtDBusEventsDomainDiskChange(virConnectPtr connection,
+virtDBusEventsDomainDiskChange(virConnectPtr connection VIR_ATTR_UNUSED,
virDomainPtr domain,
const char *device,
int reason,
@@ -168,7 +168,7 @@ virtDBusEventsDomainDiskChange(virConnectPtr connection,
}
static int
-virtDBusEventsDomainTrayChange(virConnectPtr connection,
+virtDBusEventsDomainTrayChange(virConnectPtr connection VIR_ATTR_UNUSED,
virDomainPtr domain,
const char *old_src_path,
const char *new_src_path,
diff --git a/src/main.c b/src/main.c
index db5d4a5..a6a0212 100644
--- a/src/main.c
+++ b/src/main.c
@@ -55,18 +55,18 @@ virtDBusVirEventRemoveHandlep(int *watchp)
}
static void
-virtDBusHandleSignal(int watch,
- int fd,
- int events,
- void *opaque)
+virtDBusHandleSignal(int watch VIR_ATTR_UNUSED,
+ int fd VIR_ATTR_UNUSED,
+ int events VIR_ATTR_UNUSED,
+ void *opaque VIR_ATTR_UNUSED)
{
loop_status = -ECANCELED;
}
static void
virtDBusHandleBusEvent(int watch,
- int fd,
- int events,
+ int fd VIR_ATTR_UNUSED,
+ int events VIR_ATTR_UNUSED,
void *opaque)
{
sd_bus *bus = opaque;
diff --git a/src/manager.c b/src/manager.c
index 77fb4bc..f289a7a 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -7,8 +7,8 @@
#include <stdlib.h>
static int
-virtDBusManagerEnumarateDomains(sd_bus *bus,
- const char *path,
+virtDBusManagerEnumarateDomains(sd_bus *bus VIR_ATTR_UNUSED,
+ const char *path VIR_ATTR_UNUSED,
void *userdata,
char ***nodes,
sd_bus_error *error)
diff --git a/src/util.h b/src/util.h
index 3c80fef..0c9f3d7 100644
--- a/src/util.h
+++ b/src/util.h
@@ -6,6 +6,8 @@
#include <unistd.h>
#define _cleanup_(_x) __attribute__((__cleanup__(_x)))
+#define VIR_ATTR_UNUSED __attribute__((__unused__))
+
int
virtDBusUtilMessageAppendTypedParameters(sd_bus_message *message,
--
2.13.6