qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Glauber Costa <glommer@redhat.com>
Cc: aliguori@us.ibm.com, Marcelo Tosatti <mtosatti@redhat.com>,
	qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH] Use msr list to load and save msrs
Date: Tue, 27 Oct 2009 12:01:59 +0200	[thread overview]
Message-ID: <4AE6C517.10806@redhat.com> (raw)
In-Reply-To: <1256581565-20684-1-git-send-email-glommer@redhat.com>

On 10/26/2009 08:26 PM, Glauber Costa wrote:
> +
> +    kvm_msr_list = kvm_get_msr_list(env);
> +    if (!kvm_msr_list) {
> +        printf("FAILED\n");
> +        return -1;
> +    }
> +
> +    msr_data.info.nmsrs = kvm_msr_list->nmsrs;
> +
> +    for (i = 0; i<  kvm_msr_list->nmsrs; i++) {
> +        uint64_t *data = kvm_get_msr_data_addr(env, kvm_msr_list->indices[i]);
> +        msrs[i].index = kvm_msr_list->indices[i];
> +        if (data != NULL) {
> +            msrs[i].data = *data;
> +        }
> +    }
>
>       return kvm_vcpu_ioctl(env, KVM_SET_MSRS,&msr_data);
>
>    

Aren't you leaking the msr list structure?

Best to get it once during setup and reuse it later.

-- 
error compiling committee.c: too many arguments to function

  reply	other threads:[~2009-10-27 10:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-26 18:26 [Qemu-devel] [PATCH] Use msr list to load and save msrs Glauber Costa
2009-10-27 10:01 ` Avi Kivity [this message]
2009-10-27 10:19   ` [Qemu-devel] " Glauber Costa
2009-10-27 10:25     ` Avi Kivity
2009-10-27 10:32       ` Glauber Costa

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=4AE6C517.10806@redhat.com \
    --to=avi@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=glommer@redhat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).