[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 04/14] vfio-user: define vfio-user-server object
From: |
Jag Raman |
Subject: |
Re: [PATCH v4 04/14] vfio-user: define vfio-user-server object |
Date: |
Fri, 17 Dec 2021 02:31:14 +0000 |
> On Dec 16, 2021, at 4:58 AM, Stefan Hajnoczi <stefanha@redhat.com> wrote:
>
> On Wed, Dec 15, 2021 at 10:35:28AM -0500, Jagannathan Raman wrote:
>> +static void vfu_object_set_socket(Object *obj, Visitor *v, const char *name,
>> + void *opaque, Error **errp)
>> +{
>> + VfuObject *o = VFU_OBJECT(obj);
>> +
>> + qapi_free_SocketAddress(o->socket);
>> +
>> + o->socket = NULL;
>> +
>> + visit_type_SocketAddress(v, name, &o->socket, errp);
>> +
>> + if (o->socket->type != SOCKET_ADDRESS_TYPE_UNIX) {
>> + qapi_free_SocketAddress(o->socket);
>> + o->socket = NULL;
>> + error_setg(errp, "vfu: Unsupported socket type - %s",
>> + o->socket->u.q_unix.path);
>> + return;
>> + }
>> +
>> + trace_vfu_prop("socket", o->socket->u.q_unix.path);
>> +}
>> +
>> +static void vfu_object_set_device(Object *obj, const char *str, Error
>> **errp)
>> +{
>> + VfuObject *o = VFU_OBJECT(obj);
>> +
>> + g_free(o->device);
>> +
>> + o->device = g_strdup(str);
>> +
>> + trace_vfu_prop("device", str);
>> +}
>
> It appears "socket" and "device" can be changed after the
> vfio-user server has started. In the best case it just means the
> properties contain values that do not reflect the actual socket/device
> currently in use, which is confusing.
I’m not sure about the scenario in which that would occur, but will add that
check.
Thank you!
--
Jag
>
> It's safer to refuse changing these properties once the vfio-user
> server has started.
>
> Stefan
- Re: [PATCH v4 11/14] vfio-user: IOMMU support for remote device, (continued)
[PATCH v4 12/14] vfio-user: handle device interrupts, Jagannathan Raman, 2021/12/15
[PATCH v4 13/14] vfio-user: register handlers to facilitate migration, Jagannathan Raman, 2021/12/15
[PATCH v4 14/14] vfio-user: avocado tests for vfio-user, Jagannathan Raman, 2021/12/15
[PATCH v4 04/14] vfio-user: define vfio-user-server object, Jagannathan Raman, 2021/12/15