Patchwork [4/7] hw/net/virtio-balloon: use virtio wrappers to access page frame numbers.

login
register
mail settings
Submitter Rusty Russell
Date Aug. 8, 2013, 5:15 a.m.
Message ID <1375938949-22622-5-git-send-email-rusty@rustcorp.com.au>
Download mbox | patch
Permalink /patch/265650/
State New
Headers show

Comments

Rusty Russell - Aug. 8, 2013, 5:15 a.m.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
 hw/virtio/virtio-balloon.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Anthony Liguori - Aug. 8, 2013, 1:32 p.m.
Rusty Russell <rusty@rustcorp.com.au> writes:

> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>

Regards,

Anthony Liguori

> ---
>  hw/virtio/virtio-balloon.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
> index d669756..c0b4f6e 100644
> --- a/hw/virtio/virtio-balloon.c
> +++ b/hw/virtio/virtio-balloon.c
> @@ -30,6 +30,7 @@
>  #endif
>  
>  #include "hw/virtio/virtio-bus.h"
> +#include "hw/virtio/virtio-access.h"
>  
>  static void balloon_page(void *addr, int deflate)
>  {
> @@ -192,7 +193,7 @@ static void virtio_balloon_handle_output(VirtIODevice *vdev, VirtQueue *vq)
>              ram_addr_t pa;
>              ram_addr_t addr;
>  
> -            pa = (ram_addr_t)ldl_p(&pfn) << VIRTIO_BALLOON_PFN_SHIFT;
> +            pa = (ram_addr_t)virtio_ldl_p(&pfn) << VIRTIO_BALLOON_PFN_SHIFT;
>              offset += 4;
>  
>              /* FIXME: remove get_system_memory(), but how? */
> -- 
> 1.8.1.2

Patch

diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index d669756..c0b4f6e 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -30,6 +30,7 @@ 
 #endif
 
 #include "hw/virtio/virtio-bus.h"
+#include "hw/virtio/virtio-access.h"
 
 static void balloon_page(void *addr, int deflate)
 {
@@ -192,7 +193,7 @@  static void virtio_balloon_handle_output(VirtIODevice *vdev, VirtQueue *vq)
             ram_addr_t pa;
             ram_addr_t addr;
 
-            pa = (ram_addr_t)ldl_p(&pfn) << VIRTIO_BALLOON_PFN_SHIFT;
+            pa = (ram_addr_t)virtio_ldl_p(&pfn) << VIRTIO_BALLOON_PFN_SHIFT;
             offset += 4;
 
             /* FIXME: remove get_system_memory(), but how? */