qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: Sam Eiderman <shmuel.eiderman@oracle.com>,
	kwolf@redhat.com, qemu-block@nongnu.org, qemu-devel@nongnu.org,
	seabios@seabios.org, kraxel@redhat.com, kevin@koconnor.net
Cc: liran.alon@oracle.com, karl.heubaum@oracle.com, arbel.moshe@oracle.com
Subject: Re: [Qemu-devel] [QEMU] [PATCH v5 5/8] bootdevice: Gather LCHS from all relevant devices
Date: Tue, 13 Aug 2019 21:05:54 +0200	[thread overview]
Message-ID: <8e54c29d-119b-e02b-8966-56fa7ea91f9e@redhat.com> (raw)
In-Reply-To: <20190626123948.10199-6-shmuel.eiderman@oracle.com>


[-- Attachment #1.1: Type: text/plain, Size: 3188 bytes --]

On 26.06.19 14:39, Sam Eiderman wrote:
> Relevant devices are:
>     * ide-hd (and ide-cd, ide-drive)
>     * scsi-hd (and scsi-cd, scsi-disk, scsi-block)
>     * virtio-blk-pci
> 
> We do not call del_boot_device_lchs() for ide-* since we don't need to -
> IDE block devices do not support unplugging.
> 
> Reviewed-by: Karl Heubaum <karl.heubaum@oracle.com>
> Reviewed-by: Arbel Moshe <arbel.moshe@oracle.com>
> Signed-off-by: Sam Eiderman <shmuel.eiderman@oracle.com>
> ---
>  hw/block/virtio-blk.c |  6 ++++++
>  hw/ide/qdev.c         |  5 +++++
>  hw/scsi/scsi-disk.c   | 14 ++++++++++++++
>  3 files changed, 25 insertions(+)
> 
> diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
> index 06e57a4d39..787bbd768a 100644
> --- a/hw/block/virtio-blk.c
> +++ b/hw/block/virtio-blk.c
> @@ -1182,6 +1182,11 @@ static void virtio_blk_device_realize(DeviceState *dev, Error **errp)
>      blk_set_guest_block_size(s->blk, s->conf.conf.logical_block_size);
>  
>      blk_iostatus_enable(s->blk);
> +
> +    add_boot_device_lchs(dev, "/disk@0,0",
> +                         (&conf->conf)->lcyls,
> +                         (&conf->conf)->lheads,
> +                         (&conf->conf)->lsecs);

...why not simply “conf->conf.lcyls” and so on?

[...]

> diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
> index 7b89ac798b..3451aefdea 100644
> --- a/hw/scsi/scsi-disk.c
> +++ b/hw/scsi/scsi-disk.c

[...]

> @@ -2988,6 +2998,7 @@ static void scsi_hd_class_initfn(ObjectClass *klass, void *data)
>      SCSIDeviceClass *sc = SCSI_DEVICE_CLASS(klass);
>  
>      sc->realize      = scsi_hd_realize;
> +    sc->unrealize    = scsi_unrealize;
>      sc->alloc_req    = scsi_new_request;
>      sc->unit_attention_reported = scsi_disk_unit_attention_reported;
>      dc->desc = "virtual SCSI disk";
> @@ -3019,6 +3030,7 @@ static void scsi_cd_class_initfn(ObjectClass *klass, void *data)
>      SCSIDeviceClass *sc = SCSI_DEVICE_CLASS(klass);
>  
>      sc->realize      = scsi_cd_realize;
> +    sc->unrealize    = scsi_unrealize;
>      sc->alloc_req    = scsi_new_request;
>      sc->unit_attention_reported = scsi_disk_unit_attention_reported;
>      dc->desc = "virtual SCSI CD-ROM";
> @@ -3054,6 +3066,7 @@ static void scsi_block_class_initfn(ObjectClass *klass, void *data)
>      SCSIDiskClass *sdc = SCSI_DISK_BASE_CLASS(klass);
>  
>      sc->realize      = scsi_block_realize;
> +    sc->unrealize    = scsi_unrealize;
>      sc->alloc_req    = scsi_block_new_request;
>      sc->parse_cdb    = scsi_block_parse_cdb;
>      sdc->dma_readv   = scsi_block_dma_readv;
> @@ -3095,6 +3108,7 @@ static void scsi_disk_class_initfn(ObjectClass *klass, void *data)
>      SCSIDeviceClass *sc = SCSI_DEVICE_CLASS(klass);
>  
>      sc->realize      = scsi_disk_realize;
> +    sc->unrealize    = scsi_unrealize;
>      sc->alloc_req    = scsi_new_request;
>      sc->unit_attention_reported = scsi_disk_unit_attention_reported;
>      dc->fw_name = "disk";

Only scsi-hd has the lchs properties, though, so what’s the purpose of
defining the unrealize function for all other classes?

Max


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2019-08-13 19:06 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-26 12:39 [Qemu-devel] [QEMU] [PATCH v5 0/8] Add Qemu to SeaBIOS LCHS interface Sam Eiderman
2019-06-26 12:39 ` [Qemu-devel] [QEMU] [PATCH v5 1/8] block: Refactor macros - fix tabbing Sam Eiderman
2019-06-26 12:39 ` [Qemu-devel] [QEMU] [PATCH v5 2/8] block: Support providing LCHS from user Sam Eiderman
2019-06-26 12:39 ` [Qemu-devel] [QEMU] [PATCH v5 3/8] bootdevice: Add interface to gather LCHS Sam Eiderman
2019-08-13 18:51   ` Max Reitz
2019-08-22 15:13     ` Sam Eiderman via Qemu-devel
2019-06-26 12:39 ` [Qemu-devel] [QEMU] [PATCH v5 4/8] scsi: Propagate unrealize() callback to scsi-hd Sam Eiderman
2019-08-13 19:06   ` Max Reitz
2019-08-25 13:35     ` Sam Eiderman via Qemu-devel
2019-06-26 12:39 ` [Qemu-devel] [QEMU] [PATCH v5 5/8] bootdevice: Gather LCHS from all relevant devices Sam Eiderman
2019-08-13 19:05   ` Max Reitz [this message]
2019-08-25 13:38     ` Sam Eiderman via Qemu-devel
2019-06-26 12:39 ` [Qemu-devel] [QEMU] [PATCH v5 6/8] bootdevice: Refactor get_boot_devices_list Sam Eiderman
2019-06-26 12:39 ` [Qemu-devel] [QEMU] [PATCH v5 7/8] bootdevice: FW_CFG interface for LCHS values Sam Eiderman
2019-06-26 12:39 ` [Qemu-devel] [QEMU] [PATCH v5 8/8] hd-geo-test: Add tests for lchs override Sam Eiderman
2019-07-01  7:41 ` [Qemu-devel] [QEMU] [PATCH v5 0/8] Add Qemu to SeaBIOS LCHS interface Gerd Hoffmann
2019-07-08 17:30   ` Sam Eiderman
2019-07-17 19:03     ` Sam Eiderman
2019-07-17 19:46       ` Kevin Wolf
2019-07-19 10:10         ` Sam Eiderman
2019-07-25  0:47           ` [Qemu-devel] [Qemu-block] " John Snow
2019-07-25  0:50             ` John Snow
2019-07-25 19:42               ` Laszlo Ersek
2019-07-30 11:35               ` Gerd Hoffmann
2019-08-13 19:35 ` [Qemu-devel] " Max Reitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8e54c29d-119b-e02b-8966-56fa7ea91f9e@redhat.com \
    --to=mreitz@redhat.com \
    --cc=arbel.moshe@oracle.com \
    --cc=karl.heubaum@oracle.com \
    --cc=kevin@koconnor.net \
    --cc=kraxel@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=liran.alon@oracle.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=seabios@seabios.org \
    --cc=shmuel.eiderman@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).