From: Laurent Vivier <laurent@vivier.eu>
To: Cornelia Huck <cohuck@redhat.com>
Cc: "Kevin Wolf" <kwolf@redhat.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Thomas Huth" <thuth@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Eduardo Habkost" <ehabkost@redhat.com>,
qemu-block@nongnu.org, "Markus Armbruster" <armbru@redhat.com>,
qemu-devel@nongnu.org, "Max Reitz" <mreitz@redhat.com>,
qemu-s390x@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: Re: [PATCH v2 3/6] blockdev: with -drive if=virtio, use generic virtio-blk
Date: Fri, 19 Mar 2021 19:15:18 +0100 [thread overview]
Message-ID: <1834c894-aa02-8da5-cf3d-33790fa73bbe@vivier.eu> (raw)
In-Reply-To: <20210319154655.44418034.cohuck@redhat.com>
Le 19/03/2021 à 15:46, Cornelia Huck a écrit :
> On Fri, 19 Mar 2021 14:25:34 +0100
> Laurent Vivier <laurent@vivier.eu> wrote:
>
>> Rather than checking if the machine is an s390x to use virtio-blk-ccw
>> instead of virtio-blk-pci, use the alias virtio-blk that is set to
>> the expected target.
>
> One side effect: if we add a new architecture and don't define the
> aliases for it, this function probably won't do the right thing; prior
> to the patch, it would simply default to virtio-blk-pci. Probably not a
> big deal, but we need to be careful to keep the alias defines up to
> date, which previously wasn't such a big deal.
But it will be easy to detect because we will have the error "unknown device: virtio-blk".
It will be a good reminder to add the aliases...
Thanks,
Laurent
>
>>
>> This also enables the use of virtio-blk-device for targets without
>> PCI or CCW.
>>
>> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
>> ---
>> blockdev.c | 6 +-----
>> 1 file changed, 1 insertion(+), 5 deletions(-)
>>
>> diff --git a/blockdev.c b/blockdev.c
>> index 5cc7c7effe9f..64da5350e3ad 100644
>> --- a/blockdev.c
>> +++ b/blockdev.c
>> @@ -969,11 +969,7 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type,
>> QemuOpts *devopts;
>> devopts = qemu_opts_create(qemu_find_opts("device"), NULL, 0,
>> &error_abort);
>> - if (arch_type == QEMU_ARCH_S390X) {
>> - qemu_opt_set(devopts, "driver", "virtio-blk-ccw", &error_abort);
>> - } else {
>> - qemu_opt_set(devopts, "driver", "virtio-blk-pci", &error_abort);
>> - }
>> + qemu_opt_set(devopts, "driver", "virtio-blk", &error_abort);
>> qemu_opt_set(devopts, "drive", qdict_get_str(bs_opts, "id"),
>> &error_abort);
>> }
>
next prev parent reply other threads:[~2021-03-19 18:18 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-19 13:25 [PATCH v2 0/6] iotests: fix failures with non-PCI machines Laurent Vivier
2021-03-19 13:25 ` [PATCH v2 1/6] qdev: define list of archs with virtio-pci or virtio-ccw Laurent Vivier
2021-03-19 14:40 ` Cornelia Huck
2021-03-19 13:25 ` [PATCH v2 2/6] m68k: add the virtio devices aliases Laurent Vivier
2021-03-19 13:33 ` Philippe Mathieu-Daudé
2021-03-19 14:41 ` Cornelia Huck
2021-03-19 13:25 ` [PATCH v2 3/6] blockdev: with -drive if=virtio, use generic virtio-blk Laurent Vivier
2021-03-19 13:36 ` Philippe Mathieu-Daudé
2021-03-19 14:46 ` Cornelia Huck
2021-03-19 18:15 ` Laurent Vivier [this message]
2021-03-19 13:25 ` [PATCH v2 4/6] iotests: Revert "iotests: use -ccw on s390x for 040, 139, and 182" Laurent Vivier
2021-03-19 13:42 ` Philippe Mathieu-Daudé
2021-03-19 14:49 ` Cornelia Huck
2021-03-19 13:25 ` [PATCH v2 5/6] iotests: test m68k with the virt machine Laurent Vivier
2021-03-19 14:50 ` Cornelia Huck
2021-03-19 13:25 ` [PATCH v2 6/6] iotests: iothreads need ioeventfd Laurent Vivier
2021-03-19 13:36 ` Philippe Mathieu-Daudé
2021-03-19 13:51 ` Laurent Vivier
2021-03-19 14:23 ` Cornelia Huck
2021-03-19 14:27 ` Laurent Vivier
2021-03-19 14:32 ` Cornelia Huck
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=1834c894-aa02-8da5-cf3d-33790fa73bbe@vivier.eu \
--to=laurent@vivier.eu \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=cohuck@redhat.com \
--cc=ehabkost@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=thuth@redhat.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).