On Mon, Sep 03, 2007 at 08:01:00AM -0400, Shuveb Hussain wrote:
Hi,
Attached are the OpenVZ driver enhancements. Cleanups have been done
according to Daniel .V's suggestions. Please see my previous mail for
summary.
Okay, that looks better, thanks a lot !
I will apply them but there is a few things I still have issues with,
I will try to fix them before commiting the patches:
- in general using NULL to test anything but a pointer is not good
code, thing like
if(uuidstr[0] == (int)NULL) {
is not okay. If you want to test a char for 0 use 0 not NULL.
- I will have to check better but trying to detect an uninitialized UUID
just by checking the first byte sounds rather wrong to me, but maybe
I missed something.
- some really bizare changes of an xmlDoc name field:
+ if (!(xml->name = calloc(1, PATH_MAX))) {
+ openvzLog(OPENVZ_ERR, "Error in allocating memory to store xml
URI");
+ xmlFreeDoc(xml);
+ return NULL;
+ }
+ if (displayName)
+ strncpy(xml->name, displayName, PATH_MAX - 1);
+ else
+ strncpy(xml->name, "domain.xml", PATH_MAX - 1);
that's bad because:
+ it will probably leak the previous value of xml->name
+ xml->name should be allocated using xmlMalloc
+ why allocate MAX_PATH when you can allocate just the size
so I will cleanup that part, still I don't undertsand what you
tried to do there.
This should hit CVS later today when I cleaned up those things and possibly
a couple of warnings,
thanks again !
Daniel
--
Red Hat Virtualization group
http://redhat.com/virtualization/
Daniel Veillard | virtualization library
http://libvirt.org/
veillard(a)redhat.com | libxml GNOME XML XSLT toolkit
http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine
http://rpmfind.net/