[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v13 10/19] multi-process: Associate fd of a PCIDevice with it
From: |
Stefan Hajnoczi |
Subject: |
Re: [PATCH v13 10/19] multi-process: Associate fd of a PCIDevice with its object |
Date: |
Mon, 14 Dec 2020 21:23:46 +0000 |
On Mon, Dec 14, 2020 at 12:14:50AM -0500, Jagannathan Raman wrote:
> +static void remote_object_release(DeviceListener *listener, DeviceState *dev)
> +{
> + RemoteObject *o = container_of(listener, RemoteObject, listener);
> +
> + if (o->dev == dev) {
> + object_unref(OBJECT(o));
> + }
> +}
> +
> +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);
> +
> + o->dev = dev;
> +
> + o->listener.unrealize = remote_object_release;
> + device_listener_register(&o->listener);
The remote_object_release() name is outdated. How about
remote_object_unrealize_listener()?
signature.asc
Description: PGP signature
- Re: [PATCH v13 07/19] multi-process: add qio channel function to transmit data and fds, (continued)
[PATCH v13 03/19] memory: alloc RAM from file at offset, Jagannathan Raman, 2020/12/14
[PATCH v13 04/19] multi-process: Add config option for multi-process QEMU, Jagannathan Raman, 2020/12/14
[PATCH v13 01/19] multi-process: add the concept description to docs/devel/qemu-multiprocess, Jagannathan Raman, 2020/12/14
[PATCH v13 12/19] multi-process: introduce proxy object, Jagannathan Raman, 2020/12/14
[PATCH v13 09/19] multi-process: Initialize message handler in remote device, Jagannathan Raman, 2020/12/14
[PATCH v13 10/19] multi-process: Associate fd of a PCIDevice with its object, Jagannathan Raman, 2020/12/14
[PATCH v13 13/19] multi-process: add proxy communication functions, Jagannathan Raman, 2020/12/14
[PATCH v13 17/19] multi-process: create IOHUB object to handle irq, Jagannathan Raman, 2020/12/14
[PATCH v13 14/19] multi-process: Forward PCI config space acceses to the remote process, Jagannathan Raman, 2020/12/14
[PATCH v13 18/19] multi-process: Retrieve PCI info from remote process, Jagannathan Raman, 2020/12/14
[PATCH v13 16/19] multi-process: Synchronize remote memory, Jagannathan Raman, 2020/12/14
[PATCH v13 05/19] multi-process: setup PCI host bridge for remote device, Jagannathan Raman, 2020/12/14