]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
pr-manager: put stubs in .c file
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 28 Jun 2018 16:01:42 +0000 (18:01 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 28 Jun 2018 17:05:35 +0000 (19:05 +0200)
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
include/scsi/pr-manager.h
scsi/Makefile.objs
scsi/pr-manager-stub.c [new file with mode: 0644]

index 5d2f13a5e4513f434f9991637cffc3e29e5262f1..71971ae34a4d3c3f7369f737c0308777206457dc 100644 (file)
@@ -41,15 +41,6 @@ BlockAIOCB *pr_manager_execute(PRManager *pr_mgr,
                                BlockCompletionFunc *complete,
                                void *opaque);
 
-#ifdef CONFIG_LINUX
 PRManager *pr_manager_lookup(const char *id, Error **errp);
-#else
-static inline PRManager *pr_manager_lookup(const char *id, Error **errp)
-{
-    /* The classes do not exist at all!  */
-    error_setg(errp, "No persistent reservation manager with id '%s'", id);
-    return NULL;
-}
-#endif
 
 #endif
index 4d25e476cf99a26b13b6dc1c2e3b85a9a304ae7b..bb8789cd8b3621c093430ed9c6b2d999b1d68fd6 100644 (file)
@@ -1,3 +1,4 @@
 block-obj-y += utils.o
 
 block-obj-$(CONFIG_LINUX) += pr-manager.o pr-manager-helper.o
+block-obj-$(call lnot,$(CONFIG_LINUX)) += pr-manager-stub.o
diff --git a/scsi/pr-manager-stub.c b/scsi/pr-manager-stub.c
new file mode 100644 (file)
index 0000000..632f17c
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Persistent reservation manager - stub for non-Linux platforms
+ *
+ * Copyright (c) 2018 Red Hat, Inc.
+ *
+ * Author: Paolo Bonzini <pbonzini@redhat.com>
+ *
+ * This code is licensed under the LGPL.
+ *
+ */
+
+#include "qemu/osdep.h"
+#include "qapi/error.h"
+#include "scsi/pr-manager.h"
+#include "trace.h"
+#include "qapi/qapi-types-block.h"
+#include "qapi/qapi-commands-block.h"
+
+PRManager *pr_manager_lookup(const char *id, Error **errp)
+{
+    /* The classes do not exist at all!  */
+    error_setg(errp, "No persistent reservation manager with id '%s'", id);
+        return NULL;
+}