[v1] virtio-mem: fix cross-compilation due to VIRTIO_MEM_USABLE_EXTENT
diff mbox series

Message ID 20200703104027.30441-1-david@redhat.com
State New
Headers show
Series
  • [v1] virtio-mem: fix cross-compilation due to VIRTIO_MEM_USABLE_EXTENT
Related show

Commit Message

David Hildenbrand July 3, 2020, 10:40 a.m. UTC
The usable extend depends on the target, not on the destination. This
fixes cross-compilation on other architectures than x86-64.

Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Cc: Pankaj Gupta <pankaj.gupta.linux@gmail.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
---
 hw/virtio/virtio-mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael S. Tsirkin July 3, 2020, 11:57 a.m. UTC | #1
On Fri, Jul 03, 2020 at 12:40:27PM +0200, David Hildenbrand wrote:
> The usable extend depends on the target, not on the destination. This
> fixes cross-compilation on other architectures than x86-64.
> 
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Cc: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> Cc: Pankaj Gupta <pankaj.gupta.linux@gmail.com>
> Signed-off-by: David Hildenbrand <david@redhat.com>

I folded this into 890f95d1adc8e0cb9fe88f74d1b76aad6d2763d6.
Thanks!

> ---
>  hw/virtio/virtio-mem.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c
> index bf9b414522..65850530e7 100644
> --- a/hw/virtio/virtio-mem.c
> +++ b/hw/virtio/virtio-mem.c
> @@ -51,7 +51,7 @@
>   * necessary (as the section size can change). But it's more likely that the
>   * section size will rather get smaller and not bigger over time.
>   */
> -#if defined(__x86_64__)
> +#if defined(TARGET_X86_64) || defined(TARGET_I386)
>  #define VIRTIO_MEM_USABLE_EXTENT (2 * (128 * MiB))
>  #else
>  #error VIRTIO_MEM_USABLE_EXTENT not defined
> -- 
> 2.26.2

Patch
diff mbox series

diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c
index bf9b414522..65850530e7 100644
--- a/hw/virtio/virtio-mem.c
+++ b/hw/virtio/virtio-mem.c
@@ -51,7 +51,7 @@ 
  * necessary (as the section size can change). But it's more likely that the
  * section size will rather get smaller and not bigger over time.
  */
-#if defined(__x86_64__)
+#if defined(TARGET_X86_64) || defined(TARGET_I386)
 #define VIRTIO_MEM_USABLE_EXTENT (2 * (128 * MiB))
 #else
 #error VIRTIO_MEM_USABLE_EXTENT not defined