|
|
9ae3a8 |
From b3f60a169126dd6a4ef7c64442494d943f9ffbd2 Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: Marcel Apfelbaum <marcel.a@redhat.com>
|
|
|
9ae3a8 |
Date: Wed, 6 Nov 2013 16:32:33 +0100
|
|
|
9ae3a8 |
Subject: [PATCH 74/81] hw/misc: make pvpanic known to user
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
RH-Author: Marcel Apfelbaum <marcel.a@redhat.com>
|
|
|
9ae3a8 |
Message-id: <1383755557-21590-6-git-send-email-marcel.a@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 55550
|
|
|
9ae3a8 |
O-Subject: [RHEL-7 qemu-kvm PATCH v3 5/9] hw/misc: make pvpanic known to user
|
|
|
9ae3a8 |
Bugzilla: 990601
|
|
|
9ae3a8 |
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Alex Williamson <alex.williamson@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
This patch is based on Hu Tao's:
|
|
|
9ae3a8 |
http://lists.nongnu.org/archive/html/qemu-devel/2013-08/msg00125.html
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
The pvpanic device may be enabled now with "-device pvpanic"
|
|
|
9ae3a8 |
from command line.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
|
|
|
9ae3a8 |
Reviewed-by: Hu Tao <hutao@cn.fujitsu.com>
|
|
|
9ae3a8 |
Message-id: 1376233843-19410-3-git-send-email-marcel.a@redhat.com
|
|
|
9ae3a8 |
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
|
|
|
9ae3a8 |
(cherry picked from commit a5d3f640a0fa56eaed712c9361150568e32e1d08)
|
|
|
9ae3a8 |
Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Conflicts:
|
|
|
9ae3a8 |
hw/misc/pvpanic.c
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
hw/misc/pvpanic.c | 28 ++++++++++++----------------
|
|
|
9ae3a8 |
1 file changed, 12 insertions(+), 16 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
hw/misc/pvpanic.c | 28 ++++++++++++----------------
|
|
|
9ae3a8 |
1 files changed, 12 insertions(+), 16 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/hw/misc/pvpanic.c b/hw/misc/pvpanic.c
|
|
|
9ae3a8 |
index 1aab787..1d3178d 100644
|
|
|
9ae3a8 |
--- a/hw/misc/pvpanic.c
|
|
|
9ae3a8 |
+++ b/hw/misc/pvpanic.c
|
|
|
9ae3a8 |
@@ -89,32 +89,28 @@ static const MemoryRegionOps pvpanic_ops = {
|
|
|
9ae3a8 |
static int pvpanic_isa_initfn(ISADevice *dev)
|
|
|
9ae3a8 |
{
|
|
|
9ae3a8 |
PVPanicState *s = ISA_PVPANIC_DEVICE(dev);
|
|
|
9ae3a8 |
+ FWCfgState *fw_cfg = fw_cfg_find();
|
|
|
9ae3a8 |
+ uint16_t *pvpanic_port;
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
- memory_region_init_io(&s->io, &pvpanic_ops, s, "pvpanic", 1);
|
|
|
9ae3a8 |
- isa_register_ioport(dev, &s->io, s->ioport);
|
|
|
9ae3a8 |
+ if (!fw_cfg) {
|
|
|
9ae3a8 |
+ return -1;
|
|
|
9ae3a8 |
+ }
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
- return 0;
|
|
|
9ae3a8 |
-}
|
|
|
9ae3a8 |
+ memory_region_init_io(&s->io, &pvpanic_ops, s, "pvpanic", 1);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-static void pvpanic_fw_cfg(ISADevice *dev, FWCfgState *fw_cfg)
|
|
|
9ae3a8 |
-{
|
|
|
9ae3a8 |
- PVPanicState *s = ISA_PVPANIC_DEVICE(dev);
|
|
|
9ae3a8 |
- uint16_t *pvpanic_port = g_malloc(sizeof(*pvpanic_port));
|
|
|
9ae3a8 |
+ pvpanic_port = g_malloc(sizeof(*pvpanic_port));
|
|
|
9ae3a8 |
*pvpanic_port = cpu_to_le16(s->ioport);
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
fw_cfg_add_file(fw_cfg, "etc/pvpanic-port", pvpanic_port,
|
|
|
9ae3a8 |
sizeof(*pvpanic_port));
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
+ isa_register_ioport(dev, &s->io, s->ioport);
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
+ return 0;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
void pvpanic_init(ISABus *bus)
|
|
|
9ae3a8 |
{
|
|
|
9ae3a8 |
- ISADevice *dev;
|
|
|
9ae3a8 |
- FWCfgState *fw_cfg = fw_cfg_find();
|
|
|
9ae3a8 |
- if (!fw_cfg) {
|
|
|
9ae3a8 |
- return;
|
|
|
9ae3a8 |
- }
|
|
|
9ae3a8 |
- dev = isa_create_simple (bus, TYPE_ISA_PVPANIC_DEVICE);
|
|
|
9ae3a8 |
- pvpanic_fw_cfg(dev, fw_cfg);
|
|
|
9ae3a8 |
+ isa_create_simple(bus, TYPE_ISA_PVPANIC_DEVICE);
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
static Property pvpanic_isa_properties[] = {
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.7.1
|
|
|
9ae3a8 |
|