~ubuntu-branches/ubuntu/jaunty/libvirt/jaunty-updates

« back to all changes in this revision

Viewing changes to src/memory.c

  • Committer: Bazaar Package Importer
  • Author(s): Soren Hansen
  • Date: 2009-01-08 23:01:16 UTC
  • mfrom: (1.1.8 upstream) (3.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20090108230116-niu4xzgypapywhmx
Tags: 0.5.1-4ubuntu1
* Merge with Debian experimental.
  - debian/control:
    + Don't build-depend on QEmu.
    + Add "XS-Debian-" prefix to Debian's Vcs headers.
    + Bump bridge-utils, dnsmasq-base, netcat-openbsd, and iptables
      to Depends of libvirt-bin.
    + s/interract/interact/g
    + Add versioned Conflicts/Replaces to libvirt0 for libvirt0-dbg,
      since we used to ship them as such.
  - Rename libvirt group to libvirtd.
  - 0005-delayed_iff_up_bridge.patch: Don't try to bring up the bridge
    before at least one interface has been added to it.
  - dont_clobber_existing_bridges.patch: Assign the name of the virtual
    bridge dynamically to avoid interfering with existing bridges.
  - better_default_uri_virsh.patch: Default to qemu:///system if the
    user has write access to the libvirt socket, otherwise
    qemu:///session.
  - We call libxen-dev libxen3-dev, so change all references.
* Included (but did not enable) opennebula patch (since it's not in
  the archive yet).

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
 *
89
89
 * Returns -1 on failure to allocate, zero on success
90
90
 */
91
 
int __virAlloc(void *ptrptr, size_t size)
 
91
int virAlloc(void *ptrptr, size_t size)
92
92
{
93
93
#if TEST_OOM
94
94
    if (virAllocTestFail()) {
116
116
 *
117
117
 * Returns -1 on failure to allocate, zero on success
118
118
 */
119
 
int __virAllocN(void *ptrptr, size_t size, size_t count)
 
119
int virAllocN(void *ptrptr, size_t size, size_t count)
120
120
{
121
121
#if TEST_OOM
122
122
    if (virAllocTestFail()) {
145
145
 *
146
146
 * Returns -1 on failure to allocate, zero on success
147
147
 */
148
 
int __virReallocN(void *ptrptr, size_t size, size_t count)
 
148
int virReallocN(void *ptrptr, size_t size, size_t count)
149
149
{
150
150
    void *tmp;
151
151
#if TEST_OOM
158
158
        return -1;
159
159
    }
160
160
    tmp = realloc(*(void**)ptrptr, size * count);
161
 
    if (!tmp)
 
161
    if (!tmp && (size * count))
162
162
        return -1;
163
163
    *(void**)ptrptr = tmp;
164
164
    return 0;
172
172
 * the 'ptrptr' variable. After release, 'ptrptr' will be
173
173
 * updated to point to NULL.
174
174
 */
175
 
void __virFree(void *ptrptr)
 
175
void virFree(void *ptrptr)
176
176
{
177
177
    free(*(void**)ptrptr);
178
178
    *(void**)ptrptr = NULL;