cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
Blob Blame History Raw
From 2cd283cab24c3765c11a19897d4ee3f1ce37000f Mon Sep 17 00:00:00 2001
Message-Id: <2cd283cab24c3765c11a19897d4ee3f1ce37000f.1387298827.git.minovotn@redhat.com>
In-Reply-To: <3ed0fb61a3dc912ef036d7ef450bed192090709e.1387298827.git.minovotn@redhat.com>
References: <3ed0fb61a3dc912ef036d7ef450bed192090709e.1387298827.git.minovotn@redhat.com>
From: "Michael S. Tsirkin" <mst@redhat.com>
Date: Tue, 17 Dec 2013 15:17:29 +0100
Subject: [PATCH 16/56] pc: don't access fw cfg if NULL

RH-Author: Michael S. Tsirkin <mst@redhat.com>
Message-id: <1387293161-4085-17-git-send-email-mst@redhat.com>
Patchwork-id: 56322
O-Subject: [PATCH qemu-kvm RHEL7.0 v2 16/57] pc: don't access fw cfg if NULL
Bugzilla: 1034876
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
RH-Acked-by: Marcel Apfelbaum <marcel.a@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>

commit f8c457b88d72a48989f190bc3d7b79f4f3b7d11c
     "pc: pass PCI hole ranges to Guests"
broke Xen as it has no fw_cfg.
Check for this configuration and boil out.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
(cherry picked from commit d26d9e14c15837eba2b7447e8d15230bab8e0940)
---
 hw/i386/pc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Signed-off-by: Michal Novotny <minovotn@redhat.com>
---
 hw/i386/pc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 238f6a0..9d9f5d2 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -996,7 +996,7 @@ typedef struct PcRomPciInfo {
 static void pc_fw_cfg_guest_info(PcGuestInfo *guest_info)
 {
     PcRomPciInfo *info;
-    if (!guest_info->has_pci_info) {
+    if (!guest_info->has_pci_info || !guest_info->fw_cfg) {
         return;
     }
 
-- 
1.7.11.7