From: Eric Blake <eblake@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: qemu-devel@nongnu.org, akalenyu@redhat.com,
qemu-block@nongnu.org,
"Pierrick Bouvier" <pierrick.bouvier@oss.qualcomm.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Benjamin Marzinski" <bmarzins@redhat.com>,
"Hanna Reitz" <hreitz@redhat.com>,
"Kevin Wolf" <kwolf@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Fam Zheng" <fam@euphon.net>
Subject: Re: [PATCH 3/8] hw/scsi-disk: move MIG_EVENT_FAILED into a new function
Date: Tue, 13 Oct 2026 14:12:06 -0500 [thread overview]
Message-ID: <as6CZCY2Dx69aMgT@redhat.com> (raw)
In-Reply-To: <20261013180527.GC1193846@shajnocz.csb>
On Tue, Oct 13, 2026 at 02:05:27PM -0400, Stefan Hajnoczi wrote:
> On Tue, Oct 13, 2026 at 10:00:15AM -0500, Eric Blake wrote:
> > On Fri, Oct 09, 2026 at 11:30:53AM -0400, Stefan Hajnoczi wrote:
> > > Move the MIG_EVENT_FAILED logic from scsi_block_migration_notifier()
> > > into its own new scsi_block_migration_failed() function. The next commit
> > > adds logic for handling another event, so doing that in dedicated
> > > functions makes the code easier to read.
> > >
> > > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> > > ---
> > > hw/scsi/scsi-disk.c | 26 ++++++++++++++++----------
> > > 1 file changed, 16 insertions(+), 10 deletions(-)
> >
> > >
> > > diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
> > > index deb33ac1dda..3d88e57eded 100644
> > > --- a/hw/scsi/scsi-disk.c
> > > +++ b/hw/scsi/scsi-disk.c
> > > @@ -2761,20 +2761,26 @@ static SCSIRequest *scsi_new_request(SCSIDevice *d, uint32_t tag, uint32_t lun,
> > > * fails because the destination may have already preempted and we need to get
> > > * the reservation back.
> > > */
> >
> > I think this comment...
> >
> > > +static void scsi_block_migration_failed(SCSIDiskState *s)
> > > +{
> > > + SCSIDevice *d = &s->qdev;
> > > + Error *local_err = NULL;
> > > +
> > > + if (!scsi_generic_pr_state_preempt(d, &local_err)) {
> > > + /* MIG_EVENT_FAILED cannot fail, so just warn */
> > > + error_prepend(&local_err, "scsi-block migration rollback: ");
> > > + warn_report_err(local_err);
> > > + }
> > > +}
> > > +
> > > static int scsi_block_migration_notifier(NotifierWithReturn *notifier,
> >
> > ...belongs better with the function it was originally introducing.
>
> I think it's clearer to explain scsi_block_migration_failed()'s purpose
> in its doc comment rather than in scsi_block_migration_notifier(), which
> this patch series turns into just a dispatch function that doesn't do
> anything itself.
>
> scsi_block_migration_notifier() will dispatch MIG_EVENT_DONE in a later
> commit, so it's more general and no longer does the MIG_EVENT_FAILED
> work itself.
>
> What do you think?
Okay, that explanation makes sense. I'll take a look at your v2 now.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization: qemu.org | libguestfs.org
next prev parent reply other threads:[~2026-10-13 19:12 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-09 15:30 [PATCH 0/8] scsi: clean up persistent reservation state after migration Stefan Hajnoczi
2026-10-09 15:30 ` [PATCH 1/8] pr-manager-helper: fix sense buffer overflow Stefan Hajnoczi
2026-10-13 14:50 ` Eric Blake
2026-10-09 15:30 ` [PATCH 2/8] scsi: increase sense buffer size in scsi_SG_IO() Stefan Hajnoczi
2026-10-13 14:52 ` Eric Blake
2026-10-09 15:30 ` [PATCH 3/8] hw/scsi-disk: move MIG_EVENT_FAILED into a new function Stefan Hajnoczi
2026-10-13 15:00 ` Eric Blake
2026-10-13 18:05 ` Stefan Hajnoczi
2026-10-13 19:12 ` Eric Blake [this message]
2026-10-09 15:30 ` [PATCH 4/8] qemu-pr-helper: add PR_HELPER_CLEANUP for live migration Stefan Hajnoczi
2026-10-13 18:32 ` Eric Blake
2026-10-09 15:30 ` [PATCH 5/8] pr-manager-helper: add PR_HELPER_CLEANUP command support Stefan Hajnoczi
2026-10-13 16:25 ` Paolo Bonzini
2026-10-13 17:57 ` Stefan Hajnoczi
2026-10-09 15:30 ` [PATCH 6/8] file-posix: forward PR_HELPER_CLEANUP commands to pr-manager Stefan Hajnoczi
2026-10-09 15:30 ` [PATCH 7/8] scsi: clean up persistent reservation state after migration Stefan Hajnoczi
2026-10-09 15:30 ` [PATCH 8/8] scsi: use REGISTER AND IGNORE EXISTING KEY for robustness Stefan Hajnoczi
2026-10-13 18:40 ` Eric Blake
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=as6CZCY2Dx69aMgT@redhat.com \
--to=eblake@redhat.com \
--cc=akalenyu@redhat.com \
--cc=berrange@redhat.com \
--cc=bmarzins@redhat.com \
--cc=fam@euphon.net \
--cc=hreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=pierrick.bouvier@oss.qualcomm.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.