From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 2002:a5d:51d0:0:0:0:0:0 with SMTP id n16csp10942607wrv; Thu, 25 Jul 2019 11:32:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqwmHiQY/5SC2e176vjHiqx7ADw6PNoJbEPoULfdQ9msT7+DFwNeVfw6R+bANFsfy1n9eHkg X-Received: by 2002:a17:906:c785:: with SMTP id cw5mr22665399ejb.215.1564079568114; Thu, 25 Jul 2019 11:32:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564079568; cv=none; d=google.com; s=arc-20160816; b=lFQ2MHGLmP3Y9kVt9jxSU3Pe+7KDA1iAWVBbW9oT0UOtHrxpvWMBPydv+I6nejEofk 8hZjeZA6Dv+6UCmKQx0yGn4hfLrGFfoKhWGntNFhdc5KoQLCbvCASC9IwnXJcJqinphK +d4vBt/rv2uPSP9nJNiOU8WwMWxGM7gXATXw2xBDziVLUbmJAyoo2NCZtGl4ay5QXbUj ZlQb4kHKiIZ+Qa4kdVBIaJ3awCfbEQFhdfMyUlEPU3zdIdSPV1OBMYu63sJBdNZBeXRT DF3fCeIIVW2syagwk/zbK4l3JXGunaxn1FdfUh206PBOmHaJkay/sT98xqVF+OAZT4HB HHTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:to:from:date; bh=XFaOTfK7v3wTewarL4TAEn8mlS61s3Ag88QZ9VnpL0M=; b=lS/pv5DWqW9GQui2IEtt2sIQo5gVxtukLHn2Y19GyLOeqMBJz8ZNwTyexKpBEMiups EnhFnITZwkX/VnDxA2PWq7J8AYBM8EoxifOI4qF3Evo+zX17b1DcWkyVdmlWOZCQlnq2 8cTw83NWyNx3ArgatGCGWVVqzj6Y7jIk1MKcoj9k5W+uFpSF436h7dkEd020kW6kAVUm mfd9W3Cpx0/1hWiTuuMUfBiCgaa9yn7WOur0YdldFZvFschslFEALmt61grTOJURTMx2 BV9RApgmsGrifyw4mBTGF9OQW7J/prMl+Ttr52mY4z6FYZCmVZpkOhIrgYIK5UaObdp3 dwtA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m13si11534588edc.233.2019.07.25.11.32.47 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Jul 2019 11:32:48 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1]:34814 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hqiXn-0006ti-7Q for alex.bennee@linaro.org; Thu, 25 Jul 2019 14:32:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40269) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hqiXj-0006tZ-IJ for qemu-arm@nongnu.org; Thu, 25 Jul 2019 14:32:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hqiXh-0006mY-1F for qemu-arm@nongnu.org; Thu, 25 Jul 2019 14:32:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55706) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hqiXg-0006lS-RW; Thu, 25 Jul 2019 14:32:40 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 24D0B859FF; Thu, 25 Jul 2019 18:32:39 +0000 (UTC) Received: from work-vm (ovpn-117-187.ams2.redhat.com [10.36.117.187]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C4AEF1018A31; Thu, 25 Jul 2019 18:32:37 +0000 (UTC) Date: Thu, 25 Jul 2019 19:32:35 +0100 From: "Dr. David Alan Gilbert" To: Peter Maydell Message-ID: <20190725183235.GO2656@work-vm> References: <20190725163710.11703-1-peter.maydell@linaro.org> <20190725163710.11703-2-peter.maydell@linaro.org> <20190725170228.GL2656@work-vm> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.0 (2019-05-25) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 25 Jul 2019 18:32:39 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: Re: [Qemu-arm] [PATCH for-4.1? 1/2] stellaris_input: Fix vmstate description of buttons field X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Damien Hedde , qemu-arm , QEMU Developers , Juan Quintela Errors-To: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: "Qemu-arm" X-TUID: WUsR0l2NgVsW * Peter Maydell (peter.maydell@linaro.org) wrote: > On Thu, 25 Jul 2019 at 18:02, Dr. David Alan Gilbert > wrote: > > > > * Peter Maydell (peter.maydell@linaro.org) wrote: > > > gamepad_state::buttons is a pointer to an array of structs, > > > not an array of structs, so should be declared in the vmstate > > > with VMSTATE_STRUCT_VARRAY_POINTER_INT32; otherwise we > > > corrupt memory on incoming migration. > > > > > > We bump the vmstate version field as the easiest way to > > > deal with the migration break, since migration wouldn't have > > > worked reliably before anyway. > > > > > > Signed-off-by: Peter Maydell > > > > OK, it would be great to change num_buttons to uint32_t and make that a > > UINT32 at some point; it's hard to press negative buttons. > > Is there much benefit though? Not much and it's not urgent > As an aside, I'm surprised also the macro doesn't complain > that we said the num_buttons field is int32 but it's really "int"... > arguably a different kind of missing type check. I was just concerned what would happen if your migration stream had a negative value in. Dave > thanks > -- PMM -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1FF52C76190 for ; Thu, 25 Jul 2019 18:33:05 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ED0F3229F9 for ; Thu, 25 Jul 2019 18:33:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ED0F3229F9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:34818 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hqiY4-0007No-5a for qemu-devel@archiver.kernel.org; Thu, 25 Jul 2019 14:33:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40386) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hqiXt-0006zV-PO for qemu-devel@nongnu.org; Thu, 25 Jul 2019 14:32:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hqiXm-0006q5-0s for qemu-devel@nongnu.org; Thu, 25 Jul 2019 14:32:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55706) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hqiXg-0006lS-RW; Thu, 25 Jul 2019 14:32:40 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 24D0B859FF; Thu, 25 Jul 2019 18:32:39 +0000 (UTC) Received: from work-vm (ovpn-117-187.ams2.redhat.com [10.36.117.187]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C4AEF1018A31; Thu, 25 Jul 2019 18:32:37 +0000 (UTC) Date: Thu, 25 Jul 2019 19:32:35 +0100 From: "Dr. David Alan Gilbert" To: Peter Maydell Message-ID: <20190725183235.GO2656@work-vm> References: <20190725163710.11703-1-peter.maydell@linaro.org> <20190725163710.11703-2-peter.maydell@linaro.org> <20190725170228.GL2656@work-vm> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.0 (2019-05-25) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 25 Jul 2019 18:32:39 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: Re: [Qemu-devel] [PATCH for-4.1? 1/2] stellaris_input: Fix vmstate description of buttons field X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Damien Hedde , qemu-arm , QEMU Developers , Juan Quintela Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" * Peter Maydell (peter.maydell@linaro.org) wrote: > On Thu, 25 Jul 2019 at 18:02, Dr. David Alan Gilbert > wrote: > > > > * Peter Maydell (peter.maydell@linaro.org) wrote: > > > gamepad_state::buttons is a pointer to an array of structs, > > > not an array of structs, so should be declared in the vmstate > > > with VMSTATE_STRUCT_VARRAY_POINTER_INT32; otherwise we > > > corrupt memory on incoming migration. > > > > > > We bump the vmstate version field as the easiest way to > > > deal with the migration break, since migration wouldn't have > > > worked reliably before anyway. > > > > > > Signed-off-by: Peter Maydell > > > > OK, it would be great to change num_buttons to uint32_t and make that a > > UINT32 at some point; it's hard to press negative buttons. > > Is there much benefit though? Not much and it's not urgent > As an aside, I'm surprised also the macro doesn't complain > that we said the num_buttons field is int32 but it's really "int"... > arguably a different kind of missing type check. I was just concerned what would happen if your migration stream had a negative value in. Dave > thanks > -- PMM -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK