Received: from eggs.gnu.org ([208.118.235.92]:51975) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sf5MM-0004li-1h for qemu-devel@nongnu.org; Thu, 14 Jun 2012 04:24:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sf5MK-0007Zj-2O for qemu-devel@nongnu.org; Thu, 14 Jun 2012 04:24:53 -0400 Received: from csmailer.cs.nctu.edu.tw ([140.113.235.130]:37122) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sf5MJ-0007ZO-Dj for qemu-devel@nongnu.org; Thu, 14 Jun 2012 04:24:51 -0400 Received: from csmailer.cs.nctu.edu.tw (localhost [127.0.0.1]) by csmailer.cs.nctu.edu.tw (Postfix) with ESMTP id 3FF0D7D2 for ; Thu, 14 Jun 2012 16:24:46 +0800 (CST) Received: from alumni.cs.nctu.edu.tw (alumni.cs.nctu.edu.tw [140.113.235.116]) by csmailer.cs.nctu.edu.tw (Postfix) with ESMTP id 156657D1 for ; Thu, 14 Jun 2012 16:24:46 +0800 (CST) Received: (from chenwj@localhost) by alumni.cs.nctu.edu.tw (8.14.4/8.14.4/Submit) id q5E8OilO006833 for qemu-devel@nongnu.org; Thu, 14 Jun 2012 16:24:44 +0800 (CST) (envelope-from chenwj) Date: Thu, 14 Jun 2012 16:24:44 +0800 From: =?utf-8?B?6Zmz6Z+L5Lu7IChXZWktUmVuIENoZW4p?= Message-ID: <20120614082444.GA1692@cs.nctu.edu.tw> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] Does kvm_fd mean KVM or VCPU fd? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hi all, While reading KVM releated code in QEMU, I found the name of one field in CPU_COMMON (cpu-defs.h), i.e. kvm_fd, might be misleading. See the code below, --- int kvm_init_vcpu(CPUArchState *env) { ret =3D kvm_vm_ioctl(s, KVM_CREATE_VCPU, env->cpu_index); env->kvm_fd =3D ret; /* VCPU fd? */ } --- I think KVM_CREATE_VCPU should return VCPU fd, right? AFAIK, in KVM world, kvm_fd usually means the fd we get after opening "/dev/kvm". Just want to make sure I understand the code correcly. Thanks. Regards, chenwj --=20 Wei-Ren Chen (=E9=99=B3=E9=9F=8B=E4=BB=BB) Computer Systems Lab, Institute of Information Science, Academia Sinica, Taiwan (R.O.C.) Tel:886-2-2788-3799 #1667 Homepage: http://people.cs.nctu.edu.tw/~chenwj