Hello, On Wed, Jun 3, 2015 at 11:45 PM, Alexander Graf <ag...@suse.de> wrote: > From: Nikunj A Dadhania <nik...@linux.vnet.ibm.com> > > 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 <nik...@linux.vnet.ibm.com> > Reviewed-by: Thomas Huth <th...@redhat.com> > Reviewed-by: David Gibson <da...@gibson.dropbear.id.au> > Acked-by: Paolo Bonzini <pbonz...@redhat.com> > Signed-off-by: David Gibson <da...@gibson.dropbear.id.au> > Signed-off-by: Alexander Graf <ag...@suse.de> > --- > 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