public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Sasha Levin <levinsasha928@gmail.com>
Cc: penberg@kernel.org, kvm@vger.kernel.org, mingo@elte.hu,
	asias.hejun@gmail.com, prasadjoshi124@gmail.com
Subject: Re: [PATCH 3/4] kvm tools: Add a void ptr to be passed to mmio callback
Date: Thu, 28 Jul 2011 13:42:41 +0400	[thread overview]
Message-ID: <20110728094241.GK27137@sun> (raw)
In-Reply-To: <1311843715-5464-3-git-send-email-levinsasha928@gmail.com>

On Thu, Jul 28, 2011 at 12:01:54PM +0300, Sasha Levin wrote:
...
>  
>  struct mmio_mapping {
>  	struct rb_int_node	node;
> -	void			(*kvm_mmio_callback_fn)(u64 addr, u8 *data, u32 len, u8 is_write);
> +	void			(*kvm_mmio_callback_fn)(u64 addr, u8 *data, u32 len, u8 is_write, void *ptr);
> +	void			*ptr;
>  };

I guess no need to name it *that* long, probably simple

struct mmio_mapping {
	struct rb_int_node	node;
	void			(*mmio_fn)(u64 addr, u8 *data, u32 len, u8 is_write, void *ptr);
	void			*ptr;
};
...
>  
>  	if (mmio)
> -		mmio->kvm_mmio_callback_fn(phys_addr, data, len, is_write);
> +		mmio->kvm_mmio_callback_fn(phys_addr, data, len, is_write, mmio->ptr);

So this would be

	if (mmio)
		mmio->mmio_fn(phys_addr, data, len, is_write, mmio->ptr);

no?

	Cyrill

  reply	other threads:[~2011-07-28  9:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-28  9:01 [PATCH 1/4] kvm tools: Use GSI routing Sasha Levin
2011-07-28  9:01 ` [PATCH 2/4] kvm tools: Fix PCI probing Sasha Levin
2011-07-28  9:31   ` Pekka Enberg
2011-07-28  9:38     ` Cyrill Gorcunov
2011-07-28  9:43       ` Pekka Enberg
2011-07-28  9:01 ` [PATCH 3/4] kvm tools: Add a void ptr to be passed to mmio callback Sasha Levin
2011-07-28  9:42   ` Cyrill Gorcunov [this message]
2011-07-28  9:43     ` Pekka Enberg
2011-07-28  9:01 ` [PATCH 4/4] kvm tools: Implement MSI-X for virtio-rng Sasha Levin
2011-07-28  9:33   ` Pekka Enberg
2011-07-28  9:27 ` [PATCH 1/4] kvm tools: Use GSI routing Pekka Enberg
2011-07-28  9:43 ` Cyrill Gorcunov

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=20110728094241.GK27137@sun \
    --to=gorcunov@gmail.com \
    --cc=asias.hejun@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=levinsasha928@gmail.com \
    --cc=mingo@elte.hu \
    --cc=penberg@kernel.org \
    --cc=prasadjoshi124@gmail.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