summaryrefslogtreecommitdiff
path: root/src/xenxs
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2011-07-08 15:58:28 -0600
committerEric Blake <eblake@redhat.com>2011-07-14 07:51:30 -0600
commit088473b29f2169d4dabfbc7ccdf085cd964943a3 (patch)
tree3e3862f9b5bd9e3d5d465c2a73bdac288bfd5e7d /src/xenxs
parentremote: prefer unsigned flags (diff)
downloadlibvirt-088473b29f2169d4dabfbc7ccdf085cd964943a3.tar.gz
libvirt-088473b29f2169d4dabfbc7ccdf085cd964943a3.tar.bz2
libvirt-088473b29f2169d4dabfbc7ccdf085cd964943a3.zip
build: avoid ATTRIBUTE_UNUSED in headers
The compiler might optimize based on our declaration that something is unused. Putting that declaration in the header risks getting out of sync with the actual implementation, so it belongs better only in the .c files. We were mostly compliant, and a new syntax check will help us in the future. * cfg.mk (sc_avoid_attribute_unused_in_header): New syntax check. * src/nodeinfo.h (nodeGetCPUStats, nodeGetMemoryStats): Delete attribute already present in .c file. * src/qemu/qemu_domain.h (qemuDomainEventFlush): Likewise. * src/util/virterror_internal.h (virReportErrorHelper): Parameters are actually used by .c file. * src/xenxs/xen_sxpr.h (xenFormatSxprDisk): Adjust prototype. * src/xenxs/xen_sxpr.c (xenFormatSxprDisk): Delete unused argument. (xenFormatSxpr): Adjust caller. * src/xen/xend_internal.c (xenDaemonAttachDeviceFlags) (xenDaemonUpdateDeviceFlags): Likewise. Suggested by Daniel Veillard.
Diffstat (limited to 'src/xenxs')
-rw-r--r--src/xenxs/xen_sxpr.c5
-rw-r--r--src/xenxs/xen_sxpr.h3
2 files changed, 3 insertions, 5 deletions
diff --git a/src/xenxs/xen_sxpr.c b/src/xenxs/xen_sxpr.c
index bd770bc26..4245a6452 100644
--- a/src/xenxs/xen_sxpr.c
+++ b/src/xenxs/xen_sxpr.c
@@ -1605,8 +1605,7 @@ xenFormatSxprChr(virDomainChrDefPtr def,
* Returns 0 in case of success, -1 in case of error.
*/
int
-xenFormatSxprDisk(virConnectPtr conn ATTRIBUTE_UNUSED,
- virDomainDiskDefPtr def,
+xenFormatSxprDisk(virDomainDiskDefPtr def,
virBufferPtr buf,
int hvm,
int xendConfigVersion,
@@ -2270,7 +2269,7 @@ xenFormatSxpr(virConnectPtr conn,
}
for (i = 0 ; i < def->ndisks ; i++)
- if (xenFormatSxprDisk(conn, def->disks[i],
+ if (xenFormatSxprDisk(def->disks[i],
&buf, hvm, xendConfigVersion, 0) < 0)
goto error;
diff --git a/src/xenxs/xen_sxpr.h b/src/xenxs/xen_sxpr.h
index b2f8790e9..a66c60ae3 100644
--- a/src/xenxs/xen_sxpr.h
+++ b/src/xenxs/xen_sxpr.h
@@ -46,8 +46,7 @@ int xenParseSxprSound(virDomainDefPtr def, const char *str);
virDomainChrDefPtr xenParseSxprChar(const char *value, const char *tty);
-int xenFormatSxprDisk(virConnectPtr conn ATTRIBUTE_UNUSED,
- virDomainDiskDefPtr def, virBufferPtr buf, int hvm,
+int xenFormatSxprDisk(virDomainDiskDefPtr def, virBufferPtr buf, int hvm,
int xendConfigVersion, int isAttach);
int xenFormatSxprNet(virConnectPtr conn,