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

Re: [Xen-devel] [PATCH] xl: Apply CLOEXEC to the restore_fd.



On Mon, 28 Nov 2011, Ian Jackson wrote:

> Anthony PERARD writes ("[Xen-devel] [PATCH] xl: Apply CLOEXEC to the 
> restore_fd."):
> > diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
> > index 080aa2b..8bdfc32 100644
> > --- a/tools/libxl/xl_cmdimpl.c
> > +++ b/tools/libxl/xl_cmdimpl.c
> > @@ -1382,6 +1382,7 @@ static int create_domain(struct domain_create 
> > *dom_info)
> >
> >          restore_fd = migrate_fd >= 0 ? migrate_fd :
> >              open(restore_file, O_RDONLY);
> > +        libxl_fd_set_cloexec(restore_fd);
>
> I don't think it's really sensible for this function to set cloexec on
> a descriptor provided by its caller.  I'm afraid that although it
> makes the code longer, I would prefer it if the cloexec was set at
> each point when the fd is opened.

I think, for `xl restore`, the open is here, and I forgot the rest.
I will set cloexec where the fd is opened.

Thanks,

-- 
Anthony PERARD

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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