Re: [libvirt] [PATCH] SetAutostart and GetAutostart in openvz driver

2008-07-10 Thread Daniel Veillard
On Wed, Jul 09, 2008 at 06:48:25PM +0400, Evgeniy Sokolov wrote: > > > >I realize you are just following the existing pattern used in OpenVZ > >driver, but this piece of code is horrible. > > > >sprintf'ing into a string, then parsing that string and turning it back > >into a list of argv[] strin

Re: [libvirt] [PATCH] SetAutostart and GetAutostart in openvz driver

2008-07-09 Thread Evgeniy Sokolov
I realize you are just following the existing pattern used in OpenVZ driver, but this piece of code is horrible. sprintf'ing into a string, then parsing that string and turning it back into a list of argv[] strings, with no escaping of special characters, or quoting. eg if the vm name had a s

Re: [libvirt] [PATCH] SetAutostart and GetAutostart in openvz driver

2008-07-08 Thread Daniel P. Berrange
On Tue, Jul 08, 2008 at 05:51:05PM +0400, Evgeniy Sokolov wrote: > +int > +openvzReadConfigParam(int vpsid ,const char * param, char *value, int maxlen) > +{ > +char conf_file[PATH_MAX] ; > +char line[PATH_MAX] ; > +int ret, found = 0; > +char * conf_dir; > +int fd ; > +char

[libvirt] [PATCH] SetAutostart and GetAutostart in openvz driver

2008-07-08 Thread Evgeniy Sokolov
Implemented functions domainSetAutostart and domainGetAutostart. other: fixed closing file descriptor during reading uuid from config. Index: src/openvz_conf.c === RCS file: /data/cvs/libvirt/src/openvz_conf.c,v retrieving revision