All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ekaterina Tumanova <tumanova@linux.vnet.ibm.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: kwolf@redhat.com, thuth@linux.vnet.ibm.com,
	borntraeger@de.ibm.com, qemu-devel@nongnu.org,
	mihajlov@linux.vnet.ibm.com, dahi@linux.vnet.ibm.com,
	stefanha@redhat.com, cornelia.huck@de.ibm.com, mreitz@redhat.com
Subject: Re: [Qemu-devel] [PATCH 1/1] scsi-hd: fix property unset case
Date: Mon, 02 Mar 2015 12:07:30 +0300	[thread overview]
Message-ID: <54F42852.70301@linux.vnet.ibm.com> (raw)
In-Reply-To: <87y4nfpz1q.fsf@blackfin.pond.sub.org>

On 03/02/2015 11:46 AM, Markus Armbruster wrote:
> Ekaterina Tumanova <tumanova@linux.vnet.ibm.com> writes:
>
>> check conf.blk before calling blkconf_blocksizes
>>
>> Signed-off-by: Ekaterina Tumanova <tumanova@linux.vnet.ibm.com>
>> ---
>>   hw/scsi/scsi-disk.c | 4 +++-
>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
>> index 2921728..df5140e 100644
>> --- a/hw/scsi/scsi-disk.c
>> +++ b/hw/scsi/scsi-disk.c
>> @@ -2291,7 +2291,9 @@ static void scsi_realize(SCSIDevice *dev, Error **errp)
>>   static void scsi_hd_realize(SCSIDevice *dev, Error **errp)
>>   {
>>       SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, dev);
>> -    blkconf_blocksizes(&s->qdev.conf);
>> +    if (s->qdev.conf.blk) {
>> +        blkconf_blocksizes(&s->qdev.conf);
>> +    }
>
> Looks suspicious on first glance, because block device model realize()
> methods are supposed to fail when the backend is missing.  But...
>

it will properly fail in scsi_realize

>>       s->qdev.blocksize = s->qdev.conf.logical_block_size;
>>       s->qdev.type = TYPE_DISK;
>>       if (!s->product) {
>             s->product = g_strdup("QEMU HARDDISK");
>         }
>         scsi_realize(&s->qdev, errp);
>
> ... scsi_realize() errors out then.  Worth a comment.  Or maybe call
> blkconf_blocksizes() only after scsi_realize().  Your choice.

can't call it later. conf.logical_block_size, which blkconf_blocksizes
sets it used earlier.

  reply	other threads:[~2015-03-02  9:07 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-16 11:47 [Qemu-devel] [PATCH v7 0/5] Geometry and blocksize detection for backing devices Ekaterina Tumanova
2015-02-16 11:47 ` [Qemu-devel] [PATCH v7 1/5] block: add bdrv functions for geometry and blocksize Ekaterina Tumanova
2015-02-16 11:47 ` [Qemu-devel] [PATCH v7 2/5] raw-posix: Factor block size detection out of raw_probe_alignment() Ekaterina Tumanova
2015-02-16 11:47 ` [Qemu-devel] [PATCH v7 3/5] block: Add driver methods to probe blocksizes and geometry Ekaterina Tumanova
2015-02-16 11:47 ` [Qemu-devel] [PATCH v7 4/5] block-backend: Add wrappers for blocksizes and geometry probing Ekaterina Tumanova
2015-02-16 11:47 ` [Qemu-devel] [PATCH v7 5/5] BlockConf: Call backend functions to detect geometry and blocksizes Ekaterina Tumanova
2015-02-27 16:22   ` Max Reitz
2015-02-27 18:26     ` [Qemu-devel] [PATCH 0/1] Ekaterina Tumanova
2015-02-27 18:26       ` [Qemu-devel] [PATCH 1/1] scsi-hd: fix property unset case Ekaterina Tumanova
2015-02-27 18:29         ` Max Reitz
2015-02-27 18:58           ` Stefan Hajnoczi
2015-03-02  8:46         ` Markus Armbruster
2015-03-02  9:07           ` Ekaterina Tumanova [this message]
2015-03-02 12:04             ` Markus Armbruster
2015-03-02  9:28       ` [Qemu-devel] [PATCH 0/1] Kevin Wolf
2015-03-03  8:15         ` [Qemu-devel] [PATCH] Add testcase for scsi-hd devices without drive property Christian Borntraeger
2015-03-03 14:17           ` Christian Borntraeger
2015-03-03 14:31             ` Max Reitz
2015-02-24  9:13 ` [Qemu-devel] [PATCH v7 0/5] Geometry and blocksize detection for backing devices Christian Borntraeger
2015-02-24 10:44 ` Stefan Hajnoczi

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=54F42852.70301@linux.vnet.ibm.com \
    --to=tumanova@linux.vnet.ibm.com \
    --cc=armbru@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=dahi@linux.vnet.ibm.com \
    --cc=kwolf@redhat.com \
    --cc=mihajlov@linux.vnet.ibm.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=thuth@linux.vnet.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.