From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55918) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRJgG-0003IQ-Lb for qemu-devel@nongnu.org; Thu, 25 Oct 2012 05:24:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TRJgA-0008T7-HF for qemu-devel@nongnu.org; Thu, 25 Oct 2012 05:24:48 -0400 Received: from e23smtp07.au.ibm.com ([202.81.31.140]:56547) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRJg1-0008Pp-Qo for qemu-devel@nongnu.org; Thu, 25 Oct 2012 05:24:42 -0400 Received: from /spool/local by e23smtp07.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 25 Oct 2012 19:20:57 +1000 Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q9P9NNPV33292508 for ; Thu, 25 Oct 2012 20:23:23 +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 q9P9NMLf024627 for ; Thu, 25 Oct 2012 20:23:23 +1100 Message-ID: <50890507.8030501@linux.vnet.ibm.com> Date: Thu, 25 Oct 2012 17:23:19 +0800 From: Xiao Guangrong MIME-Version: 1.0 References: <50890462.5010307@linux.vnet.ibm.com> In-Reply-To: <50890462.5010307@linux.vnet.ibm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH v2 5/5] Qemu: mark pci rom readonly List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Xiao Guangrong Cc: KVM , Jan Kiszka , Marcelo Tosatti , qemu-devel@nongnu.org, Kevin O'Connor , Avi Kivity , Anthony Liguori , Liu Sheng 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