From: Thomas Huth <thuth@redhat.com>
To: Cornelia Huck <cohuck@redhat.com>
Cc: qemu-devel@nongnu.org,
Christian Borntraeger <borntraeger@de.ibm.com>,
Alexander Graf <agraf@suse.de>,
Farhan Ali <alifm@linux.vnet.ibm.com>,
David Hildenbrand <david@redhat.com>,
Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [RFC PATCH v2 3/8] pc-bios/s390-ccw: Move virtio-block related functions into a separate file
Date: Fri, 7 Jul 2017 15:04:55 +0200 [thread overview]
Message-ID: <2e3bc24b-2244-1cb7-4276-73b1126d6973@redhat.com> (raw)
In-Reply-To: <20170707145402.30187319@dhcp-192-215.str.redhat.com>
On 07.07.2017 14:54, Cornelia Huck wrote:
> On Fri, 7 Jul 2017 12:26:59 +0200
> Thomas Huth <thuth@redhat.com> wrote:
>
>> The netboot code is going to link against the code from virtio.c, too,
>> so we've got to move the virtio-block related code out of the way.
>>
>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>> ---
>> pc-bios/s390-ccw/Makefile | 2 +-
>> pc-bios/s390-ccw/main.c | 2 +-
>> pc-bios/s390-ccw/s390-ccw.h | 2 +-
>> pc-bios/s390-ccw/virtio-blk.c | 296 ++++++++++++++++++++++++++++++++++++++++++
>> pc-bios/s390-ccw/virtio.c | 273 +-------------------------------------
>> pc-bios/s390-ccw/virtio.h | 4 +
>> 6 files changed, 307 insertions(+), 272 deletions(-)
>> create mode 100644 pc-bios/s390-ccw/virtio-blk.c
>>
>
>> diff --git a/pc-bios/s390-ccw/virtio-blk.c b/pc-bios/s390-ccw/virtio-blk.c
>> new file mode 100644
>> index 0000000..6cb77bc
>> --- /dev/null
>> +++ b/pc-bios/s390-ccw/virtio-blk.c
>> @@ -0,0 +1,296 @@
>> +/*
>> + * Virtio driver bits
>> + *
>> + * Copyright (c) 2013 Alexander Graf <agraf@suse.de>
>
> The original code carries the same copyright notice, but there's a lot
> of IBM code in there. Just saying.
Then the IBM folks should maybe add their (c) statement to that file
first? Otherwise, I assume they simply do not care ;-)
[...]
>> +int virtio_read_many(ulong sector, void *load_addr, int sec_num)
>> +{
>> + VDev *vdev = virtio_get_device();
>> +
>> + switch (vdev->senseid.cu_model) {
>> + case VIRTIO_ID_BLOCK:
>> + return virtio_blk_read_many(vdev, sector, load_addr, sec_num);
>> + case VIRTIO_ID_SCSI:
>> + return virtio_scsi_read_many(vdev, sector, load_addr, sec_num);
>
> This is scsi, not blk. Should virtio_read_many() stay in virtio.c?
No, that does not work since virtio_scsi_read_many() is defined in
virtio-scsi.c which is not linked to the netboot code.
>> + }
>> + panic("\n! No readable IPL device !\n");
>> + return -1;
>> +}
> (...)
>> +void virtio_assume_scsi(void)
>> +{
>> + VDev *vdev = virtio_get_device();
>> +
>> + switch (vdev->senseid.cu_model) {
>> + case VIRTIO_ID_BLOCK:
>> + vdev->guessed_disk_nature = VIRTIO_GDN_SCSI;
>> + vdev->config.blk.blk_size = VIRTIO_SCSI_BLOCK_SIZE;
>> + vdev->config.blk.physical_block_exp = 0;
>> + vdev->blk_factor = 1;
>> + break;
>> + case VIRTIO_ID_SCSI:
>> + vdev->scsi_block_size = VIRTIO_SCSI_BLOCK_SIZE;
>
> More scsi. Maybe the file just needs a different name :)
Do you have a better suggestion?
Thomas
next prev parent reply other threads:[~2017-07-07 13:05 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-07 10:26 [Qemu-devel] [RFC PATCH v2 0/8] Implement network booting directly into the s390-ccw BIOS Thomas Huth
2017-07-07 10:26 ` [Qemu-devel] [RFC PATCH v2 1/8] pc-bios/s390-ccw: Move libc functions to separate header Thomas Huth
2017-07-07 13:46 ` Christian Borntraeger
2017-07-07 15:05 ` Thomas Huth
2017-07-07 15:10 ` Thomas Huth
2017-07-07 13:56 ` Farhan Ali
2017-07-07 10:26 ` [Qemu-devel] [RFC PATCH v2 2/8] pc-bios/s390-ccw: Move ebc2asc to sclp.c Thomas Huth
2017-07-07 12:42 ` Cornelia Huck
2017-07-07 14:05 ` Farhan Ali
2017-07-07 10:26 ` [Qemu-devel] [RFC PATCH v2 3/8] pc-bios/s390-ccw: Move virtio-block related functions into a separate file Thomas Huth
2017-07-07 12:54 ` Cornelia Huck
2017-07-07 13:04 ` Thomas Huth [this message]
2017-07-07 13:06 ` Cornelia Huck
2017-07-07 10:27 ` [Qemu-devel] [RFC PATCH v2 4/8] pc-bios/s390-ccw: Add a write() function for stdio Thomas Huth
2017-07-07 12:57 ` Cornelia Huck
2017-07-07 10:27 ` [Qemu-devel] [RFC PATCH v2 5/8] roms/SLOF: Update submodule to latest status Thomas Huth
2017-07-07 10:27 ` [Qemu-devel] [RFC PATCH v2 6/8] pc-bios/s390-ccw: Add core files for the network bootloading program Thomas Huth
2017-07-07 10:27 ` [Qemu-devel] [RFC PATCH v2 7/8] pc-bios/s390-ccw: Add virtio-net driver code Thomas Huth
2017-07-07 12:37 ` Cornelia Huck
2017-07-10 11:23 ` Thomas Huth
2017-07-10 11:38 ` Cornelia Huck
2017-07-07 10:27 ` [Qemu-devel] [RFC PATCH v2 8/8] pc-bios/s390-ccw: Link libnet into the netboot image and do the TFTP load Thomas Huth
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=2e3bc24b-2244-1cb7-4276-73b1126d6973@redhat.com \
--to=thuth@redhat.com \
--cc=agraf@suse.de \
--cc=alifm@linux.vnet.ibm.com \
--cc=borntraeger@de.ibm.com \
--cc=cohuck@redhat.com \
--cc=david@redhat.com \
--cc=mihajlov@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
/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).