From: Avi Kivity <avi@qumranet.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm-devel@lists.sourceforge.net
Subject: Re: [patch 2/4] QEMU/KVM: get/set mpstate libkvm interface
Date: Fri, 11 Apr 2008 03:21:27 +0300 [thread overview]
Message-ID: <47FEAF07.10404@qumranet.com> (raw)
In-Reply-To: <20080407203324.095878017@localhost.localdomain>
Marcelo Tosatti wrote:
> Add libkvm interface to get/set the mpstate.
>
> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
>
> Index: marcelo/git/kvm-userspace.io/libkvm/libkvm.c
> ===================================================================
> --- marcelo.orig/git/kvm-userspace.io/libkvm/libkvm.c
> +++ marcelo/git/kvm-userspace.io/libkvm/libkvm.c
> @@ -776,6 +776,32 @@ int kvm_set_sregs(kvm_context_t kvm, int
> return ioctl(kvm->vcpu_fd[vcpu], KVM_SET_SREGS, sregs);
> }
>
> +int kvm_get_mpstate(kvm_context_t kvm, int vcpu, int *mpstate)
> +{
> + int r;
> +
> +#ifdef KVM_CAP_MP_STATE
> + r = ioctl(kvm->fd, KVM_CHECK_EXTENSION, KVM_CAP_MP_STATE);
> + if (r > 0)
> + return ioctl(kvm->vcpu_fd[vcpu], KVM_GET_MP_STATE, mpstate);
> +#endif
> + return -1;
> +}
>
We usually follow the convention of returning -errno in case of error
instead of -1 in libkvm.
--
Any sufficiently difficult bug is indistinguishable from a feature.
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
next prev parent reply other threads:[~2008-04-11 0:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-07 20:30 [patch 0/4] fix SMP migration and loadvm/savevm (V2) Marcelo Tosatti
2008-04-07 20:30 ` [patch 1/4] QEMU/KVM: properly copy the in-kernel apicbase value Marcelo Tosatti
2008-04-07 20:30 ` [patch 2/4] QEMU/KVM: get/set mpstate libkvm interface Marcelo Tosatti
2008-04-11 0:21 ` Avi Kivity [this message]
2008-04-07 20:30 ` [patch 3/4] QEMU/KVM: save and load mp state Marcelo Tosatti
2008-04-07 20:30 ` [patch 4/4] QEMU/KVM: ignore SIG_IPI signals in userspace Marcelo Tosatti
2008-04-08 21:59 ` [patch 0/4] fix SMP migration and loadvm/savevm (V2) Avi Kivity
2008-04-09 0:29 ` Marcelo Tosatti
2008-04-11 0:05 ` Avi Kivity
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=47FEAF07.10404@qumranet.com \
--to=avi@qumranet.com \
--cc=kvm-devel@lists.sourceforge.net \
--cc=mtosatti@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