Re: [PATCH 3/4] kvm tools: Add a void ptr to be passed to mmio callback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux