qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] CMOS file support


From: Mathias Krause
Subject: Re: [Qemu-devel] [PATCH] CMOS file support
Date: Fri, 17 Sep 2010 08:50:03 +0200
User-agent: Mozilla-Thunderbird 2.0.0.24 (X11/20100328)

Am 16.09.2010 19:20 schrieb Anthony Liguori:
> Instead of using FILE, I'd suggest using a BlockDriver to read and write
> the data.

I'll fix that as soon as I figured how to use this interface.

> I think it would be very nice to add write support too so that writes to
> CMOS were persisted across boots.

Indeed. Also I would like to have a command line interface like '-cmos
cmos.bin' instead of the ugly '-global mc146818rtc.file=cmos.bin'. But
I'm not aware how to create such an alias. Any pointers?

>> +static long get_file_size(FILE *f)
>> +{
>> +    long where, size;
>> +
>> +    /* XXX: on Unix systems, using fstat() probably makes more sense */
>> +
>> +    where = ftell(f);
>> +    fseek(f, 0, SEEK_END);
>> +    size = ftell(f);
>> +    fseek(f, where, SEEK_SET);
>> +
>> +    return size;
>> +}
>>    
> 
> BlockDrivers have a getlength() functions.

Would reduce the size of the patch which is always a good thing (tm).


Mathias



reply via email to

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