Patchwork Support T/t for guest memory sizes

login
register
mail settings
Submitter Jes Sorensen
Date Sept. 14, 2010, 1:37 p.m.
Message ID <1284471474-24989-1-git-send-email-Jes.Sorensen@redhat.com>
Download mbox | patch
Permalink /patch/64701/
State New
Headers show

Comments

Jes Sorensen - Sept. 14, 2010, 1:37 p.m.
From: Jes Sorensen <Jes.Sorensen@redhat.com>

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
 vl.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
Anthony Liguori - Sept. 14, 2010, 2 p.m.
On 09/14/2010 08:37 AM, Jes.Sorensen@redhat.com wrote:
> From: Jes Sorensen<Jes.Sorensen@redhat.com>
>
> Signed-off-by: Jes Sorensen<Jes.Sorensen@redhat.com>
>    

anthony@titi:~/git/qemu$ grep "case 'G': case 'g':" *.c
monitor.c:                    case 'G': case 'g':
vl.c:            case 'G': case 'g':
vl.c:                case 'G': case 'g':

So there's more locations to fixup.  But while you're touching this 
code, it probably makes sense to add a str_to_bytes() function to 
cutils.c to make sure we accept things consistently for the future.

Regards,

Anthony Liguori


> ---
>   vl.c |    3 +++
>   1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/vl.c b/vl.c
> index 3f45aa9..0663f2f 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -2176,6 +2176,9 @@ int main(int argc, char **argv, char **envp)
>                   case 'G': case 'g':
>                       value<<= 30;
>                       break;
> +                case 'T': case 't':
> +                    value<<= 40;
> +                    break;
>                   default:
>                       fprintf(stderr, "qemu: invalid ram size: %s\n", optarg);
>                       exit(1);
>
Jes Sorensen - Sept. 14, 2010, 2:41 p.m.
On 09/14/10 16:00, Anthony Liguori wrote:
> On 09/14/2010 08:37 AM, Jes.Sorensen@redhat.com wrote:
>> From: Jes Sorensen<Jes.Sorensen@redhat.com>
>>
>> Signed-off-by: Jes Sorensen<Jes.Sorensen@redhat.com>
>>    
> 
> anthony@titi:~/git/qemu$ grep "case 'G': case 'g':" *.c
> monitor.c:                    case 'G': case 'g':
> vl.c:            case 'G': case 'g':
> vl.c:                case 'G': case 'g':
> 
> So there's more locations to fixup.  But while you're touching this
> code, it probably makes sense to add a str_to_bytes() function to
> cutils.c to make sure we accept things consistently for the future.

Fair enough, I'll have a look.

Cheers,
Jes

Patch

diff --git a/vl.c b/vl.c
index 3f45aa9..0663f2f 100644
--- a/vl.c
+++ b/vl.c
@@ -2176,6 +2176,9 @@  int main(int argc, char **argv, char **envp)
                 case 'G': case 'g':
                     value <<= 30;
                     break;
+                case 'T': case 't':
+                    value <<= 40;
+                    break;
                 default:
                     fprintf(stderr, "qemu: invalid ram size: %s\n", optarg);
                     exit(1);