[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v
From: |
Jason Gunthorpe |
Subject: |
Re: [PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2 |
Date: |
Thu, 17 Nov 2022 13:24:45 -0400 |
On Thu, Nov 17, 2022 at 07:07:10PM +0200, Avihai Horon wrote:
> > > + }
> > > +
> > > + if (mig_state->data_fd != -1) {
> > > + if (migration->data_fd != -1) {
> > > + /*
> > > + * This can happen if the device is asynchronously reset and
> > > + * terminates a data transfer.
> > > + */
> > > + error_report("%s: data_fd out of sync", vbasedev->name);
> > > + close(mig_state->data_fd);
> > > +
> > > + return -1;
> > Should we go to recover_state here? Is migration->device_state
> > invalid? -EBADF?
>
> Yes, we should.
> Although VFIO_DEVICE_FEATURE_MIG_DEVICE_STATE ioctl above succeeded, setting
> the device state didn't *really* succeed, as the data_fd went out of sync.
> So we should go to recover_state and return -EBADF.
The state did succeed and it is now "new_state". Getting an
unexpected data_fd means it did something like RUNNING->PRE_COPY_P2P
when the code was expecting PRE_COPY->PRE_COPY_P2P.
It is actually in PRE_COPY_P2P but the in-progress migration must be
stopped and the kernel would have made the migration->data_fd
permanently return some error when it went async to RUNNING.
The recovery is to resart the migration (of this device?) from the
start.
Jason
- Re: [PATCH v3 14/17] vfio/migration: Reset device if setting recover state fails, (continued)
- [PATCH v3 17/17] vfio/migration: Query device data size in vfio_save_pending(), Avihai Horon, 2022/11/03
- [PATCH v3 15/17] vfio: Alphabetize migration section of VFIO trace-events file, Avihai Horon, 2022/11/03
- [PATCH v3 02/17] migration: No save_live_pending() method uses the QEMUFile parameter, Avihai Horon, 2022/11/03
- [PATCH v3 16/17] docs/devel: Align vfio-migration docs to VFIO migration v2, Avihai Horon, 2022/11/03
- [PATCH v3 09/17] vfio/common: Change vfio_devices_all_running_and_saving() logic to equivalent one, Avihai Horon, 2022/11/03
- [PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2, Avihai Horon, 2022/11/03
- Re: [PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2, Alex Williamson, 2022/11/16
- Re: [PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2, Alex Williamson, 2022/11/17
- Re: [PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2, Avihai Horon, 2022/11/20
- Re: [PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2, Avihai Horon, 2022/11/24
- Re: [PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2, Alex Williamson, 2022/11/28
- Re: [PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2, Jason Gunthorpe, 2022/11/28
- Re: [PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2, Alex Williamson, 2022/11/28
- Re: [PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2, Jason Gunthorpe, 2022/11/28
- Re: [PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2, Alex Williamson, 2022/11/28
- Re: [PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2, Avihai Horon, 2022/11/29