26ba25
From e32685151297109c3b502ffdc7bda2288605029a Mon Sep 17 00:00:00 2001
26ba25
From: Paolo Bonzini <pbonzini@redhat.com>
26ba25
Date: Fri, 6 Jul 2018 17:56:54 +0200
26ba25
Subject: [PATCH 194/268] pr-manager: put stubs in .c file
26ba25
26ba25
RH-Author: Paolo Bonzini <pbonzini@redhat.com>
26ba25
Message-id: <20180706175659.30615-5-pbonzini@redhat.com>
26ba25
Patchwork-id: 81253
26ba25
O-Subject: [RHEL7.6 qemu-kvm-rhev PATCH 4/9] pr-manager: put stubs in .c file
26ba25
Bugzilla: 1533158
26ba25
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
26ba25
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
26ba25
RH-Acked-by: Michal Privoznik <mprivozn@redhat.com>
26ba25
26ba25
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
26ba25
(cherry picked from commit 58b3017f7fba15e8c440115dfd5d380f490d0b61)
26ba25
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
26ba25
---
26ba25
 include/scsi/pr-manager.h |  9 ---------
26ba25
 scsi/Makefile.objs        |  1 +
26ba25
 scsi/pr-manager-stub.c    | 24 ++++++++++++++++++++++++
26ba25
 3 files changed, 25 insertions(+), 9 deletions(-)
26ba25
 create mode 100644 scsi/pr-manager-stub.c
26ba25
26ba25
diff --git a/include/scsi/pr-manager.h b/include/scsi/pr-manager.h
26ba25
index 5d2f13a..71971ae 100644
26ba25
--- a/include/scsi/pr-manager.h
26ba25
+++ b/include/scsi/pr-manager.h
26ba25
@@ -41,15 +41,6 @@ BlockAIOCB *pr_manager_execute(PRManager *pr_mgr,
26ba25
                                BlockCompletionFunc *complete,
26ba25
                                void *opaque);
26ba25
 
26ba25
-#ifdef CONFIG_LINUX
26ba25
 PRManager *pr_manager_lookup(const char *id, Error **errp);
26ba25
-#else
26ba25
-static inline PRManager *pr_manager_lookup(const char *id, Error **errp)
26ba25
-{
26ba25
-    /* The classes do not exist at all!  */
26ba25
-    error_setg(errp, "No persistent reservation manager with id '%s'", id);
26ba25
-    return NULL;
26ba25
-}
26ba25
-#endif
26ba25
 
26ba25
 #endif
26ba25
diff --git a/scsi/Makefile.objs b/scsi/Makefile.objs
26ba25
index 4d25e47..bb8789c 100644
26ba25
--- a/scsi/Makefile.objs
26ba25
+++ b/scsi/Makefile.objs
26ba25
@@ -1,3 +1,4 @@
26ba25
 block-obj-y += utils.o
26ba25
 
26ba25
 block-obj-$(CONFIG_LINUX) += pr-manager.o pr-manager-helper.o
26ba25
+block-obj-$(call lnot,$(CONFIG_LINUX)) += pr-manager-stub.o
26ba25
diff --git a/scsi/pr-manager-stub.c b/scsi/pr-manager-stub.c
26ba25
new file mode 100644
26ba25
index 0000000..632f17c
26ba25
--- /dev/null
26ba25
+++ b/scsi/pr-manager-stub.c
26ba25
@@ -0,0 +1,24 @@
26ba25
+/*
26ba25
+ * Persistent reservation manager - stub for non-Linux platforms
26ba25
+ *
26ba25
+ * Copyright (c) 2018 Red Hat, Inc.
26ba25
+ *
26ba25
+ * Author: Paolo Bonzini <pbonzini@redhat.com>
26ba25
+ *
26ba25
+ * This code is licensed under the LGPL.
26ba25
+ *
26ba25
+ */
26ba25
+
26ba25
+#include "qemu/osdep.h"
26ba25
+#include "qapi/error.h"
26ba25
+#include "scsi/pr-manager.h"
26ba25
+#include "trace.h"
26ba25
+#include "qapi/qapi-types-block.h"
26ba25
+#include "qapi/qapi-commands-block.h"
26ba25
+
26ba25
+PRManager *pr_manager_lookup(const char *id, Error **errp)
26ba25
+{
26ba25
+    /* The classes do not exist at all!  */
26ba25
+    error_setg(errp, "No persistent reservation manager with id '%s'", id);
26ba25
+        return NULL;
26ba25
+}
26ba25
-- 
26ba25
1.8.3.1
26ba25