* [Qemu-devel] [PATCH] scsi-hd: fix property unset case
@ 2015-03-04 10:02 Ekaterina Tumanova
2015-03-04 12:23 ` Kevin Wolf
0 siblings, 1 reply; 5+ messages in thread
From: Ekaterina Tumanova @ 2015-03-04 10:02 UTC (permalink / raw)
To: peter.maydell
Cc: kwolf, Ekaterina Tumanova, qemu-devel, armbru, borntraeger,
stefanha, mreitz
commit "BlockConf: Call backend functions to detect geometry and
blocksizes" causes a segmentation fault on the invalid configuration of
a scsi device without a drive.
Lets check for conf.blk before calling blkconf_blocksizes. The error
will be handled later on in scsi_realize anyway.
Reported-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Ekaterina Tumanova <tumanova@linux.vnet.ibm.com>
---
hw/scsi/scsi-disk.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index 2921728..54d71f4 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -2291,7 +2291,12 @@ 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);
+ /* can happen for devices without drive. The error message for missing
+ * backend will be issued in scsi_realize
+ */
+ if (s->qdev.conf.blk) {
+ blkconf_blocksizes(&s->qdev.conf);
+ }
s->qdev.blocksize = s->qdev.conf.logical_block_size;
s->qdev.type = TYPE_DISK;
if (!s->product) {
--
2.1.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] scsi-hd: fix property unset case
2015-03-04 10:02 [Qemu-devel] [PATCH] scsi-hd: fix property unset case Ekaterina Tumanova
@ 2015-03-04 12:23 ` Kevin Wolf
2015-03-04 13:58 ` Max Reitz
0 siblings, 1 reply; 5+ messages in thread
From: Kevin Wolf @ 2015-03-04 12:23 UTC (permalink / raw)
To: Ekaterina Tumanova
Cc: peter.maydell, qemu-devel, armbru, borntraeger, stefanha, mreitz
Am 04.03.2015 um 11:02 hat Ekaterina Tumanova geschrieben:
> commit "BlockConf: Call backend functions to detect geometry and
> blocksizes" causes a segmentation fault on the invalid configuration of
> a scsi device without a drive.
>
> Lets check for conf.blk before calling blkconf_blocksizes. The error
> will be handled later on in scsi_realize anyway.
>
> Reported-by: Max Reitz <mreitz@redhat.com>
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> Reviewed-by: Max Reitz <mreitz@redhat.com>
> Signed-off-by: Ekaterina Tumanova <tumanova@linux.vnet.ibm.com>
Thanks, added the commit ID of the regression to the commit message, and
applied to the block branch.
Kevin
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] scsi-hd: fix property unset case
2015-03-04 12:23 ` Kevin Wolf
@ 2015-03-04 13:58 ` Max Reitz
2015-03-04 14:12 ` Kevin Wolf
0 siblings, 1 reply; 5+ messages in thread
From: Max Reitz @ 2015-03-04 13:58 UTC (permalink / raw)
To: Kevin Wolf, Ekaterina Tumanova
Cc: qemu-devel, peter.maydell, armbru, stefanha, borntraeger
On 2015-03-04 at 07:23, Kevin Wolf wrote:
> Am 04.03.2015 um 11:02 hat Ekaterina Tumanova geschrieben:
>> commit "BlockConf: Call backend functions to detect geometry and
>> blocksizes" causes a segmentation fault on the invalid configuration of
>> a scsi device without a drive.
>>
>> Lets check for conf.blk before calling blkconf_blocksizes. The error
>> will be handled later on in scsi_realize anyway.
>>
>> Reported-by: Max Reitz <mreitz@redhat.com>
>> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
>> Reviewed-by: Max Reitz <mreitz@redhat.com>
>> Signed-off-by: Ekaterina Tumanova <tumanova@linux.vnet.ibm.com>
> Thanks, added the commit ID of the regression to the commit message, and
> applied to the block branch.
But that commit is not yet upstream, so the ID won't be stable. Are you
planning to change it once it's merged?
Max
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] scsi-hd: fix property unset case
2015-03-04 13:58 ` Max Reitz
@ 2015-03-04 14:12 ` Kevin Wolf
2015-03-04 14:13 ` Max Reitz
0 siblings, 1 reply; 5+ messages in thread
From: Kevin Wolf @ 2015-03-04 14:12 UTC (permalink / raw)
To: Max Reitz
Cc: peter.maydell, Ekaterina Tumanova, qemu-devel, armbru,
borntraeger, stefanha
Am 04.03.2015 um 14:58 hat Max Reitz geschrieben:
> On 2015-03-04 at 07:23, Kevin Wolf wrote:
> >Am 04.03.2015 um 11:02 hat Ekaterina Tumanova geschrieben:
> >>commit "BlockConf: Call backend functions to detect geometry and
> >>blocksizes" causes a segmentation fault on the invalid configuration of
> >>a scsi device without a drive.
> >>
> >>Lets check for conf.blk before calling blkconf_blocksizes. The error
> >>will be handled later on in scsi_realize anyway.
> >>
> >>Reported-by: Max Reitz <mreitz@redhat.com>
> >>Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> >>Reviewed-by: Max Reitz <mreitz@redhat.com>
> >>Signed-off-by: Ekaterina Tumanova <tumanova@linux.vnet.ibm.com>
> >Thanks, added the commit ID of the regression to the commit message, and
> >applied to the block branch.
>
> But that commit is not yet upstream, so the ID won't be stable. Are
> you planning to change it once it's merged?
Unless someone touches the pull request (which he shouldn't), the commit
ID is going to stay.
Kevin
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] scsi-hd: fix property unset case
2015-03-04 14:12 ` Kevin Wolf
@ 2015-03-04 14:13 ` Max Reitz
0 siblings, 0 replies; 5+ messages in thread
From: Max Reitz @ 2015-03-04 14:13 UTC (permalink / raw)
To: Kevin Wolf
Cc: peter.maydell, Ekaterina Tumanova, qemu-devel, armbru,
borntraeger, stefanha
On 2015-03-04 at 09:12, Kevin Wolf wrote:
> Am 04.03.2015 um 14:58 hat Max Reitz geschrieben:
>> On 2015-03-04 at 07:23, Kevin Wolf wrote:
>>> Am 04.03.2015 um 11:02 hat Ekaterina Tumanova geschrieben:
>>>> commit "BlockConf: Call backend functions to detect geometry and
>>>> blocksizes" causes a segmentation fault on the invalid configuration of
>>>> a scsi device without a drive.
>>>>
>>>> Lets check for conf.blk before calling blkconf_blocksizes. The error
>>>> will be handled later on in scsi_realize anyway.
>>>>
>>>> Reported-by: Max Reitz <mreitz@redhat.com>
>>>> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
>>>> Reviewed-by: Max Reitz <mreitz@redhat.com>
>>>> Signed-off-by: Ekaterina Tumanova <tumanova@linux.vnet.ibm.com>
>>> Thanks, added the commit ID of the regression to the commit message, and
>>> applied to the block branch.
>> But that commit is not yet upstream, so the ID won't be stable. Are
>> you planning to change it once it's merged?
> Unless someone touches the pull request (which he shouldn't), the commit
> ID is going to stay.
Oh, that's nice, I didn't know that. Thanks for explaining.
Max
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-03-04 14:13 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-04 10:02 [Qemu-devel] [PATCH] scsi-hd: fix property unset case Ekaterina Tumanova
2015-03-04 12:23 ` Kevin Wolf
2015-03-04 13:58 ` Max Reitz
2015-03-04 14:12 ` Kevin Wolf
2015-03-04 14:13 ` Max Reitz
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).