qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Xu <anthony.xu@intel.com>
To: qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, eblake@redhat.com,
	Anthony Xu <anthony.xu@intel.com>
Subject: [Qemu-devel] [PATCH 3/4] pam: disable pc.rom when pam is disabled
Date: Fri,  7 Apr 2017 17:45:35 -0700	[thread overview]
Message-ID: <1491612336-31066-4-git-send-email-anthony.xu@intel.com> (raw)
In-Reply-To: <1491612336-31066-1-git-send-email-anthony.xu@intel.com>

pc.rom depends on pam. When pam is disabled, pc.rom is useless

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
---
 hw/i386/pc.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 9d154c2..455f7fe 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1358,7 +1358,7 @@ void pc_memory_init(PCMachineState *pcms,
                     MemoryRegion **ram_memory)
 {
     int linux_boot, i;
-    MemoryRegion *ram, *option_rom_mr;
+    MemoryRegion *ram;
     MemoryRegion *ram_below_4g, *ram_above_4g;
     FWCfgState *fw_cfg;
     MachineState *machine = MACHINE(pcms);
@@ -1445,15 +1445,16 @@ void pc_memory_init(PCMachineState *pcms,
     /* Initialize PC system firmware */
     pc_system_firmware_init(rom_memory, !pcmc->pci_enabled);
 
-    option_rom_mr = g_malloc(sizeof(*option_rom_mr));
-    memory_region_init_ram(option_rom_mr, NULL, "pc.rom", PC_ROM_SIZE,
+    if (pcms->pam) {
+        MemoryRegion *option_rom_mr = g_malloc(sizeof(*option_rom_mr));
+        memory_region_init_ram(option_rom_mr, NULL, "pc.rom", PC_ROM_SIZE,
                            &error_fatal);
-    vmstate_register_ram_global(option_rom_mr);
-    memory_region_add_subregion_overlap(rom_memory,
+        vmstate_register_ram_global(option_rom_mr);
+        memory_region_add_subregion_overlap(rom_memory,
                                         PC_ROM_MIN_VGA,
                                         option_rom_mr,
                                         1);
-
+    }
     fw_cfg = bochs_bios_init(&address_space_memory, pcms);
 
     rom_set_fw(fw_cfg);
-- 
1.8.3.1

  parent reply	other threads:[~2017-04-08  0:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-08  0:45 [Qemu-devel] [PATCH 0/4] pam: make pam configurable Anthony Xu
2017-04-08  0:45 ` [Qemu-devel] [PATCH 1/4] pam:refactor PAM related code Anthony Xu
2017-04-08  9:49   ` Paolo Bonzini
2017-04-11  1:25     ` Xu, Anthony
2017-04-08  0:45 ` [Qemu-devel] [PATCH 2/4] pam: Make PAM configurable Anthony Xu
2017-04-08  0:45 ` Anthony Xu [this message]
2017-04-08  0:45 ` [Qemu-devel] [PATCH 4/4] pam: setup pc.bios Anthony Xu
2017-04-08  9:49   ` Paolo Bonzini
2017-04-11  1:42     ` Xu, Anthony
2017-04-11  9:18       ` Paolo Bonzini

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=1491612336-31066-4-git-send-email-anthony.xu@intel.com \
    --to=anthony.xu@intel.com \
    --cc=eblake@redhat.com \
    --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).