From: Vincent KHERBACHE <vincent.kherbache@inria.fr>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org
Subject: Re: Get a vm fd using kvm API's ioctls
Date: Wed, 05 Feb 2014 18:17:16 +0100 [thread overview]
Message-ID: <52F2721C.10806@inria.fr> (raw)
In-Reply-To: <52F26C57.5080409@redhat.com>
Le 05/02/2014 17:52, Paolo Bonzini a écrit :
> 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 = open("/dev/kvm")
>> ...
>> b = 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 used
>> 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 ?
>
> You can get ask the other process to retrieve the dirty bitmap and place
> it in a shared memory segment.
>
> 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 dirty
> 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 process ?
Regards.
--
Vincent KHERBACHE
next prev parent reply other threads:[~2014-02-05 17:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-05 16:30 Get a vm fd using kvm API's ioctls Vincent KHERBACHE
2014-02-05 16:52 ` Paolo Bonzini
2014-02-05 17:17 ` Vincent KHERBACHE [this message]
2014-02-05 17:19 ` Paolo Bonzini
2014-02-05 18:46 ` Vincent KHERBACHE
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52F2721C.10806@inria.fr \
--to=vincent.kherbache@inria.fr \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox