qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	kvm@vger.kernel.org,
	Christoffer Dall <christoffer.dall@linaro.org>
Subject: [Qemu-devel] [RFC 3/7] kvm: Move some kvm-stub.c code to stubs/kvm.c
Date: Tue, 20 Dec 2016 15:43:09 -0200	[thread overview]
Message-ID: <1482255793-19057-4-git-send-email-ehabkost@redhat.com> (raw)
In-Reply-To: <1482255793-19057-1-git-send-email-ehabkost@redhat.com>

Move the kvm-stub.c code that doesn't depend on cpu.h or CONFIG_*
defines to stubs/kvm.c.

Notes about copyright, licensing, and authorship:

* There was no copyright not on the original stubs/kvm.c file.
* As include/sysemu/kvm.h and kvm-all.c are licensed as
  GPLv2+, I am assuming stubs/kvm.c file is also licensed as
  GPLv2+.
* I have copied the copyright info from kvm-stub.c and added the
  original author of stubs/kvm.c (Christoffer Dall) to the author
  list.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org
Cc: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 kvm-stub.c  | 51 ------------------------------------------------
 stubs/kvm.c | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 65 insertions(+), 51 deletions(-)

diff --git a/kvm-stub.c b/kvm-stub.c
index b1b6b96..7ba697b 100644
--- a/kvm-stub.c
+++ b/kvm-stub.c
@@ -19,61 +19,10 @@
 #include "hw/pci/msi.h"
 #endif
 
-KVMState *kvm_state;
-bool kvm_kernel_irqchip;
-bool kvm_async_interrupts_allowed;
-bool kvm_eventfds_allowed;
-bool kvm_irqfds_allowed;
-bool kvm_resamplefds_allowed;
-bool kvm_msi_via_irqfd_allowed;
-bool kvm_gsi_routing_allowed;
-bool kvm_gsi_direct_mapping;
-bool kvm_allowed;
-bool kvm_readonly_mem_allowed;
-bool kvm_ioeventfd_any_length_allowed;
-bool kvm_msi_use_devid;
-
-int kvm_destroy_vcpu(CPUState *cpu)
-{
-    return -ENOSYS;
-}
-
-int kvm_init_vcpu(CPUState *cpu)
-{
-    return -ENOSYS;
-}
-
 void kvm_flush_coalesced_mmio_buffer(void)
 {
 }
 
-void kvm_cpu_synchronize_state(CPUState *cpu)
-{
-}
-
-void kvm_cpu_synchronize_post_reset(CPUState *cpu)
-{
-}
-
-void kvm_cpu_synchronize_post_init(CPUState *cpu)
-{
-}
-
-int kvm_cpu_exec(CPUState *cpu)
-{
-    abort();
-}
-
-int kvm_has_sync_mmu(void)
-{
-    return 0;
-}
-
-int kvm_has_many_ioeventfds(void)
-{
-    return 0;
-}
-
 int kvm_update_guest_debug(CPUState *cpu, unsigned long reinject_trap)
 {
     return -ENOSYS;
diff --git a/stubs/kvm.c b/stubs/kvm.c
index ddd6204..9d491c1 100644
--- a/stubs/kvm.c
+++ b/stubs/kvm.c
@@ -1,7 +1,72 @@
+/*
+ * QEMU KVM stub
+ *
+ * Copyright Red Hat, Inc. 2010
+ *
+ * Authors:
+ *  Christoffer Dall  <christoffer.dall@linaro.org>
+ *  Paolo Bonzini     <pbonzini@redhat.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ *
+ */
+
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "sysemu/kvm.h"
 
+KVMState *kvm_state;
+bool kvm_kernel_irqchip;
+bool kvm_async_interrupts_allowed;
+bool kvm_eventfds_allowed;
+bool kvm_irqfds_allowed;
+bool kvm_resamplefds_allowed;
+bool kvm_msi_via_irqfd_allowed;
+bool kvm_gsi_routing_allowed;
+bool kvm_gsi_direct_mapping;
+bool kvm_allowed;
+bool kvm_readonly_mem_allowed;
+bool kvm_ioeventfd_any_length_allowed;
+bool kvm_msi_use_devid;
+
+int kvm_destroy_vcpu(CPUState *cpu)
+{
+    return -ENOSYS;
+}
+
+int kvm_init_vcpu(CPUState *cpu)
+{
+    return -ENOSYS;
+}
+
+void kvm_cpu_synchronize_state(CPUState *cpu)
+{
+}
+
+void kvm_cpu_synchronize_post_reset(CPUState *cpu)
+{
+}
+
+void kvm_cpu_synchronize_post_init(CPUState *cpu)
+{
+}
+
+int kvm_cpu_exec(CPUState *cpu)
+{
+    abort();
+}
+
+int kvm_has_sync_mmu(void)
+{
+    return 0;
+}
+
+int kvm_has_many_ioeventfds(void)
+{
+    return 0;
+}
+
 int kvm_arch_irqchip_create(MachineState *ms, KVMState *s)
 {
     return 0;
-- 
2.7.4

  parent reply	other threads:[~2016-12-20 17:43 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-20 17:43 [Qemu-devel] [RFC 0/7] Move accel, KVM, Xen, qtest files to accel/ subdir Eduardo Habkost
2016-12-20 17:43 ` [Qemu-devel] [RFC 1/7] xen: Move xen-*-stub.c to stubs/ Eduardo Habkost
2016-12-20 17:43 ` [Qemu-devel] [RFC 2/7] xen: Move xen files to accel/ Eduardo Habkost
2016-12-20 17:43 ` Eduardo Habkost [this message]
2016-12-21  8:42   ` [Qemu-devel] [RFC 3/7] kvm: Move some kvm-stub.c code to stubs/kvm.c David Hildenbrand
2016-12-20 17:43 ` [Qemu-devel] [RFC 4/7] kvm: Include kvm-stub.o only on CONFIG_SOFTMMU Eduardo Habkost
2016-12-21  7:27   ` Thomas Huth
2016-12-21  8:44     ` David Hildenbrand
2016-12-20 17:43 ` [Qemu-devel] [RFC 5/7] kvm: Move kvm*.c files to accel/ Eduardo Habkost
2016-12-20 17:43 ` [Qemu-devel] [RFC 6/7] accel: Move accel.c " Eduardo Habkost
2016-12-21  7:30   ` Thomas Huth
2016-12-20 17:43 ` [Qemu-devel] [RFC 7/7] accel: Move qtest.c " Eduardo Habkost
2016-12-20 19:01 ` [Qemu-devel] [RFC 0/7] Move accel, KVM, Xen, qtest files to accel/ subdir Stefan Weil
2016-12-21  0:31 ` Stefano Stabellini
2016-12-21  7:37 ` Thomas Huth
2016-12-21 11:21 ` Paolo Bonzini
2016-12-21 13:14   ` Eduardo Habkost
2016-12-21 13:47     ` Paolo Bonzini
2016-12-21 14:15       ` Eduardo Habkost
2016-12-21 15:41         ` Paolo Bonzini
2017-04-24 10:40 ` Thomas Huth
2017-04-24 19:11   ` Stefano Stabellini
2017-04-24 19:35   ` Eduardo Habkost

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1482255793-19057-4-git-send-email-ehabkost@redhat.com \
    --to=ehabkost@redhat.com \
    --cc=christoffer.dall@linaro.org \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).