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
signature.asc
Description: PGP signature
