All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] device_del id missing after blockdev-add
@ 2014-02-17 15:36 William Dauchy
  2014-02-24 15:34 ` Stefan Hajnoczi
  0 siblings, 1 reply; 3+ messages in thread
From: William Dauchy @ 2014-02-17 15:36 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, imain

[-- Attachment #1: Type: text/plain, Size: 3051 bytes --]

Hello,

I'm starting qemu with the following config in order to test drive
hotremove and hotadd:

[drive "disk1"]
  if = "none"
  id = "disk1"
  cache = "none"
  aio = "native"
  format = "raw"
  file = "/dev/sda"

[device "disk1"]
  driver = "scsi-hd"
  drive = "disk1"
  scsi-id = "1"
  removable = "on"
  vendor = "gandi.net"
  dpofua = "off"

I'm now testing device removable without any problem:

(QEMU) device_del id=disk1
{   u'return': {   }}
(QEMU) 
{u'timestamp': {u'seconds': 1392645815, u'microseconds': 484557}, u'data': {u'device': u'disk1', u'path': u'/machine/peripheral/disk1'}, u'event': u'DEVICE_DELETED'}


then, I want to readd the disk, without anyproblem too (with the same
id):

{ "execute": "blockdev-add", "arguments": {'options' : {'driver': 'raw', 'id':'disk1', 'file': {'driver': 'file', 'filename': '/dev/sda'}}} }
{ "device_add", "arguments": {'driver':'scsi-hd', 'drive':'disk1', 'scsi-i':1, 'removable':on} }


The issue is when I want to hot remove the disk again:

(QEMU) device_del id=disk1
{   u'error': {   u'class': u'DeviceNotFound',
                  u'desc': u"Device 'disk1' not found"}}

the output of query-block is the same everywhere:

                   {   u'device': u'disk1',
                       u'inserted': {   u'backing_file_depth': 0,
                                        u'bps': 0,
                                        u'bps_rd': 0,
                                        u'bps_wr': 0,
                                        u'drv': u'raw',
                                        u'encrypted': False,
                                        u'encryption_key_missing': False,
                                        u'file': u'/dev/sda',
                                        u'image': {   u'actual-size': 0,
                                                      u'dirty-flag': False,
                                                      u'filename': u'/dev/sda',
                                                      u'format': u'raw',
                                                      u'virtual-size': 3221225472},
                                        u'iops': 0,
                                        u'iops_rd': 0,
                                        u'iops_wr': 0,
                                        u'ro': False},
                       u'io-status': u'ok',
                       u'locked': False,
                       u'removable': True,
                       u'tray_open': False,
                       u'type': u'unknown'}]}

I guess blockdev-add is not storing the device details as it's done when
using the configuration file, i.e, id is not stored correctly when using
blockdev-add.

Should I consider this as a bug or I wait for the merge of blockdev-del
and ignore device_del command? In all cases I guess device_del should
work in this case too.

these tests were done using the last version available on the git repo
(using master branch)

Regards,
-- 
William

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] device_del id missing after blockdev-add
  2014-02-17 15:36 [Qemu-devel] device_del id missing after blockdev-add William Dauchy
@ 2014-02-24 15:34 ` Stefan Hajnoczi
  2014-02-25 11:20   ` William Dauchy
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Hajnoczi @ 2014-02-24 15:34 UTC (permalink / raw)
  To: William Dauchy; +Cc: kwolf, imain, qemu-devel

On Mon, Feb 17, 2014 at 04:36:42PM +0100, William Dauchy wrote:
> I'm starting qemu with the following config in order to test drive
> hotremove and hotadd:
> 
> [drive "disk1"]
>   if = "none"
>   id = "disk1"
>   cache = "none"
>   aio = "native"
>   format = "raw"
>   file = "/dev/sda"
> 
> [device "disk1"]
>   driver = "scsi-hd"
>   drive = "disk1"
>   scsi-id = "1"
>   removable = "on"
>   vendor = "gandi.net"
>   dpofua = "off"
> 
> I'm now testing device removable without any problem:
> 
> (QEMU) device_del id=disk1
> {   u'return': {   }}
> (QEMU) 
> {u'timestamp': {u'seconds': 1392645815, u'microseconds': 484557}, u'data': {u'device': u'disk1', u'path': u'/machine/peripheral/disk1'}, u'event': u'DEVICE_DELETED'}
> 
> 
> then, I want to readd the disk, without anyproblem too (with the same
> id):
> 
> { "execute": "blockdev-add", "arguments": {'options' : {'driver': 'raw', 'id':'disk1', 'file': {'driver': 'file', 'filename': '/dev/sda'}}} }
> { "device_add", "arguments": {'driver':'scsi-hd', 'drive':'disk1', 'scsi-i':1, 'removable':on} }

Is 'scsi-i' a typo?  I guess you mean 'scsi-id'.

Also, it should probably be 'removable':true?

You forgot to give the device an ID.  Could that be the problem here?

> The issue is when I want to hot remove the disk again:
> 
> (QEMU) device_del id=disk1
> {   u'error': {   u'class': u'DeviceNotFound',
>                   u'desc': u"Device 'disk1' not found"}}
> 
> the output of query-block is the same everywhere:
> 
>                    {   u'device': u'disk1',
>                        u'inserted': {   u'backing_file_depth': 0,
>                                         u'bps': 0,
>                                         u'bps_rd': 0,
>                                         u'bps_wr': 0,
>                                         u'drv': u'raw',
>                                         u'encrypted': False,
>                                         u'encryption_key_missing': False,
>                                         u'file': u'/dev/sda',
>                                         u'image': {   u'actual-size': 0,
>                                                       u'dirty-flag': False,
>                                                       u'filename': u'/dev/sda',
>                                                       u'format': u'raw',
>                                                       u'virtual-size': 3221225472},
>                                         u'iops': 0,
>                                         u'iops_rd': 0,
>                                         u'iops_wr': 0,
>                                         u'ro': False},
>                        u'io-status': u'ok',
>                        u'locked': False,
>                        u'removable': True,
>                        u'tray_open': False,
>                        u'type': u'unknown'}]}

If the problem persists, please rerun the test with -drive
id=drive-disk1 and -device id=device-disk1.  That way it will be easier
to interpret the output.  It's confusing when both the drive and the
device are called "disk1".

Thanks,
Stefan

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] device_del id missing after blockdev-add
  2014-02-24 15:34 ` Stefan Hajnoczi
@ 2014-02-25 11:20   ` William Dauchy
  0 siblings, 0 replies; 3+ messages in thread
From: William Dauchy @ 2014-02-25 11:20 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: kwolf, imain, qemu-devel, William Dauchy

[-- Attachment #1: Type: text/plain, Size: 447 bytes --]

On Feb24 16:34, Stefan Hajnoczi wrote:
> Also, it should probably be 'removable':true?

oh true, did not mention this was a boolean

> You forgot to give the device an ID.  Could that be the problem here?

yup I spotted that some days after and forgot to write an answer here.
that's solved the issue.
I was indeed confused with drive/id attributes.

Thanks for you answer, I thought it my issue was drowned into the ML.
-- 
William

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-02-25 11:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-17 15:36 [Qemu-devel] device_del id missing after blockdev-add William Dauchy
2014-02-24 15:34 ` Stefan Hajnoczi
2014-02-25 11:20   ` William Dauchy

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.