[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v10 08/19] multi-process: Associate fd of a PCIDevice with it
From: |
Stefan Hajnoczi |
Subject: |
Re: [PATCH v10 08/19] multi-process: Associate fd of a PCIDevice with its object |
Date: |
Wed, 7 Oct 2020 15:34:45 +0100 |
On Mon, Oct 05, 2020 at 11:50:56AM -0700, elena.ufimtseva@oracle.com wrote:
> +static void remote_object_machine_done(Notifier *notifier, void *data)
> +{
> + RemoteObject *o = container_of(notifier, RemoteObject, machine_done);
> + DeviceState *dev = NULL;
> + QIOChannel *ioc = NULL;
> + Coroutine *co = NULL;
> + RemoteCommDev *comdev = NULL;
> + Error *err = NULL;
> +
> + dev = qdev_find_recursive(sysbus_get_default(), o->devid);
> + if (!dev || !object_dynamic_cast(OBJECT(dev), TYPE_PCI_DEVICE)) {
> + error_report("%s is not a PCI device", o->devid);
> + return;
> + }
> +
> + ioc = qio_channel_new_fd(o->fd, &err);
> + if (!ioc) {
> + error_report_err(err);
> + return;
> + }
> + qio_channel_set_blocking(ioc, false, NULL);
> + qio_channel_set_feature(ioc, QIO_CHANNEL_FEATURE_FD_PASS);
This flag is already set by qio_channel_socket_set_fd() from
qio_channel_new_fd() so the call to qio_channel_set_feature() can be
dropped.
You may want to check the presence of the feature in case a non-AF_UNIX
fd was passed though.
signature.asc
Description: PGP signature
- [PATCH v10 00/19] Initial support for multi-process Qemu, elena . ufimtseva, 2020/10/05
- [PATCH v10 06/19] multi-process: define MPQemuMsg format and transmission functions, elena . ufimtseva, 2020/10/05
- [PATCH v10 02/19] multi-process: Add config option for multi-process QEMU, elena . ufimtseva, 2020/10/05
- [PATCH v10 01/19] memory: alloc RAM from file at offset, elena . ufimtseva, 2020/10/05
- [PATCH v10 07/19] multi-process: Initialize message handler in remote device, elena . ufimtseva, 2020/10/05
- [PATCH v10 03/19] multi-process: setup PCI host bridge for remote device, elena . ufimtseva, 2020/10/05
- [PATCH v10 05/19] multi-process: add qio channel function to transmit, elena . ufimtseva, 2020/10/05
- [PATCH v10 08/19] multi-process: Associate fd of a PCIDevice with its object, elena . ufimtseva, 2020/10/05
- Re: [PATCH v10 08/19] multi-process: Associate fd of a PCIDevice with its object,
Stefan Hajnoczi <=
- [PATCH v10 09/19] multi-process: setup memory manager for remote device, elena . ufimtseva, 2020/10/05
- [PATCH v10 12/19] multi-process: Forward PCI config space acceses to the remote process, elena . ufimtseva, 2020/10/05
- [PATCH v10 10/19] multi-process: introduce proxy object, elena . ufimtseva, 2020/10/05
- [PATCH v10 14/19] multi-process: Synchronize remote memory, elena . ufimtseva, 2020/10/05
- [PATCH v10 16/19] multi-process: Retrieve PCI info from remote process, elena . ufimtseva, 2020/10/05
- [PATCH v10 15/19] multi-process: create IOHUB object to handle irq, elena . ufimtseva, 2020/10/05
- [PATCH v10 04/19] multi-process: setup a machine object for remote device process, elena . ufimtseva, 2020/10/05
- [PATCH v10 11/19] multi-process: add proxy communication functions, elena . ufimtseva, 2020/10/05
- [PATCH v10 13/19] multi-process: PCI BAR read/write handling for proxy & remote endpoints, elena . ufimtseva, 2020/10/05