From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xiao Guangrong Subject: [PATCH v2 5/5] Qemu: mark pci rom readonly Date: Thu, 25 Oct 2012 17:23:19 +0800 Message-ID: <50890507.8030501@linux.vnet.ibm.com> References: <50890462.5010307@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Avi Kivity , Marcelo Tosatti , Jan Kiszka , Anthony Liguori , "Kevin O'Connor" , Liu Sheng , KVM , qemu-devel@nongnu.org To: Xiao Guangrong Return-path: Received: from e23smtp09.au.ibm.com ([202.81.31.142]:56196 "EHLO e23smtp09.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934936Ab2JYJY2 (ORCPT ); Thu, 25 Oct 2012 05:24:28 -0400 Received: from /spool/local by e23smtp09.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 25 Oct 2012 19:20:47 +1000 Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay04.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q9P9DOnK55050256 for ; Thu, 25 Oct 2012 20:13:24 +1100 Received: from d23av01.au.ibm.com (loopback [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q9P9NMLl024627 for ; Thu, 25 Oct 2012 20:23:23 +1100 In-Reply-To: <50890462.5010307@linux.vnet.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: Since it is ROM which is really readonly in the system Signed-off-by: Xiao Guangrong --- hw/pci.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index 2ca6ff6..2a287bb 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -1803,6 +1803,7 @@ static int pci_add_option_rom(PCIDevice *pdev, bool is_default_rom) } pdev->has_rom = true; memory_region_init_ram(&pdev->rom, name, size); + memory_region_set_readonly(&pdev->rom, true); vmstate_register_ram(&pdev->rom, &pdev->qdev); ptr = memory_region_get_ram_ptr(&pdev->rom); load_image(path, ptr); -- 1.7.7.6