On Tue, Oct 09, 2007 at 05:09:19PM -0500, Anthony Liguori wrote:

> >>+                   default:
> >>+                           fprintf(stderr,
> >>+                                   "Unrecongized memory suffix: %c\n",
> >>+                                   *endptr);
> >>+                           exit(1);
> >>+                   }
> >>+                   break;
> >>    
> >
> >How about adding a sanity check that memory_size makes sense here
> >rather than having kvm_create() fail obscurely? For example if the
> >user got the memory size wrong for some reason we'll end up with
> >memory_size = 0 here.
> 
> There's an exit(1) and it's using stroull() so the only way that
> memory_size could equal 0 is if the user specified --memory=0.  I'm

Or made a mistake and specified memory=G, or memory=100G when he meant
100M, etc.

> not sure I agree it's worth checking for that sort of circumstance,
> perhaps the user had a reason for doing it?

I'm a fan of the principle of least surprise.

Cheers,
Muli
-- 
SYSTOR 2007 --- 1st Annual Haifa Systems and Storage Conference 2007
http://www.haifa.il.ibm.com/Workshops/systor2007/

Virtualization workshop: Oct 29th, 2007 | Storage workshop: Oct 30th, 2007

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to