qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/2] Add bootindex handling into usb storage device.
@ 2011-01-02 15:04 Gleb Natapov
  2011-01-02 15:04 ` [Qemu-devel] [PATCH 2/2] Add boot index documentation Gleb Natapov
  2011-01-02 15:07 ` [Qemu-devel] [PATCH 1/2] Add bootindex handling into usb storage device Gleb Natapov
  0 siblings, 2 replies; 7+ messages in thread
From: Gleb Natapov @ 2011-01-02 15:04 UTC (permalink / raw)
  To: qemu-devel

---
 hw/usb-msd.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/hw/usb-msd.c b/hw/usb-msd.c
index 0a95d8d..46642a8 100644
--- a/hw/usb-msd.c
+++ b/hw/usb-msd.c
@@ -560,6 +560,7 @@ static int usb_msd_initfn(USBDevice *dev)
         }
     }
 
+    add_boot_device_path(s->conf.bootindex, &dev->qdev, "/disk@0,0");
     return 0;
 }
 
@@ -624,6 +625,7 @@ static USBDevice *usb_msd_init(const char *filename)
 static struct USBDeviceInfo msd_info = {
     .product_desc   = "QEMU USB MSD",
     .qdev.name      = "usb-storage",
+    .qdev.fw_name      = "storage",
     .qdev.size      = sizeof(MSDState),
     .init           = usb_msd_initfn,
     .handle_packet  = usb_generic_handle_packet,
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PATCH 2/2] Add boot index documentation.
  2011-01-02 15:04 [Qemu-devel] [PATCH 1/2] Add bootindex handling into usb storage device Gleb Natapov
@ 2011-01-02 15:04 ` Gleb Natapov
  2011-01-02 15:07 ` [Qemu-devel] [PATCH 1/2] Add bootindex handling into usb storage device Gleb Natapov
  1 sibling, 0 replies; 7+ messages in thread
From: Gleb Natapov @ 2011-01-02 15:04 UTC (permalink / raw)
  To: qemu-devel

---
 docs/bootindex.txt |   42 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 42 insertions(+), 0 deletions(-)
 create mode 100644 docs/bootindex.txt

diff --git a/docs/bootindex.txt b/docs/bootindex.txt
new file mode 100644
index 0000000..9609c7f
--- /dev/null
+++ b/docs/bootindex.txt
@@ -0,0 +1,42 @@
+= Bootindex property =
+
+Block and net devices have bootindex property. This property is used to
+determine the order in which firmware will consider devices for booting
+guest OS. If bootindex property is not set for a device it gets lowest
+boot priority. There is no particular order in which devices with unset
+bootindex property will be considered for booting, but they will still be
+bootable.
+
+== Example ==
+
+Lets assume we have QEMU machine with two NICs (virtio, e1000) and two
+disks (IDE, virtio):
+
+qemu -drive file=disk1.img,if=none,id=disk1
+     -device ide-drive,drive=disk1,bootindex=4
+     -drive file=disk2.img,if=none,id=disk2
+     -device virtio-blk-pci,drive=disk2,bootindex=3
+     -netdev type=user,id=net0 -device virtio-net-pci,netdev=net0,bootindex=2
+     -netdev type=user,id=net1 -device e1000,netdev=net1,bootindex=1
+
+Given command like above firmware should try to boot guest OS from e1000
+NIC if this fails it should try virtio NIC next, if this fails too it
+should try virtio disk and then IDE disk.
+
+== Limitations ==
+
+1. Some firmware has limitation on order in which devices can be
+considered for booting. For instance PC bios boot specification allows
+only one disk to be bootable. If boot from disk fails for some reason
+bios cannot retry booting from other disk. It still can try to boot from
+floppy or net though.
+
+2. Sometimes firmware cannot map device path QEMU wants firmware to boot
+from to boot method. It doesn't happen for devices firmware can natively
+boot from, but if firmware relies on option rom for booting, and same
+option rom is used for booting from more then one device, firmware may
+not be able to ask option rom to boot from particular device reliably.
+For instance with PC bios if scsi HBA has three bootable devices target1,
+target3, target5, connected to it option rom will create boot method for
+each of them, but it is not possible to map boot method back to specific
+target. This is a shortcoming of PC bios boot specification.
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH 1/2] Add bootindex handling into usb storage device.
  2011-01-02 15:04 [Qemu-devel] [PATCH 1/2] Add bootindex handling into usb storage device Gleb Natapov
  2011-01-02 15:04 ` [Qemu-devel] [PATCH 2/2] Add boot index documentation Gleb Natapov
@ 2011-01-02 15:07 ` Gleb Natapov
  1 sibling, 0 replies; 7+ messages in thread
From: Gleb Natapov @ 2011-01-02 15:07 UTC (permalink / raw)
  To: qemu-devel


Please ignore. Will resend with Signed-off-by.

On Sun, Jan 02, 2011 at 05:04:31PM +0200, Gleb Natapov wrote:
> ---
>  hw/usb-msd.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/hw/usb-msd.c b/hw/usb-msd.c
> index 0a95d8d..46642a8 100644
> --- a/hw/usb-msd.c
> +++ b/hw/usb-msd.c
> @@ -560,6 +560,7 @@ static int usb_msd_initfn(USBDevice *dev)
>          }
>      }
>  
> +    add_boot_device_path(s->conf.bootindex, &dev->qdev, "/disk@0,0");
>      return 0;
>  }
>  
> @@ -624,6 +625,7 @@ static USBDevice *usb_msd_init(const char *filename)
>  static struct USBDeviceInfo msd_info = {
>      .product_desc   = "QEMU USB MSD",
>      .qdev.name      = "usb-storage",
> +    .qdev.fw_name      = "storage",
>      .qdev.size      = sizeof(MSDState),
>      .init           = usb_msd_initfn,
>      .handle_packet  = usb_generic_handle_packet,
> -- 
> 1.7.2.3
> 

--
			Gleb.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PATCH 1/2] Add bootindex handling into usb storage device.
@ 2011-01-02 15:07 Gleb Natapov
  2011-01-26 13:01 ` Gleb Natapov
  2011-01-28 13:34 ` Markus Armbruster
  0 siblings, 2 replies; 7+ messages in thread
From: Gleb Natapov @ 2011-01-02 15:07 UTC (permalink / raw)
  To: qemu-devel


Signed-off-by: Gleb Natapov <gleb@redhat.com>
---
 hw/usb-msd.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/hw/usb-msd.c b/hw/usb-msd.c
index 0a95d8d..46642a8 100644
--- a/hw/usb-msd.c
+++ b/hw/usb-msd.c
@@ -560,6 +560,7 @@ static int usb_msd_initfn(USBDevice *dev)
         }
     }
 
+    add_boot_device_path(s->conf.bootindex, &dev->qdev, "/disk@0,0");
     return 0;
 }
 
@@ -624,6 +625,7 @@ static USBDevice *usb_msd_init(const char *filename)
 static struct USBDeviceInfo msd_info = {
     .product_desc   = "QEMU USB MSD",
     .qdev.name      = "usb-storage",
+    .qdev.fw_name      = "storage",
     .qdev.size      = sizeof(MSDState),
     .init           = usb_msd_initfn,
     .handle_packet  = usb_generic_handle_packet,
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH 1/2] Add bootindex handling into usb storage device.
  2011-01-02 15:07 Gleb Natapov
@ 2011-01-26 13:01 ` Gleb Natapov
  2011-01-28 13:34 ` Markus Armbruster
  1 sibling, 0 replies; 7+ messages in thread
From: Gleb Natapov @ 2011-01-26 13:01 UTC (permalink / raw)
  To: qemu-devel

ping?

On Sun, Jan 02, 2011 at 05:07:30PM +0200, Gleb Natapov wrote:
> 
> Signed-off-by: Gleb Natapov <gleb@redhat.com>
> ---
>  hw/usb-msd.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/hw/usb-msd.c b/hw/usb-msd.c
> index 0a95d8d..46642a8 100644
> --- a/hw/usb-msd.c
> +++ b/hw/usb-msd.c
> @@ -560,6 +560,7 @@ static int usb_msd_initfn(USBDevice *dev)
>          }
>      }
>  
> +    add_boot_device_path(s->conf.bootindex, &dev->qdev, "/disk@0,0");
>      return 0;
>  }
>  
> @@ -624,6 +625,7 @@ static USBDevice *usb_msd_init(const char *filename)
>  static struct USBDeviceInfo msd_info = {
>      .product_desc   = "QEMU USB MSD",
>      .qdev.name      = "usb-storage",
> +    .qdev.fw_name      = "storage",
>      .qdev.size      = sizeof(MSDState),
>      .init           = usb_msd_initfn,
>      .handle_packet  = usb_generic_handle_packet,
> -- 
> 1.7.2.3
> 

--
			Gleb.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH 1/2] Add bootindex handling into usb storage device.
  2011-01-02 15:07 Gleb Natapov
  2011-01-26 13:01 ` Gleb Natapov
@ 2011-01-28 13:34 ` Markus Armbruster
  2011-01-28 15:48   ` Gleb Natapov
  1 sibling, 1 reply; 7+ messages in thread
From: Markus Armbruster @ 2011-01-28 13:34 UTC (permalink / raw)
  To: Gleb Natapov; +Cc: qemu-devel

Gleb Natapov <gleb@redhat.com> writes:

> Signed-off-by: Gleb Natapov <gleb@redhat.com>
> ---
>  hw/usb-msd.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/hw/usb-msd.c b/hw/usb-msd.c
> index 0a95d8d..46642a8 100644
> --- a/hw/usb-msd.c
> +++ b/hw/usb-msd.c
> @@ -560,6 +560,7 @@ static int usb_msd_initfn(USBDevice *dev)
>          }
>      }
>  
> +    add_boot_device_path(s->conf.bootindex, &dev->qdev, "/disk@0,0");
>      return 0;
>  }
>  
> @@ -624,6 +625,7 @@ static USBDevice *usb_msd_init(const char *filename)
>  static struct USBDeviceInfo msd_info = {
>      .product_desc   = "QEMU USB MSD",
>      .qdev.name      = "usb-storage",
> +    .qdev.fw_name      = "storage",
>      .qdev.size      = sizeof(MSDState),
>      .init           = usb_msd_initfn,
>      .handle_packet  = usb_generic_handle_packet,

Out of curiosity, could you explain the logic behind fw name (as
returned by qdev_fw_name()) and suffix (as passed to
add_boot_device_path())?

    qdev            fw name     suffix
    ----------------------------------------
    isa-fdc         fdc         /floppy@0
    scsi-disk       disk        ,0
    ide-drive       drive       /disk@0
    usb-storage     storage     /disk@0,0
    virtio-blk-pci  virtio-blk  /disk@0,0

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH 1/2] Add bootindex handling into usb storage device.
  2011-01-28 13:34 ` Markus Armbruster
@ 2011-01-28 15:48   ` Gleb Natapov
  0 siblings, 0 replies; 7+ messages in thread
From: Gleb Natapov @ 2011-01-28 15:48 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel

On Fri, Jan 28, 2011 at 02:34:19PM +0100, Markus Armbruster wrote:
> Gleb Natapov <gleb@redhat.com> writes:
> 
> > Signed-off-by: Gleb Natapov <gleb@redhat.com>
> > ---
> >  hw/usb-msd.c |    2 ++
> >  1 files changed, 2 insertions(+), 0 deletions(-)
> >
> > diff --git a/hw/usb-msd.c b/hw/usb-msd.c
> > index 0a95d8d..46642a8 100644
> > --- a/hw/usb-msd.c
> > +++ b/hw/usb-msd.c
> > @@ -560,6 +560,7 @@ static int usb_msd_initfn(USBDevice *dev)
> >          }
> >      }
> >  
> > +    add_boot_device_path(s->conf.bootindex, &dev->qdev, "/disk@0,0");
> >      return 0;
> >  }
> >  
> > @@ -624,6 +625,7 @@ static USBDevice *usb_msd_init(const char *filename)
> >  static struct USBDeviceInfo msd_info = {
> >      .product_desc   = "QEMU USB MSD",
> >      .qdev.name      = "usb-storage",
> > +    .qdev.fw_name      = "storage",
> >      .qdev.size      = sizeof(MSDState),
> >      .init           = usb_msd_initfn,
> >      .handle_packet  = usb_generic_handle_packet,
> 
> Out of curiosity, could you explain the logic behind fw name (as
> returned by qdev_fw_name()) and suffix (as passed to
> add_boot_device_path())?
They are defined by open firmware bus binding specs. You can find most
of them here: http://playground.sun.com/1275/bindings/. FW name is not
terribly important for SeaBIOS though. SeaBIOS ignores this part of
device name when it matches device path.

> 
>     qdev            fw name     suffix
>     ----------------------------------------
>     isa-fdc         fdc         /floppy@0
>     scsi-disk       disk        ,0
>     ide-drive       drive       /disk@0
>     usb-storage     storage     /disk@0,0
>     virtio-blk-pci  virtio-blk  /disk@0,0
virtio-blk-pci will be seen as scsi since it uses scsi pci class for pci
device.

--
			Gleb.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-01-28 15:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-02 15:04 [Qemu-devel] [PATCH 1/2] Add bootindex handling into usb storage device Gleb Natapov
2011-01-02 15:04 ` [Qemu-devel] [PATCH 2/2] Add boot index documentation Gleb Natapov
2011-01-02 15:07 ` [Qemu-devel] [PATCH 1/2] Add bootindex handling into usb storage device Gleb Natapov
  -- strict thread matches above, loose matches on Subject: below --
2011-01-02 15:07 Gleb Natapov
2011-01-26 13:01 ` Gleb Natapov
2011-01-28 13:34 ` Markus Armbruster
2011-01-28 15:48   ` Gleb Natapov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).