qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	pbonzini@redhat.com, qemu-devel@nongnu.org, laurent@vivier.eu,
	hpoussin@reactos.org
Subject: Re: [PATCH] esp: fix migration version check in esp_is_version_5()
Date: Mon, 14 Jun 2021 12:59:07 +0100	[thread overview]
Message-ID: <958e9fea-17c5-a818-14d4-a21c54399395@ilande.co.uk> (raw)
In-Reply-To: <347be692-0e6a-f684-ddbb-b2b2acd7ae04@amsat.org>

On 14/06/2021 10:01, Philippe Mathieu-Daudé wrote:

> On 6/14/21 9:44 AM, Mark Cave-Ayland wrote:
>> On 14/06/2021 06:42, Philippe Mathieu-Daudé wrote:
>>
>>> On 6/13/21 12:26 PM, Mark Cave-Ayland wrote:
>>>> Commit 4e78f3bf35 "esp: defer command completion interrupt on
>>>> incoming data
>>>> transfers" added a version check for use with VMSTATE_*_TEST macros
>>>> to allow
>>>> migration from older QEMU versions. Unfortunately the version check
>>>> fails to
>>>> work in its current form since if the VMStateDescription version_id is
>>>> incremented, the test returns false and so the fields are not
>>>> included in the
>>>> outgoing migration stream.
>>>>
>>>> Change the version check to use >= rather == to ensure that migration
>>>> works
>>>> correctly when the ESPState VMStateDescription has version_id > 5.
>>>>
>>>> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
>>>> Fixes: 4e78f3bf35 ("esp: defer command completion interrupt on
>>>> incoming data transfers")
>>>> ---
>>> Well, it is not buggy yet :)
>>
>> :)
>>
>>>>    hw/scsi/esp.c | 2 +-
>>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c
>>>> index bfdb94292b..39756ddd99 100644
>>>> --- a/hw/scsi/esp.c
>>>> +++ b/hw/scsi/esp.c
>>>> @@ -1120,7 +1120,7 @@ static bool esp_is_version_5(void *opaque, int
>>>> version_id)
>>>
>>> Can you rename esp_is_at_least_version_5()?
>>
>> Sure, I can rename it if you like but it will of course make the diff
>> noisier. esp_is_at_least_version_5() seems quite a mouthful though, what
>> about esp_min_version_5() instead?
> 
> I was looking at esp_is_before_version_5(). Following that logic it
> should be named esp_is_after_version_4()? Or esp_min_version_5() and
> rename esp_is_before_version_5() -> esp_max_version_4(). All options
> seem confuse...
> 
> Maybe _V macros suggested by Paolo make all clearer?

Unfortunately the _V macros don't work correctly here (see my previous reply to 
Paolo) which is why these functions exist in the first place.

If all the proposed options seem equally confusing, is it worth just sticking with 
what was in the original patch? Otherwise we end up with a whole series renaming 
functions in a way we're still not happy with, compared with the original patch which 
is effectively a diff of 1 character.


ATB,

Mark.


  reply	other threads:[~2021-06-14 12:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-13 10:26 [PATCH] esp: fix migration version check in esp_is_version_5() Mark Cave-Ayland
2021-06-14  5:42 ` Philippe Mathieu-Daudé
2021-06-14  7:44   ` Mark Cave-Ayland
2021-06-14  9:01     ` Philippe Mathieu-Daudé
2021-06-14 11:59       ` Mark Cave-Ayland [this message]
2021-06-14 13:47         ` Philippe Mathieu-Daudé
2021-06-15  7:42           ` Mark Cave-Ayland
2021-06-14  8:15 ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=958e9fea-17c5-a818-14d4-a21c54399395@ilande.co.uk \
    --to=mark.cave-ayland@ilande.co.uk \
    --cc=f4bug@amsat.org \
    --cc=hpoussin@reactos.org \
    --cc=laurent@vivier.eu \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).