Re: [Qemu-devel] [PATCH 2/2] Add AT24Cxx I2C EEPROM device model

2012-11-20 Thread Jan Kiszka
On 2012-11-20 15:40, Stefan Hajnoczi wrote: > On Tue, Nov 20, 2012 at 3:38 PM, Jan Kiszka wrote: >> On 2012-11-20 15:06, Stefan Hajnoczi wrote: >>> On Tue, Nov 20, 2012 at 02:37:07PM +0100, Jan Kiszka wrote: On 2012-11-20 14:27, Stefan Hajnoczi wrote: > On Mon, Nov 19, 2012 at 03:24:39PM

Re: [Qemu-devel] [PATCH 2/2] Add AT24Cxx I2C EEPROM device model

2012-11-20 Thread Stefan Hajnoczi
On Tue, Nov 20, 2012 at 3:38 PM, Jan Kiszka wrote: > On 2012-11-20 15:06, Stefan Hajnoczi wrote: >> On Tue, Nov 20, 2012 at 02:37:07PM +0100, Jan Kiszka wrote: >>> On 2012-11-20 14:27, Stefan Hajnoczi wrote: On Mon, Nov 19, 2012 at 03:24:39PM +0100, Jan Kiszka wrote: > +static void at24_f

Re: [Qemu-devel] [PATCH 2/2] Add AT24Cxx I2C EEPROM device model

2012-11-20 Thread Jan Kiszka
On 2012-11-20 15:06, Stefan Hajnoczi wrote: > On Tue, Nov 20, 2012 at 02:37:07PM +0100, Jan Kiszka wrote: >> On 2012-11-20 14:27, Stefan Hajnoczi wrote: >>> On Mon, Nov 19, 2012 at 03:24:39PM +0100, Jan Kiszka wrote: +static void at24_flush_transfer_buffer(AT24State *s) +{ +if (s

Re: [Qemu-devel] [PATCH 2/2] Add AT24Cxx I2C EEPROM device model

2012-11-20 Thread Stefan Hajnoczi
On Tue, Nov 20, 2012 at 02:37:07PM +0100, Jan Kiszka wrote: > On 2012-11-20 14:27, Stefan Hajnoczi wrote: > > On Mon, Nov 19, 2012 at 03:24:39PM +0100, Jan Kiszka wrote: > >> +static void at24_flush_transfer_buffer(AT24State *s) > >> +{ > >> +if (s->cached_sector < 0 || !s->cache_dirty) { > >>

Re: [Qemu-devel] [PATCH 2/2] Add AT24Cxx I2C EEPROM device model

2012-11-20 Thread Jan Kiszka
On 2012-11-20 14:27, Stefan Hajnoczi wrote: > On Mon, Nov 19, 2012 at 03:24:39PM +0100, Jan Kiszka wrote: >> +static void at24_flush_transfer_buffer(AT24State *s) >> +{ >> +if (s->cached_sector < 0 || !s->cache_dirty) { >> +return; >> +} >> +bdrv_write(s->bs, s->cached_sector, s

Re: [Qemu-devel] [PATCH 2/2] Add AT24Cxx I2C EEPROM device model

2012-11-20 Thread Stefan Hajnoczi
On Mon, Nov 19, 2012 at 03:24:39PM +0100, Jan Kiszka wrote: > +static void at24_flush_transfer_buffer(AT24State *s) > +{ > +if (s->cached_sector < 0 || !s->cache_dirty) { > +return; > +} > +bdrv_write(s->bs, s->cached_sector, s->sector_buffer, 1); [...] > +static int at24_cache_

[Qemu-devel] [PATCH 2/2] Add AT24Cxx I2C EEPROM device model

2012-11-19 Thread Jan Kiszka
This implements I2C EEPROMs of the AT24Cxx series. Sizes from 1Kbit to 1024Kbit are supported. Each EEPROM is backed by a block device. Its size can be explicitly specified by the "size" property (required for sizes < 512, the blockdev sector size) or is derived from the size of the backing block d