From: Gleb Natapov <gleb@redhat.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>, kvm <kvm@vger.kernel.org>,
qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [PATCH][QEMU] vmxcap: Open MSR file in unbuffered mode
Date: Thu, 14 Feb 2013 09:55:56 +0200 [thread overview]
Message-ID: <20130214075556.GH9817@redhat.com> (raw)
In-Reply-To: <511B7C4E.8070403@siemens.com>
On Wed, Feb 13, 2013 at 12:43:10PM +0100, Jan Kiszka wrote:
> Python may otherwise decide to to read larger chunks, applying the seek
> only on the software buffer. This will return results from the wrong
> MSRs.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Applied, thanks.
> ---
> scripts/kvm/vmxcap | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/kvm/vmxcap b/scripts/kvm/vmxcap
> index 0b23f77..6363e73 100755
> --- a/scripts/kvm/vmxcap
> +++ b/scripts/kvm/vmxcap
> @@ -27,9 +27,9 @@ MSR_IA32_VMX_VMFUNC = 0x491
> class msr(object):
> def __init__(self):
> try:
> - self.f = file('/dev/cpu/0/msr')
> + self.f = open('/dev/cpu/0/msr', 'r', 0)
> except:
> - self.f = file('/dev/msr0')
> + self.f = open('/dev/msr0', 'r', 0)
> def read(self, index, default = None):
> import struct
> self.f.seek(index)
> --
> 1.7.3.4
--
Gleb.
next prev parent reply other threads:[~2013-02-14 7:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-13 11:43 [PATCH][QEMU] vmxcap: Open MSR file in unbuffered mode Jan Kiszka
2013-02-14 7:55 ` Gleb Natapov [this message]
2013-02-14 10:25 ` [Qemu-devel] " Andreas Färber
2013-02-14 12:02 ` Gleb Natapov
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=20130214075556.GH9817@redhat.com \
--to=gleb@redhat.com \
--cc=jan.kiszka@siemens.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=qemu-devel@nongnu.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.