Blame SOURCES/kvm-pr-manager-put-stubs-in-.c-file.patch

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