+Wed Mar 21 16:31:29 CET 2007 Daniel Veillard <veillard@redhat.com>
+
+ * qemud/buf.c src/xml.c: clarified virBufferGrow (and bufferGrow)
+ routines documentation and fixes a couple of places where this
+ was misused as pointed by Daniel Berrange.
+
Wed Mar 21 10:52:06 EST 2007 Daniel P. Berrange <berrange@redhat.com>
* acinclude.m4: Always use -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
TODO:
- libvirt_virDomainSetMemory should check memory is > 0
+- remove calls from sprintf and use snprintf
- check how to better handle renaming of domains (xm rename and cache)
- UUID lookup in hash.c
/**
* bufferGrow:
* @buf: the buffer
- * @len: the minimum free size to allocate
+ * @len: the minimum free size to allocate on top of existing used space
*
- * Grow the available space of an XML buffer.
+ * Grow the available space of a buffer to at least @len bytes.
*
* Returns the new available space or -1 in case of error
*/
needSize = buf->use + len + 2;
if (needSize > buf->size) {
- if (!bufferGrow(buf, needSize)) {
+ if (!bufferGrow(buf, needSize - buf->use)) {
return (-1);
}
}
unsigned int needSize = buf->use + len + 2;
if (needSize > buf->size) {
- if (!bufferGrow(buf, needSize))
+ if (!bufferGrow(buf, needSize - buf->use))
return -1;
}
memcpy(&buf->content[buf->use], str, len);
/**
* virBufferGrow:
* @buf: the buffer
- * @len: the minimum free size to allocate
+ * @len: the minimum free size to allocate on top of existing used space
*
- * Grow the available space of an XML buffer.
+ * Grow the available space of an XML buffer to at least @len bytes.
*
* Returns the new available space or -1 in case of error
*/
needSize = buf->use + len + 2;
if (needSize > buf->size) {
- if (!virBufferGrow(buf, needSize)) {
+ if (!virBufferGrow(buf, needSize - buf->use)) {
return (-1);
}
}
unsigned int needSize = buf->use + len + 2;
if (needSize > buf->size) {
- if (!virBufferGrow(buf, needSize))
+ if (!virBufferGrow(buf, needSize - buf->use))
return -1;
}
memcpy(&buf->content[buf->use], str, len);