qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Kevin Wolf <kwolf@redhat.com>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Qemu-block <qemu-block@nongnu.org>
Subject: Re: [PATCH] block/snapshot: Clarify goto fallback behavior
Date: Fri, 4 Jun 2021 18:10:42 +0200	[thread overview]
Message-ID: <d2987f44-d1f6-88e2-123a-be9c6071b833@redhat.com> (raw)
In-Reply-To: <CAFEAcA_33PcmTSTAGGM=KGdP8Qrh-xKBdEa1d97HUhkWChzVSw@mail.gmail.com>

On 03.06.21 18:02, Peter Maydell wrote:
> On Mon, 3 May 2021 at 10:55, Max Reitz <mreitz@redhat.com> wrote:
>> In the bdrv_snapshot_goto() fallback code, we work with a pointer to
>> either bs->file or bs->backing.  We close that child, close the node
>> (with .bdrv_close()), apply the snapshot on the child node, and then
>> re-open the node (with .bdrv_open()).
>>
>> In order for .bdrv_open() to attach the same child node that we had
>> before, we pass "file={child-node}" or "backing={child-node}" to it.
>> Therefore, when .bdrv_open() has returned success, we can assume that
>> bs->file or bs->backing (respectively) points to our original child
>> again.  This is verified by an assertion.
>>
>> All of this is not immediately clear from a quick glance at the code,
>> so add a comment to the assertion what it is for, and why it is valid.
>> It certainly confused Coverity.
>>
>> Reported-by: Coverity (CID 1452774)
>> Signed-off-by: Max Reitz <mreitz@redhat.com>
> Did this patch get lost? I was just going through outstanding
> coverity issues and noticed it was posted a month ago and not
> in master...

Oh, right, sorry.  Thanks for the reminder.

Now applied to my block branch:

https://github.com/XanClic/qemu/commits/block



      reply	other threads:[~2021-06-04 16:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-03  9:54 [PATCH] block/snapshot: Clarify goto fallback behavior Max Reitz
2021-05-05 15:05 ` Vladimir Sementsov-Ogievskiy
2021-05-05 16:25   ` Max Reitz
2021-05-05 20:37     ` Vladimir Sementsov-Ogievskiy
2021-05-06 15:57       ` Vladimir Sementsov-Ogievskiy
2021-06-03 16:02 ` Peter Maydell
2021-06-04 16:10   ` Max Reitz [this message]

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=d2987f44-d1f6-88e2-123a-be9c6071b833@redhat.com \
    --to=mreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-block@nongnu.org \
    --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).