]> xenbits.xensource.com Git - libvirt.git/commitdiff
Fix make check with gcc version 5
authorMartin Kletzander <mkletzan@redhat.com>
Tue, 12 Jan 2016 15:47:13 +0000 (16:47 +0100)
committerMartin Kletzander <mkletzan@redhat.com>
Mon, 18 Jan 2016 14:19:21 +0000 (15:19 +0100)
When building with gcc-5 (particularly gcc-5.3.0 now) and having pdwtags
installed (package dwarves) make check fails with the following error:

  $ make lock_protocol-struct
  GEN      lock_protocol-struct
  --- lock_protocol-structs 2016-01-13 15:04:59.318809607 +0100
  +++ lock_protocol-struct-t3 2016-01-13 15:05:17.703501234 +0100
  @@ -26,10 +26,6 @@
           virLockSpaceProtocolNonNullString name;
           u_int                      flags;
   };
  -enum virLockSpaceProtocolAcquireResourceFlags {
  -        VIR_LOCK_SPACE_PROTOCOL_ACQUIRE_RESOURCE_SHARED = 1,
  -        VIR_LOCK_SPACE_PROTOCOL_ACQUIRE_RESOURCE_AUTOCREATE = 2,
  -};
   struct virLockSpaceProtocolAcquireResourceArgs {
           virLockSpaceProtocolNonNullString path;
           virLockSpaceProtocolNonNullString name;
  Makefile:10415: recipe for target 'lock_protocol-struct' failed
  make: *** [lock_protocol-struct] Error 1

That happens because without any specific options gcc doesn't keep enum
information in the resulting binary object.  I managed to isolate the
parameters of gcc that caused this issue to disappear, however I
remember that they influenced the resulting binaries quite a bit and
were definitely not something we would want to add as mandatory to the
build process.

So to deal with this cleanly, let's take that enum and separate it out
to its own header file.  Since it is only used in the lockd driver and
the protocol, lock_driver_lockd.h feels like a suitable name.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
src/Makefile.am
src/lock_protocol-structs
src/locking/lock_driver_lockd.c
src/locking/lock_driver_lockd.h [new file with mode: 0644]
src/locking/lock_protocol.x

index aa5ab6929b91a13badf7c41dcd7cc3539076c504..0e0db9bac6da79da91056f6c3494352052387aa3 100644 (file)
@@ -249,6 +249,7 @@ MAINTAINERCLEANFILES += $(LOCK_DAEMON_GENERATED)
 
 LOCK_DRIVER_LOCKD_SOURCES = \
                locking/lock_driver_lockd.c \
+               locking/lock_driver_lockd.h \
                $(NULL)
 
 LOCK_DAEMON_SOURCES = \
index 8e8b84fb3b5060ffc2eece77e7c825a190f9789f..41be9ce34717bac12035813e05d31e07c9a63cdd 100644 (file)
@@ -26,10 +26,6 @@ struct virLockSpaceProtocolDeleteResourceArgs {
         virLockSpaceProtocolNonNullString name;
         u_int                      flags;
 };
-enum virLockSpaceProtocolAcquireResourceFlags {
-        VIR_LOCK_SPACE_PROTOCOL_ACQUIRE_RESOURCE_SHARED = 1,
-        VIR_LOCK_SPACE_PROTOCOL_ACQUIRE_RESOURCE_AUTOCREATE = 2,
-};
 struct virLockSpaceProtocolAcquireResourceArgs {
         virLockSpaceProtocolNonNullString path;
         virLockSpaceProtocolNonNullString name;
index 5b89ca142b0b6bd6b67bebde11824050c3bd1ed4..181261170506fc6ec87992cadf3c968f1622ba96 100644 (file)
@@ -34,6 +34,8 @@
 #include "configmake.h"
 #include "virstring.h"
 
+#include "lock_driver_lockd.h"
+
 #define VIR_FROM_THIS VIR_FROM_LOCKING
 
 VIR_LOG_INIT("locking.lock_driver_lockd");
diff --git a/src/locking/lock_driver_lockd.h b/src/locking/lock_driver_lockd.h
new file mode 100644 (file)
index 0000000..baf346a
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * lock_driver_lockd.h: Locking for domain lifecycle operations
+ *
+ * Copyright (C) 2010-2011 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef __VIR_LOCK_DRIVER_LOCKD_H__
+# define __VIR_LOCK_DRIVER_LOCKD_H__
+
+enum virLockSpaceProtocolAcquireResourceFlags {
+        VIR_LOCK_SPACE_PROTOCOL_ACQUIRE_RESOURCE_SHARED = 1,
+        VIR_LOCK_SPACE_PROTOCOL_ACQUIRE_RESOURCE_AUTOCREATE = 2,
+};
+
+#endif /* __VIR_LOCK_DRIVER_LOCKD_H__ */
index a77a78490cb6c4d923112de22acc87c454292a05..6d4cec39e244e5e36843a7eea81b38a62fa8add9 100644 (file)
@@ -2,6 +2,7 @@
  */
 
 %#include "internal.h"
+%#include "lock_driver_lockd.h"
 
 typedef opaque virLockSpaceProtocolUUID[VIR_UUID_BUFLEN];
 
@@ -50,11 +51,6 @@ struct virLockSpaceProtocolDeleteResourceArgs {
     unsigned int flags;
 };
 
-enum virLockSpaceProtocolAcquireResourceFlags {
-    VIR_LOCK_SPACE_PROTOCOL_ACQUIRE_RESOURCE_SHARED     = 1,
-    VIR_LOCK_SPACE_PROTOCOL_ACQUIRE_RESOURCE_AUTOCREATE = 2
-};
-
 struct virLockSpaceProtocolAcquireResourceArgs {
     virLockSpaceProtocolNonNullString path;
     virLockSpaceProtocolNonNullString name;