On Mon, Sep 03, 2007 at 08:39:27AM -0400, Daniel Veillard wrote:
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:
Okay I commited to CVS earlier today
- 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.
I removed that part. The URI information passed to the xmlDocRead earlier
should result in the same xml->URI being set, so I don't see the point
of that duplication, dropped for now.
This should hit CVS later today when I cleaned up those things and
possibly
a couple of warnings,
I am also applying that second patch to clean thing up, this removes most
warnings at compile time, fix a serious deallocation problem on error when
listing the domains, and change strtoI to indicate it does not change the
input string.
There is still 3 serious warnings in openvz_conf.c around line 700, where
the return value of write is not checked and as I indicated previously we
should use a wrapper function handling interrupted calls at least. But that
can be done later,
thanks,
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/