[Ovirt-devel] [PATCH]: Add host memory in kb to the database

Scott Seago sseago at redhat.com
Mon Aug 11 15:30:01 UTC 2008


Steve Linabery wrote:
> On Mon, Aug 11, 2008 at 10:54:19AM -0400, Scott Seago wrote:  
>   
>> Well the attribute doesn't exist, but as mentioned above, there's a  
>> method with this name that sets the proper memory value (assuming what  
>> you have is in megabytes).
>>     
>
> For the record, there is only memory_in_mb= that does what you describe here (but which doesn't work for initializing a new instance).
>
>   
It actually works fine for initializing an instance:

irb(main):045:0> foo = Host.new(:hostname=>"foo", :memory_in_mb=>256)
=> #<Host id: nil, uuid: nil, hypervisor_type: nil, hostname: "foo", 
arch: nil, memory: 262144, is_disabled: nil, hardware_pool_id: nil, 
state: nil, load_average: nil, created_at: nil, updated_at: nil>
irb(main):046:0> foo.memory_in_mb
=> 256
irb(main):047:0> foo.memory
=> 262144

But again, in this instance we don't want the conversion happening.

Scott




More information about the ovirt-devel mailing list