qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clg@redhat.com>
To: Zhenzhong Duan <zhenzhong.duan@intel.com>, qemu-devel@nongnu.org
Cc: alex.williamson@redhat.com, eric.auger@redhat.com,
	steven.sistare@oracle.com, chao.p.peng@intel.com
Subject: Re: [PATCH 2/4] vfio/container: fails mdev hotplug if add migration blocker failed
Date: Wed, 25 Jun 2025 23:08:26 +0200	[thread overview]
Message-ID: <1e67c23c-6027-4fa2-bc9e-0bc9502265d2@redhat.com> (raw)
In-Reply-To: <afc6b039-4569-460f-a15e-ac000bd44d5f@redhat.com>

On 6/24/25 11:21, Cédric Le Goater wrote:
> On 6/23/25 12:22, Zhenzhong Duan wrote:
>> It's aggressive to abort a running QEMU process when hotplug a mdev
>> and it fails migration blocker adding.
>>
>> Fix by just failing mdev hotplug itself.
>>
>> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
>> ---
>>   hw/vfio/container.c | 8 ++++++--
>>   1 file changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/hw/vfio/container.c b/hw/vfio/container.c
>> index 2853f6f08b..68b4fdb401 100644
>> --- a/hw/vfio/container.c
>> +++ b/hw/vfio/container.c
>> @@ -992,12 +992,16 @@ static bool vfio_legacy_attach_device(const char *name, VFIODevice *vbasedev,
>>       if (vbasedev->mdev) {
>>           error_setg(&vbasedev->cpr.mdev_blocker,
>>                      "CPR does not support vfio mdev %s", vbasedev->name);
>> -        migrate_add_blocker_modes(&vbasedev->cpr.mdev_blocker, &error_fatal,
>> -                                  MIG_MODE_CPR_TRANSFER, -1);
>> +        if (migrate_add_blocker_modes(&vbasedev->cpr.mdev_blocker, errp,
>> +                                      MIG_MODE_CPR_TRANSFER, -1)) {
> 
> migrate_add_blocker_modes() returns -errno. Testing with '< 0' would be
> better.
> 


Reviewed-by: Cédric Le Goater <clg@redhat.com>

I changed the test on the value returned by migrate_add_blocker_modes().


Thanks,

C.



> Thanks,
> 
> C.
> 
> 
> 
>> +            goto hiod_unref_exit;
>> +        }
>>       }
>>       return true;
>> +hiod_unref_exit:
>> +    object_unref(vbasedev->hiod);
>>   device_put_exit:
>>       vfio_device_put(vbasedev);
>>   group_put_exit:
> 



  reply	other threads:[~2025-06-25 21:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-23 10:22 [PATCH 0/4] Some trivial live update fixes Zhenzhong Duan
2025-06-23 10:22 ` [PATCH 1/4] vfio/container: Fix SIGSEGV when open container file fails Zhenzhong Duan
2025-06-24  8:53   ` Cédric Le Goater
2025-06-24  9:55   ` Cédric Le Goater
2025-06-23 10:22 ` [PATCH 2/4] vfio/container: fails mdev hotplug if add migration blocker failed Zhenzhong Duan
2025-06-24  9:21   ` Cédric Le Goater
2025-06-25 21:08     ` Cédric Le Goater [this message]
2025-06-26  1:43       ` Duan, Zhenzhong
2025-06-23 10:22 ` [PATCH 3/4] vfio/container: Fix potential SIGSEGV when recover from unmap-all-vaddr failure Zhenzhong Duan
2025-06-24 16:54   ` Cédric Le Goater
2025-06-26 12:53     ` Steven Sistare
2025-06-26 13:04       ` Steven Sistare
2025-06-23 10:22 ` [PATCH 4/4] vfio/container: Fix vfio_container_post_load() Zhenzhong Duan
2025-06-26 13:21   ` Steven Sistare

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=1e67c23c-6027-4fa2-bc9e-0bc9502265d2@redhat.com \
    --to=clg@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=chao.p.peng@intel.com \
    --cc=eric.auger@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=steven.sistare@oracle.com \
    --cc=zhenzhong.duan@intel.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 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).