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

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