qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC v1 10/22] vfio: use new MEMORY_LISTENER_DEFAULT_OP


From: Alex Williamson
Subject: Re: [Qemu-devel] [RFC v1 10/22] vfio: use new MEMORY_LISTENER_DEFAULT_OPS
Date: Thu, 04 Oct 2012 09:45:07 -0600

On Wed, 2012-10-03 at 18:03 +0200, Avi Kivity wrote:
> Removes quite a bit of useless code.
> 
> Signed-off-by: Avi Kivity <address@hidden>
> ---
>  hw/vfio_pci.c | 30 +-----------------------------
>  1 file changed, 1 insertion(+), 29 deletions(-)
> 
> diff --git a/hw/vfio_pci.c b/hw/vfio_pci.c
> index a1eeced..8e49535 100644
> --- a/hw/vfio_pci.c
> +++ b/hw/vfio_pci.c
> @@ -803,25 +803,6 @@ static int vfio_dma_unmap(VFIOContainer *container,
>      return 0;
>  }
>  
> -static void vfio_listener_dummy1(MemoryListener *listener)
> -{
> -    /* We don't do batching (begin/commit) or care about logging */
> -}
> -
> -static void vfio_listener_dummy2(MemoryListener *listener,
> -                                 MemoryRegionSection *section)
> -{
> -    /* We don't do logging or care about nops */
> -}
> -
> -static void vfio_listener_dummy3(MemoryListener *listener,
> -                                 MemoryRegionSection *section,
> -                                 bool match_data, uint64_t data,
> -                                 EventNotifier *e)
> -{
> -    /* We don't care about eventfds */
> -}
> -
>  static bool vfio_listener_skipped_section(MemoryRegionSection *section)
>  {
>      return !memory_region_is_ram(section->mr);
> @@ -913,18 +894,9 @@ static void vfio_listener_region_del(MemoryListener 
> *listener,
>  }
>  
>  static MemoryListener vfio_memory_listener = {
> -    .begin = vfio_listener_dummy1,
> -    .commit = vfio_listener_dummy1,
> +    MEMORY_LISTENER_DEFAULT_OPS,
>      .region_add = vfio_listener_region_add,
>      .region_del = vfio_listener_region_del,
> -    .region_nop = vfio_listener_dummy2,
> -    .log_start = vfio_listener_dummy2,
> -    .log_stop = vfio_listener_dummy2,
> -    .log_sync = vfio_listener_dummy2,
> -    .log_global_start = vfio_listener_dummy1,
> -    .log_global_stop = vfio_listener_dummy1,
> -    .eventfd_add = vfio_listener_dummy3,
> -    .eventfd_del = vfio_listener_dummy3,
>  };
>  
>  static void vfio_listener_release(VFIOContainer *container)

I'm happy to see this cleanup.  Thanks

Acked-by: Alex Williamson <address@hidden>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]