public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Pekka Enberg <penberg@kernel.org>
To: Sasha Levin <levinsasha928@gmail.com>
Cc: john@jfloren.net, kvm@vger.kernel.org, mingo@elte.hu,
	asias.hejun@gmail.com, gorcunov@gmail.com,
	prasadjoshi124@gmail.com
Subject: Re: [PATCH v2 1/8] kvm tools: Add optional parameter used in ioport callbacks
Date: Thu, 26 May 2011 11:53:29 +0300	[thread overview]
Message-ID: <1306400009.16757.118.camel@jaguar> (raw)
In-Reply-To: <1306392135-16993-1-git-send-email-levinsasha928@gmail.com>

On Thu, 2011-05-26 at 09:42 +0300, Sasha Levin wrote:
> Allow specifying an optional parameter when registering an
> ioport range. The callback functions provided by the registering
> module will be called with the same parameter.
> 
> This may be used to keep context during callbacks on IO operations.
> 
> Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
> ---
>  tools/kvm/include/kvm/ioport.h |    3 ++
>  tools/kvm/ioport.c             |   54 +++++++++++++++++++++++++++++----------
>  2 files changed, 43 insertions(+), 14 deletions(-)
> 
> diff --git a/tools/kvm/include/kvm/ioport.h b/tools/kvm/include/kvm/ioport.h
> index 8253938..2a8d74d 100644
> --- a/tools/kvm/include/kvm/ioport.h
> +++ b/tools/kvm/include/kvm/ioport.h
> @@ -25,11 +25,14 @@ struct kvm;
>  struct ioport_operations {
>  	bool (*io_in)(struct kvm *kvm, u16 port, void *data, int size, u32 count);
>  	bool (*io_out)(struct kvm *kvm, u16 port, void *data, int size, u32 count);
> +	bool (*io_in_param)(struct kvm *kvm, u16 port, void *data, int size, u32 count, void *param);
> +	bool (*io_out_param)(struct kvm *kvm, u16 port, void *data, int size, u32 count, void *param);

So why not make that 'param' unconditional for io_in and io_out and just
pass NULL if it's not needed?


  parent reply	other threads:[~2011-05-26  8:53 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-26  6:42 [PATCH v2 1/8] kvm tools: Add optional parameter used in ioport callbacks Sasha Levin
2011-05-26  6:42 ` [PATCH v2 2/8] kvm tools: Add basic ioport dynamic allocation Sasha Levin
2011-05-26  6:42 ` [PATCH v2 3/8] kvm tools: Use ioport context to control blk devices Sasha Levin
2011-05-26  6:42 ` [PATCH v2 4/8] kvm tools: Add support for multiple virtio-rng devices Sasha Levin
2011-05-26  6:42 ` [PATCH v2 5/8] kvm tools: Use dynamic IO port allocation in vesa driver Sasha Levin
2011-05-26  6:42 ` [PATCH v2 6/8] kvm tools: Use dynamic IO port allocation in 9p driver Sasha Levin
2011-05-26  6:42 ` [PATCH v2 7/8] kvm tools: Use dynamic IO port allocation in virtio-console Sasha Levin
2011-05-26  6:42 ` [PATCH v2 8/8] kvm tools: Use dynamic IO port allocation in virtio-net Sasha Levin
2011-05-26  8:53 ` Pekka Enberg [this message]
2011-05-26  9:02   ` [PATCH v2 1/8] kvm tools: Add optional parameter used in ioport callbacks Sasha Levin
2011-05-26  9:04     ` Pekka Enberg
2011-05-26  9:14       ` Sasha Levin
2011-05-26  9:20         ` Pekka Enberg
2011-05-26  9:38           ` Sasha Levin
2011-05-26  9:43             ` Pekka Enberg
2011-05-26  9:49               ` Pekka Enberg

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=1306400009.16757.118.camel@jaguar \
    --to=penberg@kernel.org \
    --cc=asias.hejun@gmail.com \
    --cc=gorcunov@gmail.com \
    --cc=john@jfloren.net \
    --cc=kvm@vger.kernel.org \
    --cc=levinsasha928@gmail.com \
    --cc=mingo@elte.hu \
    --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