[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] CMOS file support
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH] CMOS file support |
Date: |
Fri, 17 Sep 2010 12:44:39 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.12) Gecko/20100907 Fedora/3.0.7-1.fc12 Thunderbird/3.0.7 |
Hi Mathias,
Am 17.09.2010 08:42, schrieb Mathias Krause:
>> Using QEMU's block devices instead of a simple file would be
>> more consistent with the rest of QEMU and allow reading the
>> CMOS data not only from a file but also from an URL or other
>> sources.
>
> Thanks for the hint. Since this is my first contribution to the project
> I'm not that familiar with the code. Looking at other places, e.g. how
> the -kernel option gets handled, I just see FILE everywhere. Can you
> give me some pointers how to use this interface?
Have a look at block.h which contains the prototypes for the public
block layer interface.
Basically, you need to create a BlockDriverState with bdrv_new() and
then open it with bdrv_open(). You'll want to specify the raw block
driver for opening the image, you get it with bdrv_find_format("raw").
bdrv_pread/pwrite are the right functions to access the file with byte
granularity (other functions work on 512 byte sectors). bdrv_delete
frees the the BlockDriverState when you're done.
HTH,
Kevin
Re: [Qemu-devel] [PATCH] CMOS file support, Anthony Liguori, 2010/09/16