Patchwork [1/2] Add bootindex handling into usb storage device.

login
register
mail settings
Submitter Gleb Natapov
Date Jan. 2, 2011, 3:07 p.m.
Message ID <1293980851-3743-1-git-send-email-gleb@redhat.com>
Download mbox | patch
Permalink /patch/77190/
State New
Headers show

Comments

Gleb Natapov - Jan. 2, 2011, 3:07 p.m.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
---
 hw/usb-msd.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
Gleb Natapov - Jan. 26, 2011, 1:01 p.m.
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.
Markus Armbruster - Jan. 28, 2011, 1:34 p.m.
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
Gleb Natapov - Jan. 28, 2011, 3:48 p.m.
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.

Patch

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,