qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PULL 34/40] machine: add default_ram_size to machine c


From: Laurent Desnogues
Subject: Re: [Qemu-devel] [PULL 34/40] machine: add default_ram_size to machine class
Date: Fri, 5 Jun 2015 09:27:18 +0200

Hello,

On Wed, Jun 3, 2015 at 11:45 PM, Alexander Graf <address@hidden> wrote:
> From: Nikunj A Dadhania <address@hidden>
>
> Machines types can have different requirement for default ram
> size. Introduce a member in the machine class and set the current
> default_ram_size to 128MB.
>
> For QEMUMachine types override the value during the registration of
> the machine and for MachineClass introduce the generic class init
> setting the default_ram_size.
>
> Add helpers [K,M,G,T,P,E]_BYTE for better readability and easy usage
>
> Signed-off-by: Nikunj A Dadhania <address@hidden>
> Reviewed-by: Thomas Huth <address@hidden>
> Reviewed-by: David Gibson <address@hidden>
> Acked-by: Paolo Bonzini <address@hidden>
> Signed-off-by: David Gibson <address@hidden>
> Signed-off-by: Alexander Graf <address@hidden>
> ---
>  hw/core/machine.c     |  9 +++++++++
>  include/hw/boards.h   |  1 +
>  include/qemu-common.h |  6 ++++++
>  vl.c                  | 30 ++++++++++++++++--------------
>  4 files changed, 32 insertions(+), 14 deletions(-)
>
[...]
> diff --git a/include/qemu-common.h b/include/qemu-common.h
> index 6b373ff..d52d09c 100644
> --- a/include/qemu-common.h
> +++ b/include/qemu-common.h
> @@ -186,6 +186,12 @@ int64_t strtosz(const char *nptr, char **end);
>  int64_t strtosz_suffix(const char *nptr, char **end, const char 
> default_suffix);
>  int64_t strtosz_suffix_unit(const char *nptr, char **end,
>                              const char default_suffix, int64_t unit);
> +#define K_BYTE     (1ULL << 10)
> +#define M_BYTE     (1ULL << 20)
> +#define G_BYTE     (1ULL << 30)
> +#define T_BYTE     (1ULL << 40)
> +#define P_BYTE     (1ULL << 50)
> +#define E_BYTE     (1ULL << 60)
>
>  /* used to print char* safely */
>  #define STR_OR_NULL(str) ((str) ? (str) : "null")
> diff --git a/vl.c b/vl.c
> index 1d4c089..6c7e4e4 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -120,8 +120,6 @@ int main(int argc, char **argv)
>  #include "qom/object_interfaces.h"
>  #include "qapi-event.h"
>
> -#define DEFAULT_RAM_SIZE 128

This define is still used in qemu-options.hx.  We now get this out of "qemu -h":

-m[emory] [size=]megs[,slots=n,maxmem=size]
                configure guest RAM
                size: initial amount of guest memory (default:
DEFAULT_RAM_SIZEMiB)
                slots: number of hotplug slots (default: none)
                maxmem: maximum amount of guest memory (default: none)

Thanks,

Laurent



reply via email to

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