From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCHv3 11/14] Add bootindex parameter to net/block/fd device Date: Wed, 10 Nov 2010 20:48:59 +0200 Message-ID: <20101110184858.GD6798@redhat.com> References: <1289409261-5418-1-git-send-email-gleb@redhat.com> <1289409261-5418-12-git-send-email-gleb@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, armbru@redhat.com, alex.williamson@redhat.com, mst@redhat.com To: Blue Swirl Return-path: Received: from mx1.redhat.com ([209.132.183.28]:64891 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752463Ab0KJStE convert rfc822-to-8bit (ORCPT ); Wed, 10 Nov 2010 13:49:04 -0500 Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Nov 10, 2010 at 06:32:54PM +0000, Blue Swirl wrote: > On Wed, Nov 10, 2010 at 5:14 PM, Gleb Natapov wrote= : > > If bootindex is specified on command line a string that describes d= evice > > in firmware readable way is added into sorted list. Later this list= will > > be passed into firmware to control boot order. > > > > Signed-off-by: Gleb Natapov > > --- > > =9Ablock_int.h =9A =9A | =9A =9A4 +++- > > =9Ahw/e1000.c =9A =9A =9A| =9A =9A7 +++++++ > > =9Ahw/eepro100.c =9A | =9A =9A6 ++++++ > > =9Ahw/fdc.c =9A =9A =9A =9A| =9A 13 +++++++++++++ > > =9Ahw/ide/qdev.c =9A | =9A =9A7 +++++++ > > =9Ahw/ne2000.c =9A =9A | =9A =9A6 ++++++ > > =9Ahw/pcnet.c =9A =9A =9A| =9A =9A6 ++++++ > > =9Ahw/qdev.c =9A =9A =9A | =9A 32 ++++++++++++++++++++++++++++++++ > > =9Ahw/qdev.h =9A =9A =9A | =9A =9A1 + > > =9Ahw/rtl8139.c =9A =9A| =9A =9A7 +++++++ > > =9Ahw/usb-net.c =9A =9A| =9A =9A4 ++++ > > =9Ahw/virtio-blk.c | =9A =9A4 ++++ > > =9Ahw/virtio-net.c | =9A =9A4 ++++ > > =9Anet.h =9A =9A =9A =9A =9A | =9A =9A4 +++- > > =9Asysemu.h =9A =9A =9A =9A| =9A =9A2 ++ > > =9Avl.c =9A =9A =9A =9A =9A =9A| =9A 35 +++++++++++++++++++++++++++= ++++++++ > > =9A16 files changed, 140 insertions(+), 2 deletions(-) > > > > diff --git a/block_int.h b/block_int.h > > index 87e60b8..f9042a8 100644 > > --- a/block_int.h > > +++ b/block_int.h > > @@ -227,6 +227,7 @@ typedef struct BlockConf { > > =9A =9A uint16_t logical_block_size; > > =9A =9A uint16_t min_io_size; > > =9A =9A uint32_t opt_io_size; > > + =9A =9Aint32_t bootindex; > > =9A} BlockConf; > > > > =9Astatic inline unsigned int get_physical_block_exp(BlockConf *con= f) > > @@ -249,6 +250,7 @@ static inline unsigned int get_physical_block_e= xp(BlockConf *conf) > > =9A =9A DEFINE_PROP_UINT16("physical_block_size", _state, =9A =9A =9A= =9A =9A =9A =9A =9A =9A \ > > =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A_conf.physical_block= _size, 512), =9A =9A =9A =9A =9A =9A =9A =9A \ > > =9A =9A DEFINE_PROP_UINT16("min_io_size", _state, _conf.min_io_size= , 0), =9A\ > > - =9A =9ADEFINE_PROP_UINT32("opt_io_size", _state, _conf.opt_io_siz= e, 0) > > + =9A =9ADEFINE_PROP_UINT32("opt_io_size", _state, _conf.opt_io_siz= e, 0), =9A =9A\ > > + =9A =9ADEFINE_PROP_INT32("bootindex", _state, _conf.bootindex, -1= ) =9A =9A =9A =9A \ > > > > =9A#endif /* BLOCK_INT_H */ > > diff --git a/hw/e1000.c b/hw/e1000.c > > index 532efdc..009e24b 100644 > > --- a/hw/e1000.c > > +++ b/hw/e1000.c > > @@ -30,6 +30,7 @@ > > =9A#include "net.h" > > =9A#include "net/checksum.h" > > =9A#include "loader.h" > > +#include "sysemu.h" > > > > =9A#include "e1000_hw.h" > > > > @@ -1148,6 +1149,12 @@ static int pci_e1000_init(PCIDevice *pci_dev= ) > > =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A d->dev.qdev.inf= o->name, d->dev.qdev.id, d); > > > > =9A =9A qemu_format_nic_info_str(&d->nic->nc, macaddr); > > + > > + =9A =9Aif (d->conf.bootindex >=3D 0) { >=20 > Maybe these checks should be moved into add_boot_device_path, that > would simplify the callers. Yep, good point. -- Gleb.