From patchwork Thu Oct 25 09:23:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Guangrong X-Patchwork-Id: 1642531 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id EF7913FE1C for ; Thu, 25 Oct 2012 09:24:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935030Ab2JYJY3 (ORCPT ); Thu, 25 Oct 2012 05:24:29 -0400 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 d23relay04.au.ibm.com (202.81.31.246) by e23smtp09.au.ibm.com (202.81.31.206) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 25 Oct 2012 19:20:27 +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 Received: from localhost.localdomain ([9.123.236.99]) by d23av01.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q9P9NJHM024536; Thu, 25 Oct 2012 20:23:20 +1100 Message-ID: <50890507.8030501@linux.vnet.ibm.com> Date: Thu, 25 Oct 2012 17:23:19 +0800 From: Xiao Guangrong User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120911 Thunderbird/15.0.1 MIME-Version: 1.0 To: Xiao Guangrong CC: Avi Kivity , Marcelo Tosatti , Jan Kiszka , Anthony Liguori , "Kevin O'Connor" , Liu Sheng , KVM , qemu-devel@nongnu.org Subject: [PATCH v2 5/5] Qemu: mark pci rom readonly References: <50890462.5010307@linux.vnet.ibm.com> In-Reply-To: <50890462.5010307@linux.vnet.ibm.com> x-cbid: 12102509-3568-0000-0000-000002A7049F Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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);