size = ALIGN(((mem->memory_size) >> TARGET_PAGE_BITS),
/*HOST_LONG_BITS*/ 64) / 8;
if (!d.dirty_bitmap) {
- d.dirty_bitmap = qemu_malloc(size);
+ d.dirty_bitmap = g_malloc(size);
} else if (size > allocated_size) {
- d.dirty_bitmap = qemu_realloc(d.dirty_bitmap, size);
+ d.dirty_bitmap = g_realloc(d.dirty_bitmap, size);
}
allocated_size = size;
memset(d.dirty_bitmap, 0, allocated_size);
mem->start_addr, mem->memory_size);
start_addr = mem->start_addr + mem->memory_size;
}
- qemu_free(d.dirty_bitmap);
+ g_free(d.dirty_bitmap);
return ret;
}
* Older kernels have a 6 device limit on the KVM io bus. Find out so we
* can avoid creating too many ioeventfds.
*/
-#if defined(CONFIG_EVENTFD) && defined(CONFIG_IOTHREAD)
+#if defined(CONFIG_EVENTFD)
int ioeventfds[7];
int i, ret = 0;
for (i = 0; i < ARRAY_SIZE(ioeventfds); i++) {
int ret;
int i;
- s = qemu_mallocz(sizeof(KVMState));
+ s = g_malloc0(sizeof(KVMState));
#ifdef KVM_CAP_SET_GUEST_DEBUG
QTAILQ_INIT(&s->kvm_sw_breakpoints);
close(s->fd);
}
}
- qemu_free(s);
+ g_free(s);
return ret;
}
return 0;
}
- bp = qemu_malloc(sizeof(struct kvm_sw_breakpoint));
+ bp = g_malloc(sizeof(struct kvm_sw_breakpoint));
if (!bp) {
return -ENOMEM;
}
bp->use_count = 1;
err = kvm_arch_insert_sw_breakpoint(current_env, bp);
if (err) {
- qemu_free(bp);
+ g_free(bp);
return err;
}
}
QTAILQ_REMOVE(¤t_env->kvm_state->kvm_sw_breakpoints, bp, entry);
- qemu_free(bp);
+ g_free(bp);
} else {
err = kvm_arch_remove_hw_breakpoint(addr, len, type);
if (err) {
return kvm_vcpu_ioctl(env, KVM_SET_SIGNAL_MASK, NULL);
}
- sigmask = qemu_malloc(sizeof(*sigmask) + sizeof(*sigset));
+ sigmask = g_malloc(sizeof(*sigmask) + sizeof(*sigset));
sigmask->len = 8;
memcpy(sigmask->sigset, sigset, sizeof(*sigset));
r = kvm_vcpu_ioctl(env, KVM_SET_SIGNAL_MASK, sigmask);
- qemu_free(sigmask);
+ g_free(sigmask);
return r;
}