From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vincent KHERBACHE Subject: Re: Get a vm fd using kvm API's ioctls Date: Wed, 05 Feb 2014 18:17:16 +0100 Message-ID: <52F2721C.10806@inria.fr> References: <52F2671D.2010704@inria.fr> <52F26C57.5080409@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org To: Paolo Bonzini Return-path: Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:41474 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753264AbaBERRr (ORCPT ); Wed, 5 Feb 2014 12:17:47 -0500 In-Reply-To: <52F26C57.5080409@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Le 05/02/2014 17:52, Paolo Bonzini a =C3=A9crit : > Il 05/02/2014 17:30, Vincent KHERBACHE ha scritto: >> Hi all, >> >> I'm trying to get the dirty bitmap of a specific VM, using >> KVM_GET_DIRTY_LOG ioctl. >> >> For this purpose, I should be able to get the file descriptor of an >> existing VM by doing something like : >> >> kvm_fd =3D open("/dev/kvm") >> ... >> b =3D ioctl(KVM_GET_DIRTY_LOG, vm_fd) >> >> >> I also can see, from the API documentation >> (https://www.kernel.org/doc/Documentation/virtual/kvm/api.txt), that >> there is the following restriction concerning VM ioctls : >> >> "Only run VM ioctls from the same process (address space) that was u= sed >> to create the VM." >> >> >> Is there a way to get the fd of a running VM (created from an other >> process), or maybe a better/easier manner to get the dirty bitmap ? >=20 > You can get ask the other process to retrieve the dirty bitmap and pl= ace > it in a shared memory segment. >=20 > However, note that KVM_GET_DIRTY_LOG retrieves _and clears_ the dirty > bitmap. So if the "owner" of the running VM is already using the dir= ty > bitmap, calling KVM_GET_DIRTY_LOG will likely break that usage. Thank you for your reply ! I take note of your remark about the bitmap clearing, it could be an effective issue. But I really have no idea of how can I 'ask' something the other proces= s ? Regards. --=20 Vincent KHERBACHE