From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39180) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjs7f-0003E6-3k for qemu-devel@nongnu.org; Fri, 03 Mar 2017 13:40:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cjs7e-0001if-HK for qemu-devel@nongnu.org; Fri, 03 Mar 2017 13:40:11 -0500 Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]:37044) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cjs7e-0001hZ-BS for qemu-devel@nongnu.org; Fri, 03 Mar 2017 13:40:10 -0500 Received: by mail-wm0-x22e.google.com with SMTP id n11so22140221wma.0 for ; Fri, 03 Mar 2017 10:40:10 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <7e582e5ca2aaa7b8b6c1f8a040562b099767ff81.1488504063.git.balaton@eik.bme.hu> References: <7e582e5ca2aaa7b8b6c1f8a040562b099767ff81.1488504063.git.balaton@eik.bme.hu> From: Peter Maydell Date: Fri, 3 Mar 2017 18:39:48 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH v3 04/13] sm501: QOMify List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: BALATON Zoltan Cc: QEMU Developers , QEMU Trivial , Magnus Damm , Aurelien Jarno On 3 March 2017 at 01:03, BALATON Zoltan wrote: > Adding vmstate saving is not in this patch because the state structure > will be changed in further patches, then another patch will add > vmstate descriptor after those changes. > > Signed-off-by: BALATON Zoltan > +static void sm501_init(SM501State *s, DeviceState *dev, uint32_t base, > + uint32_t local_mem_bytes) > +{ > + s->base = base; > + s->local_mem_size_index = get_local_mem_size_index(local_mem_bytes); > + SM501_DPRINTF("sm501 local mem size=%x. index=%d\n", get_local_mem_size(s), > + s->local_mem_size_index); > + if (get_local_mem_size(s) != local_mem_bytes) { > + error_report("Warning: sm501 VRAM size adjusted to %" PRIu32, > + get_local_mem_size(s)); > + } Just noticed this. I think reporting the error upwards by failing device realize is better than adjusting the value. It's what we tend to do for other devices. Management tools like libvirt prefer to get hard errors if there's a config file error that means they misconfigure a device. thanks -- PMM