From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49289) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZFcz-000473-VS for qemu-devel@nongnu.org; Thu, 24 Oct 2013 03:46:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VZFcr-00046Q-4M for qemu-devel@nongnu.org; Thu, 24 Oct 2013 03:46:45 -0400 Received: from smtp3-g21.free.fr ([2a01:e0c:1:1599::12]:39257) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZFcq-00045S-Gw for qemu-devel@nongnu.org; Thu, 24 Oct 2013 03:46:37 -0400 Message-ID: <5268D04D.7090900@reactos.org> Date: Thu, 24 Oct 2013 09:46:21 +0200 From: =?ISO-8859-1?Q?Herv=E9_Poussineau?= MIME-Version: 1.0 References: <1382007746-4405-1-git-send-email-kraxel@redhat.com> <1382007746-4405-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1382007746-4405-2-git-send-email-kraxel@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 1/2] vga: allow non-global vmstate List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org Gerd Hoffmann a =E9crit : > Need a way to opt-out from vga.vram being global vmstate, for > secondary vga cards. Add a bool parameter to vga_common_init > to support this. > > Signed-off-by: Gerd Hoffmann > --- > hw/display/cirrus_vga.c | 4 ++-- > hw/display/qxl.c | 2 +- > hw/display/vga-isa-mm.c | 2 +- > hw/display/vga-isa.c | 2 +- > hw/display/vga-pci.c | 2 +- > hw/display/vga.c | 4 ++-- > hw/display/vga_int.h | 2 +- > hw/display/vmware_vga.c | 2 +- > 8 files changed, 10 insertions(+), 10 deletions(-) > > =20 [...] > diff --git a/hw/display/vga-pci.c b/hw/display/vga-pci.c > index b3a45c8..dee180f 100644 > --- a/hw/display/vga-pci.c > +++ b/hw/display/vga-pci.c > @@ -147,7 +147,7 @@ static int pci_std_vga_initfn(PCIDevice *dev) > VGACommonState *s =3D &d->vga; > =20 > /* vga + console init */ > - vga_common_init(s, OBJECT(dev)); > + vga_common_init(s, OBJECT(dev), true); > vga_init(s, OBJECT(dev), pci_address_space(dev), pci_address_space= _io(dev), > true); > =20 > diff --git a/hw/display/vga.c b/hw/display/vga.c > index 7b91d9c..fea30e5 100644 > --- a/hw/display/vga.c > +++ b/hw/display/vga.c > @@ -2257,7 +2257,7 @@ static const GraphicHwOps vga_ops =3D { > .text_update =3D vga_update_text, > }; > =20 > -void vga_common_init(VGACommonState *s, Object *obj) > +void vga_common_init(VGACommonState *s, Object *obj, bool global_vmsta= te) > { > int i, j, v, b; > =20 > @@ -2294,7 +2294,7 @@ void vga_common_init(VGACommonState *s, Object *o= bj) > =20 > s->is_vbe_vmstate =3D 1; > memory_region_init_ram(&s->vram, obj, "vga.vram", s->vram_size); > - vmstate_register_ram_global(&s->vram); > + vmstate_register_ram(&s->vram, global_vmstate ? NULL : DEVICE(obj)= ); > =20 Is it possible to do it depending of the QEMU compatibility version, or=20 of some property, so we don't have to keep this global vmstate forever? With this, I think we can also expect to be able to specify "-device=20 VGA" twice, and see the BIOS messages on one card or another. Herv=E9