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

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