[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH V6 18/27] vfio-pci: refactor for cpr
From: |
Alex Williamson |
Subject: |
Re: [PATCH V6 18/27] vfio-pci: refactor for cpr |
Date: |
Tue, 10 Aug 2021 10:53:08 -0600 |
On Fri, 6 Aug 2021 14:43:52 -0700
Steve Sistare <steven.sistare@oracle.com> wrote:
> Export vfio_address_spaces and vfio_listener_skipped_section.
> Add optional name arg to vfio_add_kvm_msi_virq.
> Refactor vector use into a helper vfio_vector_init.
> All for use by cpr in a subsequent patch. No functional change.
Why is the name arg optional? It seems really inconsistent to me that
everything other than MSI/X uses this with a name, but MSI/X use NULL
and in an entirely separate pre-save step we then iterate through all
the {event,irq}fds to save them. If we asked for a named notifier,
shouldn't we go ahead and save it under that name at that time? ie.
static int vfio_named_notifier_init(VFIOPCIDevice *vdev, EventNotifier *e,
const char *name, int nr)
{
int ret, fd = load_event_fd(vdev, name, nr);
if (fd >= 0) {
event_notifier_init_fd(e, fd);
} else {
ret = event_notifier_init(e, 0);
if (ret) {
return ret;
}
save_event_fd(vdev, name, nr, e);
}
return 0;
}
Are we not doing this to avoid runtime overhead?
In the process, maybe we can use more descriptive names than
"interrupt", ex. "msi" or "msix".
It also feels a bit forced to me that the entire fd saving uses {name,
id} but vfio is the only caller that makes use of a non-zero id.
Should we instead just wrap all the calls from vfio to append the id to
the name so the common code can just use strcmp()? Thanks,
Alex
- [PATCH V6 09/27] oslib: qemu_clear_cloexec, (continued)
- [PATCH V6 09/27] oslib: qemu_clear_cloexec, Steve Sistare, 2021/08/06
- [PATCH V6 10/27] machine: memfd-alloc option, Steve Sistare, 2021/08/06
- [PATCH V6 11/27] qapi: list utility functions, Steve Sistare, 2021/08/06
- [PATCH V6 12/27] vl: helper to request re-exec, Steve Sistare, 2021/08/06
- [PATCH V6 13/27] cpr: preserve extra state, Steve Sistare, 2021/08/06
- [PATCH V6 14/27] cpr: restart mode, Steve Sistare, 2021/08/06
- [PATCH V6 15/27] cpr: restart HMP interfaces, Steve Sistare, 2021/08/06
- [PATCH V6 16/27] hostmem-memfd: cpr for memory-backend-memfd, Steve Sistare, 2021/08/06
- [PATCH V6 17/27] pci: export functions for cpr, Steve Sistare, 2021/08/06
- [PATCH V6 18/27] vfio-pci: refactor for cpr, Steve Sistare, 2021/08/06
- Re: [PATCH V6 18/27] vfio-pci: refactor for cpr,
Alex Williamson <=
- [PATCH V6 20/27] vfio-pci: cpr part 2 (msi), Steve Sistare, 2021/08/06
- [PATCH V6 19/27] vfio-pci: cpr part 1 (fd and dma), Steve Sistare, 2021/08/06
- [PATCH V6 22/27] vhost: reset vhost devices for cpr, Steve Sistare, 2021/08/06
- [PATCH V6 23/27] chardev: cpr framework, Steve Sistare, 2021/08/06
- [PATCH V6 25/27] chardev: cpr for pty, Steve Sistare, 2021/08/06
- [PATCH V6 26/27] chardev: cpr for sockets, Steve Sistare, 2021/08/06
- [PATCH V6 27/27] cpr: only-cpr-capable option, Steve Sistare, 2021/08/06