All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [Bug 1799766] [NEW] -device does not work as -drive do
@ 2018-10-24 18:53 Hibou57 (Yannick Duchêne)
  2018-10-25 15:46 ` [Qemu-devel] [Bug 1799766] " Max Reitz
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Hibou57 (Yannick Duchêne) @ 2018-10-24 18:53 UTC (permalink / raw)
  To: qemu-devel

Public bug reported:

Copy/paste of https://stackoverflow.com/questions/52929723/qemu-eject-
complains-device-is-not-found-while-it-is-there , since I found this bug
trying to find an answer to an own question on Stack Overflow.

Below, what was my question the answer I wrote, all exposes the bug.

====================================================================


I need to eject a floppy from QEmu 3.0 monitor, but the command surprisingly fails complaining the device is not found, while it is really there.

Listing of devices:

    (qemu) info block
    fda: dos-6-22/Dos622-1.img (raw)
        Attached to:      /machine/unattached/device[11]
        Removable device: not locked, tray closed
        Cache mode:       writeback

    hda: hda.img (raw)
        Attached to:      /machine/peripheral-anon/device[1]
        Cache mode:       writeback

Eject command result:

    (qemu) eject fda
    Device 'fda' not found

This is so although this documentation says this is how I have to do:
https://www.linux-kvm.org/page/Change_cdrom (just that I want to eject
the floppy instead of the CD‑ROM).

The `change` command complains the same:

    (qemu) change fda dos-6-22/Dos622-2.img raw
    Device 'fda' not found

Is this a bug or me doing something wrong?

I tried using different node names, with always the same result.

====================================================================

I’m posting as an answer, but I’m not strictly sure. I can just say, if
I understand correctly, this is a bug.

The answer comes in two parts.

First part, is a stripped down failing invocation:

    qemu-system-i386 \
       -monitor stdio \
       -machine type=isapc,vmport=off \
       -blockdev driver=file,node-name=fda-img,filename=fda.img \
       -blockdev driver=raw,node-name=fda,file=fda-img \
       -global isa-fdc.driveA=fda

    (qemu) info block
    ide1-cd0: [not inserted]
        Attached to:      /machine/unattached/device[19]
        Removable device: not locked, tray closed

    sd0: [not inserted]
        Removable device: not locked, tray closed

    fda: fda.img (raw)
        Attached to:      /machine/unattached/device[13]
        Removable device: not locked, tray closed
        Cache mode:       writeback
    (qemu) eject fda
    Device 'fda' not found

Second part, is the same without the last argument `-global isa-
fdc.driveA=fda`:

    qemu-system-i386 \
       -monitor stdio \
       -machine type=isapc,vmport=off \
       -blockdev driver=file,node-name=fda-img,filename=fda.img \
       -blockdev driver=raw,node-name=fda,file=fda-img

    (qemu) info block
    ide1-cd0: [not inserted]
        Attached to:      /machine/unattached/device[19]
        Removable device: not locked, tray closed

    floppy0: [not inserted]
        Attached to:      /machine/unattached/device[13]
        Removable device: not locked, tray closed

    sd0: [not inserted]
        Removable device: not locked, tray closed
    (qemu) eject floppy0

There is more error when `-global isa-fdc.driveA=fda` is removed.
However, the documentation says:

> -global driver=driver,property=property,value=value
> Set default value of driver’s property prop to value, e.g.:

> qemu-system-i386 -global ide-hd.physical_block_size=4096 disk-image.img
> In particular, you can **use this to set driver properties for devices which are created automatically by the machine model**. To create a device which is not created automatically and set properties on it, use -device.

> -global driver.prop=value is shorthand for -global
driver=driver,property=prop,value=value. The longhand syntax works even
when driver contains a dot.

What I put a stress on in the quote, suggest I’m not misusing `-global`
and that’s most probably a bug.

**Update for more details:**

It seems using `-drive` instead of `-device` and `driveA` assignment,
the result is not the same, although RedHat documentation recommands
using `-device` instead of `-drive` and QEmu 3.0 documentation says
`-drive` is essentially a shortcut for `-device` (“essentially”, not
telling about the difference).

Below, two cases, with an except of `info block` and an excerpt of `info
qtree`.

With this one, `eject floppy0` works:

    qemu-system-i386 \
       -monitor stdio \
       -machine type=isapc,vmport=off \
       -drive format=raw,if=floppy,media=disk,file=fda.img \
       -device isa-vga,vgamem_mb=1 \
       -serial msmouse

    […]

    floppy0 (#block156): fda.img (raw)
        Attached to:      /machine/unattached/device[12]
        Removable device: not locked, tray closed
        Cache mode:       writeback

    […]

      dev: isa-fdc, id ""
        iobase = 1008 (0x3f0)
        irq = 6 (0x6)
        dma = 2 (0x2)
        driveA = ""
        driveB = ""
        check_media_rate = true
        fdtypeA = "auto"
        fdtypeB = "auto"
        fallback = "288"
        isa irq 6
        bus: floppy-bus.0
          type floppy-bus
          dev: floppy, id ""
            unit = 0 (0x0)
            drive = "floppy0"
            logical_block_size = 512 (0x200)
            physical_block_size = 512 (0x200)
            min_io_size = 0 (0x0)
            opt_io_size = 0 (0x0)
            discard_granularity = 4294967295 (0xffffffff)
            write-cache = "auto"
            share-rw = false
            drive-type = "144"

With this one, `eject fda` does not work:

    qemu-system-i386 \
       -monitor stdio \
       -machine type=isapc,vmport=off \
       -blockdev driver=file,node-name=fda-img,filename=fda.img \
       -blockdev driver=raw,node-name=fda,file=fda-img \
       -global isa-fdc.driveA=fda \
       -device isa-vga,vgamem_mb=1 \
       -serial msmouse

    […]

    fda: fda.img (raw)
        Attached to:      /machine/unattached/device[12]
        Removable device: not locked, tray closed
        Cache mode:       writeback

    […]

      dev: isa-fdc, id ""
        iobase = 1008 (0x3f0)
        irq = 6 (0x6)
        dma = 2 (0x2)
        driveA = ""
        driveB = ""
        check_media_rate = true
        fdtypeA = "auto"
        fdtypeB = "auto"
        fallback = "288"
        isa irq 6
        bus: floppy-bus.0
          type floppy-bus
          dev: floppy, id ""
            unit = 0 (0x0)
            drive = "fda"
            logical_block_size = 512 (0x200)
            physical_block_size = 512 (0x200)
            min_io_size = 0 (0x0)
            opt_io_size = 0 (0x0)
            discard_granularity = 4294967295 (0xffffffff)
            write-cache = "auto"
            share-rw = false
            drive-type = "144"

** Affects: qemu
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1799766

Title:
  -device does not work as -drive do

Status in QEMU:
  New

Bug description:
  Copy/paste of https://stackoverflow.com/questions/52929723/qemu-eject-
  complains-device-is-not-found-while-it-is-there , since I found this
  bug trying to find an answer to an own question on Stack Overflow.

  Below, what was my question the answer I wrote, all exposes the bug.

  ====================================================================

  
  I need to eject a floppy from QEmu 3.0 monitor, but the command surprisingly fails complaining the device is not found, while it is really there.

  Listing of devices:

      (qemu) info block
      fda: dos-6-22/Dos622-1.img (raw)
          Attached to:      /machine/unattached/device[11]
          Removable device: not locked, tray closed
          Cache mode:       writeback

      hda: hda.img (raw)
          Attached to:      /machine/peripheral-anon/device[1]
          Cache mode:       writeback

  Eject command result:

      (qemu) eject fda
      Device 'fda' not found

  This is so although this documentation says this is how I have to do:
  https://www.linux-kvm.org/page/Change_cdrom (just that I want to eject
  the floppy instead of the CD‑ROM).

  The `change` command complains the same:

      (qemu) change fda dos-6-22/Dos622-2.img raw
      Device 'fda' not found

  Is this a bug or me doing something wrong?

  I tried using different node names, with always the same result.

  ====================================================================

  I’m posting as an answer, but I’m not strictly sure. I can just say,
  if I understand correctly, this is a bug.

  The answer comes in two parts.

  First part, is a stripped down failing invocation:

      qemu-system-i386 \
         -monitor stdio \
         -machine type=isapc,vmport=off \
         -blockdev driver=file,node-name=fda-img,filename=fda.img \
         -blockdev driver=raw,node-name=fda,file=fda-img \
         -global isa-fdc.driveA=fda

      (qemu) info block
      ide1-cd0: [not inserted]
          Attached to:      /machine/unattached/device[19]
          Removable device: not locked, tray closed

      sd0: [not inserted]
          Removable device: not locked, tray closed

      fda: fda.img (raw)
          Attached to:      /machine/unattached/device[13]
          Removable device: not locked, tray closed
          Cache mode:       writeback
      (qemu) eject fda
      Device 'fda' not found

  Second part, is the same without the last argument `-global isa-
  fdc.driveA=fda`:

      qemu-system-i386 \
         -monitor stdio \
         -machine type=isapc,vmport=off \
         -blockdev driver=file,node-name=fda-img,filename=fda.img \
         -blockdev driver=raw,node-name=fda,file=fda-img

      (qemu) info block
      ide1-cd0: [not inserted]
          Attached to:      /machine/unattached/device[19]
          Removable device: not locked, tray closed

      floppy0: [not inserted]
          Attached to:      /machine/unattached/device[13]
          Removable device: not locked, tray closed

      sd0: [not inserted]
          Removable device: not locked, tray closed
      (qemu) eject floppy0

  There is more error when `-global isa-fdc.driveA=fda` is removed.
  However, the documentation says:

  > -global driver=driver,property=property,value=value
  > Set default value of driver’s property prop to value, e.g.:

  > qemu-system-i386 -global ide-hd.physical_block_size=4096 disk-image.img
  > In particular, you can **use this to set driver properties for devices which are created automatically by the machine model**. To create a device which is not created automatically and set properties on it, use -device.

  > -global driver.prop=value is shorthand for -global
  driver=driver,property=prop,value=value. The longhand syntax works
  even when driver contains a dot.

  What I put a stress on in the quote, suggest I’m not misusing
  `-global` and that’s most probably a bug.

  **Update for more details:**

  It seems using `-drive` instead of `-device` and `driveA` assignment,
  the result is not the same, although RedHat documentation recommands
  using `-device` instead of `-drive` and QEmu 3.0 documentation says
  `-drive` is essentially a shortcut for `-device` (“essentially”, not
  telling about the difference).

  Below, two cases, with an except of `info block` and an excerpt of
  `info qtree`.

  With this one, `eject floppy0` works:

      qemu-system-i386 \
         -monitor stdio \
         -machine type=isapc,vmport=off \
         -drive format=raw,if=floppy,media=disk,file=fda.img \
         -device isa-vga,vgamem_mb=1 \
         -serial msmouse

      […]

      floppy0 (#block156): fda.img (raw)
          Attached to:      /machine/unattached/device[12]
          Removable device: not locked, tray closed
          Cache mode:       writeback

      […]

        dev: isa-fdc, id ""
          iobase = 1008 (0x3f0)
          irq = 6 (0x6)
          dma = 2 (0x2)
          driveA = ""
          driveB = ""
          check_media_rate = true
          fdtypeA = "auto"
          fdtypeB = "auto"
          fallback = "288"
          isa irq 6
          bus: floppy-bus.0
            type floppy-bus
            dev: floppy, id ""
              unit = 0 (0x0)
              drive = "floppy0"
              logical_block_size = 512 (0x200)
              physical_block_size = 512 (0x200)
              min_io_size = 0 (0x0)
              opt_io_size = 0 (0x0)
              discard_granularity = 4294967295 (0xffffffff)
              write-cache = "auto"
              share-rw = false
              drive-type = "144"

  With this one, `eject fda` does not work:

      qemu-system-i386 \
         -monitor stdio \
         -machine type=isapc,vmport=off \
         -blockdev driver=file,node-name=fda-img,filename=fda.img \
         -blockdev driver=raw,node-name=fda,file=fda-img \
         -global isa-fdc.driveA=fda \
         -device isa-vga,vgamem_mb=1 \
         -serial msmouse

      […]

      fda: fda.img (raw)
          Attached to:      /machine/unattached/device[12]
          Removable device: not locked, tray closed
          Cache mode:       writeback

      […]

        dev: isa-fdc, id ""
          iobase = 1008 (0x3f0)
          irq = 6 (0x6)
          dma = 2 (0x2)
          driveA = ""
          driveB = ""
          check_media_rate = true
          fdtypeA = "auto"
          fdtypeB = "auto"
          fallback = "288"
          isa irq 6
          bus: floppy-bus.0
            type floppy-bus
            dev: floppy, id ""
              unit = 0 (0x0)
              drive = "fda"
              logical_block_size = 512 (0x200)
              physical_block_size = 512 (0x200)
              min_io_size = 0 (0x0)
              opt_io_size = 0 (0x0)
              discard_granularity = 4294967295 (0xffffffff)
              write-cache = "auto"
              share-rw = false
              drive-type = "144"

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1799766/+subscriptions

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

* [Qemu-devel] [Bug 1799766] Re: -device does not work as -drive do
  2018-10-24 18:53 [Qemu-devel] [Bug 1799766] [NEW] -device does not work as -drive do Hibou57 (Yannick Duchêne)
@ 2018-10-25 15:46 ` Max Reitz
  2018-10-25 17:30 ` Hibou57 (Yannick Duchêne)
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Max Reitz @ 2018-10-25 15:46 UTC (permalink / raw)
  To: qemu-devel

Hi,

As you yourself say, -drive does work, so this is really not about
-drive, but about -blockdev.

-drive creates part of the device as well, so to speak, whereas
-blockdev only creates one (or more) nodes in the block layer.  You can
only eject something from devices, however, so you cannot eject a
blockdev.  So yes, there is a difference between -drive and -blockdev.

If you want to use eject, you either have to use -drive (which is
legacy), or you eject the ID given to -device (because you eject the
device).  However, you haven't even used -device, but you just used
-global (which doesn't allow giving an ID).

As you can see from "info block", there is still a QOM path that you
could in theory use, too.  So you probably could also "eject
/machine/unattached/device[12]" (in the last example).

In practice, you should probably do this:

$ qemu-system-i386 \
       -blockdev driver=file,node-name=fda-img,filename=fda.img \
       -blockdev driver=raw,node-name=fda,file=fda-img \
       -device floppy,id=floppy,drive=fda \
       -monitor stdio
(qemu) info block
[...]
fda: fda.img (raw)
    Attached to:      floppy
    Removable device: not locked, tray closed
    Cache mode:       writeback
(qemu) eject floppy
Device 'floppy' not found

Oops.

Well, it works with QMP:

{'execute':'eject','arguments':{'id':'floppy'}}
{"return": {}}

So there is indeed a bug, although it's not the one you're reporting.
The bug is that HMP's eject does not accept a -device ID (but only a
-drive ID).

Max

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1799766

Title:
  -device does not work as -drive do

Status in QEMU:
  New

Bug description:
  Copy/paste of https://stackoverflow.com/questions/52929723/qemu-eject-
  complains-device-is-not-found-while-it-is-there , since I found this
  bug trying to find an answer to an own question on Stack Overflow.

  Below, what was my question the answer I wrote, all exposes the bug.

  ====================================================================

  
  I need to eject a floppy from QEmu 3.0 monitor, but the command surprisingly fails complaining the device is not found, while it is really there.

  Listing of devices:

      (qemu) info block
      fda: dos-6-22/Dos622-1.img (raw)
          Attached to:      /machine/unattached/device[11]
          Removable device: not locked, tray closed
          Cache mode:       writeback

      hda: hda.img (raw)
          Attached to:      /machine/peripheral-anon/device[1]
          Cache mode:       writeback

  Eject command result:

      (qemu) eject fda
      Device 'fda' not found

  This is so although this documentation says this is how I have to do:
  https://www.linux-kvm.org/page/Change_cdrom (just that I want to eject
  the floppy instead of the CD‑ROM).

  The `change` command complains the same:

      (qemu) change fda dos-6-22/Dos622-2.img raw
      Device 'fda' not found

  Is this a bug or me doing something wrong?

  I tried using different node names, with always the same result.

  ====================================================================

  I’m posting as an answer, but I’m not strictly sure. I can just say,
  if I understand correctly, this is a bug.

  The answer comes in two parts.

  First part, is a stripped down failing invocation:

      qemu-system-i386 \
         -monitor stdio \
         -machine type=isapc,vmport=off \
         -blockdev driver=file,node-name=fda-img,filename=fda.img \
         -blockdev driver=raw,node-name=fda,file=fda-img \
         -global isa-fdc.driveA=fda

      (qemu) info block
      ide1-cd0: [not inserted]
          Attached to:      /machine/unattached/device[19]
          Removable device: not locked, tray closed

      sd0: [not inserted]
          Removable device: not locked, tray closed

      fda: fda.img (raw)
          Attached to:      /machine/unattached/device[13]
          Removable device: not locked, tray closed
          Cache mode:       writeback
      (qemu) eject fda
      Device 'fda' not found

  Second part, is the same without the last argument `-global isa-
  fdc.driveA=fda`:

      qemu-system-i386 \
         -monitor stdio \
         -machine type=isapc,vmport=off \
         -blockdev driver=file,node-name=fda-img,filename=fda.img \
         -blockdev driver=raw,node-name=fda,file=fda-img

      (qemu) info block
      ide1-cd0: [not inserted]
          Attached to:      /machine/unattached/device[19]
          Removable device: not locked, tray closed

      floppy0: [not inserted]
          Attached to:      /machine/unattached/device[13]
          Removable device: not locked, tray closed

      sd0: [not inserted]
          Removable device: not locked, tray closed
      (qemu) eject floppy0

  There is more error when `-global isa-fdc.driveA=fda` is removed.
  However, the documentation says:

  > -global driver=driver,property=property,value=value
  > Set default value of driver’s property prop to value, e.g.:

  > qemu-system-i386 -global ide-hd.physical_block_size=4096 disk-image.img
  > In particular, you can **use this to set driver properties for devices which are created automatically by the machine model**. To create a device which is not created automatically and set properties on it, use -device.

  > -global driver.prop=value is shorthand for -global
  driver=driver,property=prop,value=value. The longhand syntax works
  even when driver contains a dot.

  What I put a stress on in the quote, suggest I’m not misusing
  `-global` and that’s most probably a bug.

  **Update for more details:**

  It seems using `-drive` instead of `-device` and `driveA` assignment,
  the result is not the same, although RedHat documentation recommands
  using `-device` instead of `-drive` and QEmu 3.0 documentation says
  `-drive` is essentially a shortcut for `-device` (“essentially”, not
  telling about the difference).

  Below, two cases, with an except of `info block` and an excerpt of
  `info qtree`.

  With this one, `eject floppy0` works:

      qemu-system-i386 \
         -monitor stdio \
         -machine type=isapc,vmport=off \
         -drive format=raw,if=floppy,media=disk,file=fda.img \
         -device isa-vga,vgamem_mb=1 \
         -serial msmouse

      […]

      floppy0 (#block156): fda.img (raw)
          Attached to:      /machine/unattached/device[12]
          Removable device: not locked, tray closed
          Cache mode:       writeback

      […]

        dev: isa-fdc, id ""
          iobase = 1008 (0x3f0)
          irq = 6 (0x6)
          dma = 2 (0x2)
          driveA = ""
          driveB = ""
          check_media_rate = true
          fdtypeA = "auto"
          fdtypeB = "auto"
          fallback = "288"
          isa irq 6
          bus: floppy-bus.0
            type floppy-bus
            dev: floppy, id ""
              unit = 0 (0x0)
              drive = "floppy0"
              logical_block_size = 512 (0x200)
              physical_block_size = 512 (0x200)
              min_io_size = 0 (0x0)
              opt_io_size = 0 (0x0)
              discard_granularity = 4294967295 (0xffffffff)
              write-cache = "auto"
              share-rw = false
              drive-type = "144"

  With this one, `eject fda` does not work:

      qemu-system-i386 \
         -monitor stdio \
         -machine type=isapc,vmport=off \
         -blockdev driver=file,node-name=fda-img,filename=fda.img \
         -blockdev driver=raw,node-name=fda,file=fda-img \
         -global isa-fdc.driveA=fda \
         -device isa-vga,vgamem_mb=1 \
         -serial msmouse

      […]

      fda: fda.img (raw)
          Attached to:      /machine/unattached/device[12]
          Removable device: not locked, tray closed
          Cache mode:       writeback

      […]

        dev: isa-fdc, id ""
          iobase = 1008 (0x3f0)
          irq = 6 (0x6)
          dma = 2 (0x2)
          driveA = ""
          driveB = ""
          check_media_rate = true
          fdtypeA = "auto"
          fdtypeB = "auto"
          fallback = "288"
          isa irq 6
          bus: floppy-bus.0
            type floppy-bus
            dev: floppy, id ""
              unit = 0 (0x0)
              drive = "fda"
              logical_block_size = 512 (0x200)
              physical_block_size = 512 (0x200)
              min_io_size = 0 (0x0)
              opt_io_size = 0 (0x0)
              discard_granularity = 4294967295 (0xffffffff)
              write-cache = "auto"
              share-rw = false
              drive-type = "144"

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1799766/+subscriptions

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

* [Qemu-devel] [Bug 1799766] Re: -device does not work as -drive do
  2018-10-24 18:53 [Qemu-devel] [Bug 1799766] [NEW] -device does not work as -drive do Hibou57 (Yannick Duchêne)
  2018-10-25 15:46 ` [Qemu-devel] [Bug 1799766] " Max Reitz
@ 2018-10-25 17:30 ` Hibou57 (Yannick Duchêne)
  2021-04-20  8:08 ` Thomas Huth
  2021-06-20  4:17 ` Launchpad Bug Tracker
  3 siblings, 0 replies; 5+ messages in thread
From: Hibou57 (Yannick Duchêne) @ 2018-10-25 17:30 UTC (permalink / raw)
  To: qemu-devel

Yes, I messed up with `-device`, because I initially tried to do it with
`-device`, later rely only on automatically created device, and so had
automatically created devices.

Thanks for you rich comment, I will study it.

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1799766

Title:
  -device does not work as -drive do

Status in QEMU:
  New

Bug description:
  Copy/paste of https://stackoverflow.com/questions/52929723/qemu-eject-
  complains-device-is-not-found-while-it-is-there , since I found this
  bug trying to find an answer to an own question on Stack Overflow.

  Below, what was my question the answer I wrote, all exposes the bug.

  ====================================================================

  
  I need to eject a floppy from QEmu 3.0 monitor, but the command surprisingly fails complaining the device is not found, while it is really there.

  Listing of devices:

      (qemu) info block
      fda: dos-6-22/Dos622-1.img (raw)
          Attached to:      /machine/unattached/device[11]
          Removable device: not locked, tray closed
          Cache mode:       writeback

      hda: hda.img (raw)
          Attached to:      /machine/peripheral-anon/device[1]
          Cache mode:       writeback

  Eject command result:

      (qemu) eject fda
      Device 'fda' not found

  This is so although this documentation says this is how I have to do:
  https://www.linux-kvm.org/page/Change_cdrom (just that I want to eject
  the floppy instead of the CD‑ROM).

  The `change` command complains the same:

      (qemu) change fda dos-6-22/Dos622-2.img raw
      Device 'fda' not found

  Is this a bug or me doing something wrong?

  I tried using different node names, with always the same result.

  ====================================================================

  I’m posting as an answer, but I’m not strictly sure. I can just say,
  if I understand correctly, this is a bug.

  The answer comes in two parts.

  First part, is a stripped down failing invocation:

      qemu-system-i386 \
         -monitor stdio \
         -machine type=isapc,vmport=off \
         -blockdev driver=file,node-name=fda-img,filename=fda.img \
         -blockdev driver=raw,node-name=fda,file=fda-img \
         -global isa-fdc.driveA=fda

      (qemu) info block
      ide1-cd0: [not inserted]
          Attached to:      /machine/unattached/device[19]
          Removable device: not locked, tray closed

      sd0: [not inserted]
          Removable device: not locked, tray closed

      fda: fda.img (raw)
          Attached to:      /machine/unattached/device[13]
          Removable device: not locked, tray closed
          Cache mode:       writeback
      (qemu) eject fda
      Device 'fda' not found

  Second part, is the same without the last argument `-global isa-
  fdc.driveA=fda`:

      qemu-system-i386 \
         -monitor stdio \
         -machine type=isapc,vmport=off \
         -blockdev driver=file,node-name=fda-img,filename=fda.img \
         -blockdev driver=raw,node-name=fda,file=fda-img

      (qemu) info block
      ide1-cd0: [not inserted]
          Attached to:      /machine/unattached/device[19]
          Removable device: not locked, tray closed

      floppy0: [not inserted]
          Attached to:      /machine/unattached/device[13]
          Removable device: not locked, tray closed

      sd0: [not inserted]
          Removable device: not locked, tray closed
      (qemu) eject floppy0

  There is more error when `-global isa-fdc.driveA=fda` is removed.
  However, the documentation says:

  > -global driver=driver,property=property,value=value
  > Set default value of driver’s property prop to value, e.g.:

  > qemu-system-i386 -global ide-hd.physical_block_size=4096 disk-image.img
  > In particular, you can **use this to set driver properties for devices which are created automatically by the machine model**. To create a device which is not created automatically and set properties on it, use -device.

  > -global driver.prop=value is shorthand for -global
  driver=driver,property=prop,value=value. The longhand syntax works
  even when driver contains a dot.

  What I put a stress on in the quote, suggest I’m not misusing
  `-global` and that’s most probably a bug.

  **Update for more details:**

  It seems using `-drive` instead of `-device` and `driveA` assignment,
  the result is not the same, although RedHat documentation recommands
  using `-device` instead of `-drive` and QEmu 3.0 documentation says
  `-drive` is essentially a shortcut for `-device` (“essentially”, not
  telling about the difference).

  Below, two cases, with an except of `info block` and an excerpt of
  `info qtree`.

  With this one, `eject floppy0` works:

      qemu-system-i386 \
         -monitor stdio \
         -machine type=isapc,vmport=off \
         -drive format=raw,if=floppy,media=disk,file=fda.img \
         -device isa-vga,vgamem_mb=1 \
         -serial msmouse

      […]

      floppy0 (#block156): fda.img (raw)
          Attached to:      /machine/unattached/device[12]
          Removable device: not locked, tray closed
          Cache mode:       writeback

      […]

        dev: isa-fdc, id ""
          iobase = 1008 (0x3f0)
          irq = 6 (0x6)
          dma = 2 (0x2)
          driveA = ""
          driveB = ""
          check_media_rate = true
          fdtypeA = "auto"
          fdtypeB = "auto"
          fallback = "288"
          isa irq 6
          bus: floppy-bus.0
            type floppy-bus
            dev: floppy, id ""
              unit = 0 (0x0)
              drive = "floppy0"
              logical_block_size = 512 (0x200)
              physical_block_size = 512 (0x200)
              min_io_size = 0 (0x0)
              opt_io_size = 0 (0x0)
              discard_granularity = 4294967295 (0xffffffff)
              write-cache = "auto"
              share-rw = false
              drive-type = "144"

  With this one, `eject fda` does not work:

      qemu-system-i386 \
         -monitor stdio \
         -machine type=isapc,vmport=off \
         -blockdev driver=file,node-name=fda-img,filename=fda.img \
         -blockdev driver=raw,node-name=fda,file=fda-img \
         -global isa-fdc.driveA=fda \
         -device isa-vga,vgamem_mb=1 \
         -serial msmouse

      […]

      fda: fda.img (raw)
          Attached to:      /machine/unattached/device[12]
          Removable device: not locked, tray closed
          Cache mode:       writeback

      […]

        dev: isa-fdc, id ""
          iobase = 1008 (0x3f0)
          irq = 6 (0x6)
          dma = 2 (0x2)
          driveA = ""
          driveB = ""
          check_media_rate = true
          fdtypeA = "auto"
          fdtypeB = "auto"
          fallback = "288"
          isa irq 6
          bus: floppy-bus.0
            type floppy-bus
            dev: floppy, id ""
              unit = 0 (0x0)
              drive = "fda"
              logical_block_size = 512 (0x200)
              physical_block_size = 512 (0x200)
              min_io_size = 0 (0x0)
              opt_io_size = 0 (0x0)
              discard_granularity = 4294967295 (0xffffffff)
              write-cache = "auto"
              share-rw = false
              drive-type = "144"

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1799766/+subscriptions

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

* [Bug 1799766] Re: -device does not work as -drive do
  2018-10-24 18:53 [Qemu-devel] [Bug 1799766] [NEW] -device does not work as -drive do Hibou57 (Yannick Duchêne)
  2018-10-25 15:46 ` [Qemu-devel] [Bug 1799766] " Max Reitz
  2018-10-25 17:30 ` Hibou57 (Yannick Duchêne)
@ 2021-04-20  8:08 ` Thomas Huth
  2021-06-20  4:17 ` Launchpad Bug Tracker
  3 siblings, 0 replies; 5+ messages in thread
From: Thomas Huth @ 2021-04-20  8:08 UTC (permalink / raw)
  To: qemu-devel

The QEMU project is currently considering to move its bug tracking to another system. For this we need to know which bugs are still valid and which could be closed already. Thus we are setting older bugs to "Incomplete" now.
If you still think this bug report here is valid, then please switch the state back to "New" within the next 60 days, otherwise this report will be marked as "Expired". Or mark it as "Fix Released" if the problem has been solved with a newer version of QEMU already. Thank you and sorry for the inconvenience.

** Changed in: qemu
       Status: New => Incomplete

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1799766

Title:
  -device does not work as -drive do

Status in QEMU:
  Incomplete

Bug description:
  Copy/paste of https://stackoverflow.com/questions/52929723/qemu-eject-
  complains-device-is-not-found-while-it-is-there , since I found this
  bug trying to find an answer to an own question on Stack Overflow.

  Below, what was my question the answer I wrote, all exposes the bug.

  ====================================================================

  
  I need to eject a floppy from QEmu 3.0 monitor, but the command surprisingly fails complaining the device is not found, while it is really there.

  Listing of devices:

      (qemu) info block
      fda: dos-6-22/Dos622-1.img (raw)
          Attached to:      /machine/unattached/device[11]
          Removable device: not locked, tray closed
          Cache mode:       writeback

      hda: hda.img (raw)
          Attached to:      /machine/peripheral-anon/device[1]
          Cache mode:       writeback

  Eject command result:

      (qemu) eject fda
      Device 'fda' not found

  This is so although this documentation says this is how I have to do:
  https://www.linux-kvm.org/page/Change_cdrom (just that I want to eject
  the floppy instead of the CD‑ROM).

  The `change` command complains the same:

      (qemu) change fda dos-6-22/Dos622-2.img raw
      Device 'fda' not found

  Is this a bug or me doing something wrong?

  I tried using different node names, with always the same result.

  ====================================================================

  I’m posting as an answer, but I’m not strictly sure. I can just say,
  if I understand correctly, this is a bug.

  The answer comes in two parts.

  First part, is a stripped down failing invocation:

      qemu-system-i386 \
         -monitor stdio \
         -machine type=isapc,vmport=off \
         -blockdev driver=file,node-name=fda-img,filename=fda.img \
         -blockdev driver=raw,node-name=fda,file=fda-img \
         -global isa-fdc.driveA=fda

      (qemu) info block
      ide1-cd0: [not inserted]
          Attached to:      /machine/unattached/device[19]
          Removable device: not locked, tray closed

      sd0: [not inserted]
          Removable device: not locked, tray closed

      fda: fda.img (raw)
          Attached to:      /machine/unattached/device[13]
          Removable device: not locked, tray closed
          Cache mode:       writeback
      (qemu) eject fda
      Device 'fda' not found

  Second part, is the same without the last argument `-global isa-
  fdc.driveA=fda`:

      qemu-system-i386 \
         -monitor stdio \
         -machine type=isapc,vmport=off \
         -blockdev driver=file,node-name=fda-img,filename=fda.img \
         -blockdev driver=raw,node-name=fda,file=fda-img

      (qemu) info block
      ide1-cd0: [not inserted]
          Attached to:      /machine/unattached/device[19]
          Removable device: not locked, tray closed

      floppy0: [not inserted]
          Attached to:      /machine/unattached/device[13]
          Removable device: not locked, tray closed

      sd0: [not inserted]
          Removable device: not locked, tray closed
      (qemu) eject floppy0

  There is more error when `-global isa-fdc.driveA=fda` is removed.
  However, the documentation says:

  > -global driver=driver,property=property,value=value
  > Set default value of driver’s property prop to value, e.g.:

  > qemu-system-i386 -global ide-hd.physical_block_size=4096 disk-image.img
  > In particular, you can **use this to set driver properties for devices which are created automatically by the machine model**. To create a device which is not created automatically and set properties on it, use -device.

  > -global driver.prop=value is shorthand for -global
  driver=driver,property=prop,value=value. The longhand syntax works
  even when driver contains a dot.

  What I put a stress on in the quote, suggest I’m not misusing
  `-global` and that’s most probably a bug.

  **Update for more details:**

  It seems using `-drive` instead of `-device` and `driveA` assignment,
  the result is not the same, although RedHat documentation recommands
  using `-device` instead of `-drive` and QEmu 3.0 documentation says
  `-drive` is essentially a shortcut for `-device` (“essentially”, not
  telling about the difference).

  Below, two cases, with an except of `info block` and an excerpt of
  `info qtree`.

  With this one, `eject floppy0` works:

      qemu-system-i386 \
         -monitor stdio \
         -machine type=isapc,vmport=off \
         -drive format=raw,if=floppy,media=disk,file=fda.img \
         -device isa-vga,vgamem_mb=1 \
         -serial msmouse

      […]

      floppy0 (#block156): fda.img (raw)
          Attached to:      /machine/unattached/device[12]
          Removable device: not locked, tray closed
          Cache mode:       writeback

      […]

        dev: isa-fdc, id ""
          iobase = 1008 (0x3f0)
          irq = 6 (0x6)
          dma = 2 (0x2)
          driveA = ""
          driveB = ""
          check_media_rate = true
          fdtypeA = "auto"
          fdtypeB = "auto"
          fallback = "288"
          isa irq 6
          bus: floppy-bus.0
            type floppy-bus
            dev: floppy, id ""
              unit = 0 (0x0)
              drive = "floppy0"
              logical_block_size = 512 (0x200)
              physical_block_size = 512 (0x200)
              min_io_size = 0 (0x0)
              opt_io_size = 0 (0x0)
              discard_granularity = 4294967295 (0xffffffff)
              write-cache = "auto"
              share-rw = false
              drive-type = "144"

  With this one, `eject fda` does not work:

      qemu-system-i386 \
         -monitor stdio \
         -machine type=isapc,vmport=off \
         -blockdev driver=file,node-name=fda-img,filename=fda.img \
         -blockdev driver=raw,node-name=fda,file=fda-img \
         -global isa-fdc.driveA=fda \
         -device isa-vga,vgamem_mb=1 \
         -serial msmouse

      […]

      fda: fda.img (raw)
          Attached to:      /machine/unattached/device[12]
          Removable device: not locked, tray closed
          Cache mode:       writeback

      […]

        dev: isa-fdc, id ""
          iobase = 1008 (0x3f0)
          irq = 6 (0x6)
          dma = 2 (0x2)
          driveA = ""
          driveB = ""
          check_media_rate = true
          fdtypeA = "auto"
          fdtypeB = "auto"
          fallback = "288"
          isa irq 6
          bus: floppy-bus.0
            type floppy-bus
            dev: floppy, id ""
              unit = 0 (0x0)
              drive = "fda"
              logical_block_size = 512 (0x200)
              physical_block_size = 512 (0x200)
              min_io_size = 0 (0x0)
              opt_io_size = 0 (0x0)
              discard_granularity = 4294967295 (0xffffffff)
              write-cache = "auto"
              share-rw = false
              drive-type = "144"

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1799766/+subscriptions


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

* [Bug 1799766] Re: -device does not work as -drive do
  2018-10-24 18:53 [Qemu-devel] [Bug 1799766] [NEW] -device does not work as -drive do Hibou57 (Yannick Duchêne)
                   ` (2 preceding siblings ...)
  2021-04-20  8:08 ` Thomas Huth
@ 2021-06-20  4:17 ` Launchpad Bug Tracker
  3 siblings, 0 replies; 5+ messages in thread
From: Launchpad Bug Tracker @ 2021-06-20  4:17 UTC (permalink / raw)
  To: qemu-devel

[Expired for QEMU because there has been no activity for 60 days.]

** Changed in: qemu
       Status: Incomplete => Expired

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1799766

Title:
  -device does not work as -drive do

Status in QEMU:
  Expired

Bug description:
  Copy/paste of https://stackoverflow.com/questions/52929723/qemu-eject-
  complains-device-is-not-found-while-it-is-there , since I found this
  bug trying to find an answer to an own question on Stack Overflow.

  Below, what was my question the answer I wrote, all exposes the bug.

  ====================================================================

  
  I need to eject a floppy from QEmu 3.0 monitor, but the command surprisingly fails complaining the device is not found, while it is really there.

  Listing of devices:

      (qemu) info block
      fda: dos-6-22/Dos622-1.img (raw)
          Attached to:      /machine/unattached/device[11]
          Removable device: not locked, tray closed
          Cache mode:       writeback

      hda: hda.img (raw)
          Attached to:      /machine/peripheral-anon/device[1]
          Cache mode:       writeback

  Eject command result:

      (qemu) eject fda
      Device 'fda' not found

  This is so although this documentation says this is how I have to do:
  https://www.linux-kvm.org/page/Change_cdrom (just that I want to eject
  the floppy instead of the CD‑ROM).

  The `change` command complains the same:

      (qemu) change fda dos-6-22/Dos622-2.img raw
      Device 'fda' not found

  Is this a bug or me doing something wrong?

  I tried using different node names, with always the same result.

  ====================================================================

  I’m posting as an answer, but I’m not strictly sure. I can just say,
  if I understand correctly, this is a bug.

  The answer comes in two parts.

  First part, is a stripped down failing invocation:

      qemu-system-i386 \
         -monitor stdio \
         -machine type=isapc,vmport=off \
         -blockdev driver=file,node-name=fda-img,filename=fda.img \
         -blockdev driver=raw,node-name=fda,file=fda-img \
         -global isa-fdc.driveA=fda

      (qemu) info block
      ide1-cd0: [not inserted]
          Attached to:      /machine/unattached/device[19]
          Removable device: not locked, tray closed

      sd0: [not inserted]
          Removable device: not locked, tray closed

      fda: fda.img (raw)
          Attached to:      /machine/unattached/device[13]
          Removable device: not locked, tray closed
          Cache mode:       writeback
      (qemu) eject fda
      Device 'fda' not found

  Second part, is the same without the last argument `-global isa-
  fdc.driveA=fda`:

      qemu-system-i386 \
         -monitor stdio \
         -machine type=isapc,vmport=off \
         -blockdev driver=file,node-name=fda-img,filename=fda.img \
         -blockdev driver=raw,node-name=fda,file=fda-img

      (qemu) info block
      ide1-cd0: [not inserted]
          Attached to:      /machine/unattached/device[19]
          Removable device: not locked, tray closed

      floppy0: [not inserted]
          Attached to:      /machine/unattached/device[13]
          Removable device: not locked, tray closed

      sd0: [not inserted]
          Removable device: not locked, tray closed
      (qemu) eject floppy0

  There is more error when `-global isa-fdc.driveA=fda` is removed.
  However, the documentation says:

  > -global driver=driver,property=property,value=value
  > Set default value of driver’s property prop to value, e.g.:

  > qemu-system-i386 -global ide-hd.physical_block_size=4096 disk-image.img
  > In particular, you can **use this to set driver properties for devices which are created automatically by the machine model**. To create a device which is not created automatically and set properties on it, use -device.

  > -global driver.prop=value is shorthand for -global
  driver=driver,property=prop,value=value. The longhand syntax works
  even when driver contains a dot.

  What I put a stress on in the quote, suggest I’m not misusing
  `-global` and that’s most probably a bug.

  **Update for more details:**

  It seems using `-drive` instead of `-device` and `driveA` assignment,
  the result is not the same, although RedHat documentation recommands
  using `-device` instead of `-drive` and QEmu 3.0 documentation says
  `-drive` is essentially a shortcut for `-device` (“essentially”, not
  telling about the difference).

  Below, two cases, with an except of `info block` and an excerpt of
  `info qtree`.

  With this one, `eject floppy0` works:

      qemu-system-i386 \
         -monitor stdio \
         -machine type=isapc,vmport=off \
         -drive format=raw,if=floppy,media=disk,file=fda.img \
         -device isa-vga,vgamem_mb=1 \
         -serial msmouse

      […]

      floppy0 (#block156): fda.img (raw)
          Attached to:      /machine/unattached/device[12]
          Removable device: not locked, tray closed
          Cache mode:       writeback

      […]

        dev: isa-fdc, id ""
          iobase = 1008 (0x3f0)
          irq = 6 (0x6)
          dma = 2 (0x2)
          driveA = ""
          driveB = ""
          check_media_rate = true
          fdtypeA = "auto"
          fdtypeB = "auto"
          fallback = "288"
          isa irq 6
          bus: floppy-bus.0
            type floppy-bus
            dev: floppy, id ""
              unit = 0 (0x0)
              drive = "floppy0"
              logical_block_size = 512 (0x200)
              physical_block_size = 512 (0x200)
              min_io_size = 0 (0x0)
              opt_io_size = 0 (0x0)
              discard_granularity = 4294967295 (0xffffffff)
              write-cache = "auto"
              share-rw = false
              drive-type = "144"

  With this one, `eject fda` does not work:

      qemu-system-i386 \
         -monitor stdio \
         -machine type=isapc,vmport=off \
         -blockdev driver=file,node-name=fda-img,filename=fda.img \
         -blockdev driver=raw,node-name=fda,file=fda-img \
         -global isa-fdc.driveA=fda \
         -device isa-vga,vgamem_mb=1 \
         -serial msmouse

      […]

      fda: fda.img (raw)
          Attached to:      /machine/unattached/device[12]
          Removable device: not locked, tray closed
          Cache mode:       writeback

      […]

        dev: isa-fdc, id ""
          iobase = 1008 (0x3f0)
          irq = 6 (0x6)
          dma = 2 (0x2)
          driveA = ""
          driveB = ""
          check_media_rate = true
          fdtypeA = "auto"
          fdtypeB = "auto"
          fallback = "288"
          isa irq 6
          bus: floppy-bus.0
            type floppy-bus
            dev: floppy, id ""
              unit = 0 (0x0)
              drive = "fda"
              logical_block_size = 512 (0x200)
              physical_block_size = 512 (0x200)
              min_io_size = 0 (0x0)
              opt_io_size = 0 (0x0)
              discard_granularity = 4294967295 (0xffffffff)
              write-cache = "auto"
              share-rw = false
              drive-type = "144"

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1799766/+subscriptions


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

end of thread, other threads:[~2021-06-20  4:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-24 18:53 [Qemu-devel] [Bug 1799766] [NEW] -device does not work as -drive do Hibou57 (Yannick Duchêne)
2018-10-25 15:46 ` [Qemu-devel] [Bug 1799766] " Max Reitz
2018-10-25 17:30 ` Hibou57 (Yannick Duchêne)
2021-04-20  8:08 ` Thomas Huth
2021-06-20  4:17 ` Launchpad Bug Tracker

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.