From mboxrd@z Thu Jan 1 00:00:00 1970 From: Glauber Costa Subject: Re: [PATCH 2/5] reuse kvm_vm_ioctl Date: Fri, 17 Jul 2009 12:49:04 -0300 Message-ID: <20090717154904.GE4019@poweredge.glommer> References: <1247675503-7106-1-git-send-email-glommer@redhat.com> <1247675503-7106-2-git-send-email-glommer@redhat.com> <1247675503-7106-3-git-send-email-glommer@redhat.com> <20090717153917.GA4978@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, avi@redhat.com, aliguori@us.ibm.com To: Marcelo Tosatti Return-path: Received: from mx2.redhat.com ([66.187.237.31]:45851 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964817AbZGQPmW (ORCPT ); Fri, 17 Jul 2009 11:42:22 -0400 Content-Disposition: inline In-Reply-To: <20090717153917.GA4978@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: On Fri, Jul 17, 2009 at 12:39:17PM -0300, Marcelo Tosatti wrote: > On Wed, Jul 15, 2009 at 12:31:40PM -0400, Glauber Costa wrote: > > Start using kvm_vm_ioctl's code. > > For type safety, delete vm_fd from kvm_context entirely, so the > > compiler can play along with us helping to detect errors I might > > have made. > > > > Signed-off-by: Glauber Costa > > --- > > kvm-all.c | 2 ++ > > qemu-kvm-x86.c | 18 +++++++++--------- > > qemu-kvm.c | 52 ++++++++++++++++++++++++++-------------------------- > > qemu-kvm.h | 6 +++--- > > 4 files changed, 40 insertions(+), 38 deletions(-) > > > > > @@ -516,7 +516,7 @@ kvm_vcpu_context_t kvm_create_vcpu(CPUState *env, int id) > > vcpu_ctx->kvm = kvm; > > vcpu_ctx->id = id; > > > > - r = ioctl(kvm->vm_fd, KVM_CREATE_VCPU, id); > > + r = kvm_vm_ioctl(kvm_state, KVM_CREATE_VCPU, id); > > if (r == -1) { > > fprintf(stderr, "kvm_create_vcpu: %m\n"); > > > int kvm_vm_ioctl(KVMState *s, int type, ...) > { > ... > if (ret == -1) > ret = -errno; > } > > Is that fine? I don't see a problem with that. But even if there is, the way to change is it to convince anthony of the contrary. If he changes it (or anything else), we'll gain it in the next merge.