Revision 7267c094 xen-all.c

b/xen-all.c
140 140
    RAMBlock *new_block;
141 141
    ram_addr_t below_4g_mem_size, above_4g_mem_size = 0;
142 142

  
143
    new_block = qemu_mallocz(sizeof (*new_block));
143
    new_block = g_malloc0(sizeof (*new_block));
144 144
    pstrcpy(new_block->idstr, sizeof (new_block->idstr), "xen.ram");
145 145
    new_block->host = NULL;
146 146
    new_block->offset = 0;
......
154 154

  
155 155
    QLIST_INSERT_HEAD(&ram_list.blocks, new_block, next);
156 156

  
157
    ram_list.phys_dirty = qemu_realloc(ram_list.phys_dirty,
157
    ram_list.phys_dirty = g_realloc(ram_list.phys_dirty,
158 158
                                       new_block->length >> TARGET_PAGE_BITS);
159 159
    memset(ram_list.phys_dirty + (new_block->offset >> TARGET_PAGE_BITS),
160 160
           0xff, new_block->length >> TARGET_PAGE_BITS);
......
190 190
    trace_xen_ram_alloc(ram_addr, size);
191 191

  
192 192
    nr_pfn = size >> TARGET_PAGE_BITS;
193
    pfn_list = qemu_malloc(sizeof (*pfn_list) * nr_pfn);
193
    pfn_list = g_malloc(sizeof (*pfn_list) * nr_pfn);
194 194

  
195 195
    for (i = 0; i < nr_pfn; i++) {
196 196
        pfn_list[i] = (ram_addr >> TARGET_PAGE_BITS) + i;
......
200 200
        hw_error("xen: failed to populate ram at " RAM_ADDR_FMT, ram_addr);
201 201
    }
202 202

  
203
    qemu_free(pfn_list);
203
    g_free(pfn_list);
204 204
}
205 205

  
206 206
static XenPhysmap *get_physmapping(XenIOState *state,
......
267 267
        }
268 268
    }
269 269

  
270
    physmap = qemu_malloc(sizeof (XenPhysmap));
270
    physmap = g_malloc(sizeof (XenPhysmap));
271 271

  
272 272
    physmap->start_addr = start_addr;
273 273
    physmap->size = size;
......
888 888
    unsigned long ioreq_pfn;
889 889
    XenIOState *state;
890 890

  
891
    state = qemu_mallocz(sizeof (XenIOState));
891
    state = g_malloc0(sizeof (XenIOState));
892 892

  
893 893
    state->xce_handle = xen_xc_evtchn_open(NULL, 0);
894 894
    if (state->xce_handle == XC_HANDLER_INITIAL_VALUE) {
......
922 922
        hw_error("map buffered IO page returned error %d", errno);
923 923
    }
924 924

  
925
    state->ioreq_local_port = qemu_mallocz(smp_cpus * sizeof (evtchn_port_t));
925
    state->ioreq_local_port = g_malloc0(smp_cpus * sizeof (evtchn_port_t));
926 926

  
927 927
    /* FIXME: how about if we overflow the page here? */
928 928
    for (i = 0; i < smp_cpus; i++) {

Also available in: Unified diff