qemu-devel
[Top][All Lists]
Advanced

[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: Stefan Hajnoczi
Subject: Re: [PATCH v4 04/14] vfio-user: define vfio-user-server object
Date: Thu, 16 Dec 2021 09:58:52 +0000

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.

It's safer to refuse changing these properties once the vfio-user
server has started.

Stefan

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]