[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v3 30/31] libxl_dm: Pre-open QMP socket for QEMU



Anthony PERARD writes ("[PATCH v3 30/31] libxl_dm: Pre-open QMP socket for 
QEMU"):
> When starting QEMU with dm_restrict=1, pre-open the QMP socket before
> exec QEMU. That socket will be usefull to findout if QEMU is ready, and
> pre-opening it means that libxl can connect to it without waiting for
> QEMU to create it.
...
> +        socket_fd = socket(AF_UNIX, SOCK_STREAM, 0);
> +        *dm_monitor_fd = socket_fd;
> +        if (socket_fd < 0) {
> +            LOGED(ERROR, guest_domid, "Failed to create UNIX socket");
> +            return ERROR_FAIL;
> +        }

I can't help thinking that this is a lot of lines of code.  Is none of
this available anywhere else for reuse ?

> +        socket_path = GCSPRINTF("%s/qmp-libxl-%d",
> +                                libxl__run_dir_path(), guest_domid);
> +        if (strlen(socket_path) > sizeof(un.sun_path)) {
> +            LOGD(ERROR, guest_domid, "UNIX socket path '%s' is too long",
> +                 socket_path);
> +            LOGD(DEBUG, guest_domid, "Path must be less than %zu bytes",
> +                 sizeof(un.sun_path));
> +            return ERROR_FAIL;
> +        }

Eg this part maybe ?

Thanks,
Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.