Skip to contentSkip to conversation

raw-posix: Deprecate host floppy passthrough

PATCH Applied Markus Armbruster 6 participants 9 messages Mar 17, 2015 – Mar 19, 2015 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 raw-posix: Deprecate host floppy passthrough

Raise your hand if you have a physical floppy drive in a computer you've powered on in 2015. Okay, I see we got a few weirdos in the audience. That's okay, weirdos are welcome here.

Kidding aside, media change detection doesn't fully work, isn't going to be fixed, and floppy passthrough just isn't earning its keep anymore.

Deprecate block driver host_floppy now, so we can drop it after a grace period.

---
 block/raw-posix.c    | 2 ++
 qapi/block-core.json | 2 ++
 qemu-doc.texi        | 5 +++--
 qemu-options.hx      | 3 +--
 qmp-commands.hx      | 2 +-
 5 files changed, 9 insertions(+), 5 deletions(-)
block/raw-posix.c +2 -0
index f0b4488..844ac21 100644
@@ -2387,6 +2387,8 @@ static int floppy_open(BlockDriverState *bs, QDict *options, int flags,
     s->fd = -1;
     s->fd_media_changed = 1;
 
+    error_report("Host floppy pass-through is deprecated");
+    error_printf("Support for it will be removed in a future release.\n");
     return 0;
 }
 
qapi/block-core.json +2 -0
index 42c8850..ac839af 100644
@@ -218,6 +218,7 @@
 #       'host_floppy', 'http', 'https', 'nbd', 'parallels', 'qcow',
 #       'qcow2', 'raw', 'tftp', 'vdi', 'vmdk', 'vpc', 'vvfat'
 #       2.2: 'archipelago' added, 'cow' dropped
+#       2.3: 'host_floppy' deprecated
 #
 # @backing_file: #optional the name of the backing file (for copy-on-write)
 #
@@ -1245,6 +1246,7 @@
 # Drivers that are supported in block device operations.
 #
 # @host_device, @host_cdrom, @host_floppy: Since 2.1
+# @host_floppy: deprecated since 2.3
 #
 # Since: 2.0
 ##
qemu-doc.texi +3 -2
index 8aa6dbf..0125bc7 100644
@@ -736,8 +736,7 @@ devices. We describe here the usage for QEMU version >= 0.8.3.
 
 On Linux, you can directly use the host device filename instead of a
 disk image filename provided you have enough privileges to access
-it. For example, use @file{/dev/cdrom} to access to the CDROM or
-@file{/dev/fd0} for the floppy.
+it. For example, use @file{/dev/cdrom} to access to the CDROM.
 
 @table @code
 @item CD
@@ -749,6 +748,8 @@ You can specify a floppy device even if no floppy is loaded. Floppy
 removal is currently not detected accurately (if you change floppy
 without doing floppy access while the floppy is not loaded, the guest
 OS will think that the same floppy is loaded).
+Use of the host's floppy device is deprecated, and support for it will
+be removed in a future release.
 @item Hard disks
 Hard disks can be used. Normally you must specify the whole disk
 (@file{/dev/hdb} instead of @file{/dev/hdb1}) so that the guest OS can
qemu-options.hx +1 -2
index c513352..ffaf327 100644
@@ -419,8 +419,7 @@ STEXI
 @item -fdb @var{file}
 @findex -fda
 @findex -fdb
-Use @var{file} as floppy disk 0/1 image (@pxref{disk_images}). You can
-use the host floppy by using @file{/dev/fd0} as filename (@pxref{host_drives}).
+Use @var{file} as floppy disk 0/1 image (@pxref{disk_images}).
 ETEXI
 
 DEF("hda", HAS_ARG, QEMU_OPTION_hda,
qmp-commands.hx +1 -1
index 0663924..faf75da 100644
@@ -2154,7 +2154,7 @@ Each json-object contain the following:
          - "drv": driver format name (json-string)
              - Possible values: "blkdebug", "bochs", "cloop", "dmg",
                                 "file", "file", "ftp", "ftps", "host_cdrom",
-                                "host_device", "host_floppy", "http", "https",
+                                "host_device", "http", "https",
                                 "nbd", "parallels", "qcow", "qcow2", "raw",
                                 "tftp", "vdi", "vmdk", "vpc", "vvfat"
          - "backing_file": backing file name (json-string, optional)
Signature · 1 line
1.9.3
#1 lore raw

Forgot to mention:

1. For 2.3!

2. Testing without a physical floppy:

# > /dev/fd0
# chown armbru /dev/fd0

$ qemu-system-x86_64 -nodefaults -fda /dev/fd0
qemu-system-x86_64: -fda /dev/fd0: Host floppy pass-through is deprecated
Support for it will be removed in a future release.
WARNING: Image format was not specified for '/dev/fd0' and probing guessed raw.
Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted. Specify the 'raw' format explicitly to remove the restrictions.

The long lines are ugly, but not this patch's fault :)

#2 lore raw
Quoted 9 lines · Markus Armbruster

Forgot to mention:

1. For 2.3!

2. Testing without a physical floppy:

# > /dev/fd0
# chown armbru /dev/fd0

Quoted 6 lines

$ qemu-system-x86_64 -nodefaults -fda /dev/fd0
qemu-system-x86_64: -fda /dev/fd0: Host floppy pass-through is deprecated
Support for it will be removed in a future release.
WARNING: Image format was not specified for '/dev/fd0' and probing guessed raw.
Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted. Specify the 'raw' format explicitly to remove the restrictions.

Or just

$ qemu-img create -f qcow2 floppy.qcow2 1440K
$ qemu-system-x86_64 -fda host_floppy:floppy.qcow2
qemu-system-x86_64: -fda host_floppy:floppy.qcow2: Host floppy pass-through is deprecated
Support for it will be removed in a future release.

Max

Quoted 2 lines

The long lines are ugly, but not this patch's fault :)

Reviewed-by on v1 1/1
#3 lore raw
In reply to Markus Armbruster
Quoted 3 lines · Markus Armbruster

Raise your hand if you have a physical floppy drive in a computer you've powered on in 2015. Okay, I see we got a few weirdos in the audience. That's okay, weirdos are welcome here.

I do have a USB floppy drive. If I stuff that into my case, does it count?

Quoted 7 lines

Kidding aside, media change detection doesn't fully work, isn't going to be fixed, and floppy passthrough just isn't earning its keep anymore.

Deprecate block driver host_floppy now, so we can drop it after a grace period.

Quoted 8 lines
---
  block/raw-posix.c    | 2 ++
  qapi/block-core.json | 2 ++
  qemu-doc.texi        | 5 +++--
  qemu-options.hx      | 3 +--
  qmp-commands.hx      | 2 +-
  5 files changed, 9 insertions(+), 5 deletions(-)
Reviewed-by on v1 1/1
#4 lore raw
In reply to Markus Armbruster
Quoted 16 lines · Markus Armbruster

Raise your hand if you have a physical floppy drive in a computer you've powered on in 2015. Okay, I see we got a few weirdos in the audience. That's okay, weirdos are welcome here.

Kidding aside, media change detection doesn't fully work, isn't going to be fixed, and floppy passthrough just isn't earning its keep anymore.

Deprecate block driver host_floppy now, so we can drop it after a grace period.

---

+++ b/qapi/block-core.json

qapi/block-core.json line 221

Quoted 4 lines
qapi/block-core.json +1 -0
@@ -218,6 +218,7 @@
 #       'host_floppy', 'http', 'https', 'nbd', 'parallels', 'qcow',
 #       'qcow2', 'raw', 'tftp', 'vdi', 'vmdk', 'vpc', 'vvfat'
 #       2.2: 'archipelago' added, 'cow' dropped
+#       2.3: 'host_floppy' deprecated

We dropped 'cow' without any deprecation period, but I don't mind giving a few more months reprieve to host_floppy users. At any rate, I won't be sad to see it gone :)

Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
#5 lore raw
In reply to Markus Armbruster
Quoted 4 lines · Markus Armbruster

Raise your hand if you have a physical floppy drive in a computer you've powered on in 2015. Okay, I see we got a few weirdos in the audience. That's okay, weirdos are welcome here.

May I introduce to you my reference Q35 machine:
http://i.imgur.com/4gCnetj.jpg

Quoted 100 lines

Kidding aside, media change detection doesn't fully work, isn't going to be fixed, and floppy passthrough just isn't earning its keep anymore.

Deprecate block driver host_floppy now, so we can drop it after a grace period.

---
  block/raw-posix.c    | 2 ++
  qapi/block-core.json | 2 ++
  qemu-doc.texi        | 5 +++--
  qemu-options.hx      | 3 +--
  qmp-commands.hx      | 2 +-
  5 files changed, 9 insertions(+), 5 deletions(-)
block/raw-posix.c +2 -0
index f0b4488..844ac21 100644
@@ -2387,6 +2387,8 @@ static int floppy_open(BlockDriverState *bs, QDict *options, int flags,
      s->fd = -1;
      s->fd_media_changed = 1;
 
+    error_report("Host floppy pass-through is deprecated");
+    error_printf("Support for it will be removed in a future release.\n");
      return 0;
  }
 
qapi/block-core.json +2 -0
index 42c8850..ac839af 100644
@@ -218,6 +218,7 @@
  #       'host_floppy', 'http', 'https', 'nbd', 'parallels', 'qcow',
  #       'qcow2', 'raw', 'tftp', 'vdi', 'vmdk', 'vpc', 'vvfat'
  #       2.2: 'archipelago' added, 'cow' dropped
+#       2.3: 'host_floppy' deprecated
  #
  # @backing_file: #optional the name of the backing file (for copy-on-write)
  #
@@ -1245,6 +1246,7 @@
  # Drivers that are supported in block device operations.
  #
  # @host_device, @host_cdrom, @host_floppy: Since 2.1
+# @host_floppy: deprecated since 2.3
  #
  # Since: 2.0
  ##
qemu-doc.texi +3 -2
index 8aa6dbf..0125bc7 100644
@@ -736,8 +736,7 @@ devices. We describe here the usage for QEMU version >= 0.8.3.
 
  On Linux, you can directly use the host device filename instead of a
  disk image filename provided you have enough privileges to access
-it. For example, use @file{/dev/cdrom} to access to the CDROM or
-@file{/dev/fd0} for the floppy.
+it. For example, use @file{/dev/cdrom} to access to the CDROM.
 
  @table @code
  @item CD
@@ -749,6 +748,8 @@ You can specify a floppy device even if no floppy is loaded. Floppy
  removal is currently not detected accurately (if you change floppy
  without doing floppy access while the floppy is not loaded, the guest
  OS will think that the same floppy is loaded).
+Use of the host's floppy device is deprecated, and support for it will
+be removed in a future release.
  @item Hard disks
  Hard disks can be used. Normally you must specify the whole disk
  (@file{/dev/hdb} instead of @file{/dev/hdb1}) so that the guest OS can
qemu-options.hx +1 -2
index c513352..ffaf327 100644
@@ -419,8 +419,7 @@ STEXI
  @item -fdb @var{file}
  @findex -fda
  @findex -fdb
-Use @var{file} as floppy disk 0/1 image (@pxref{disk_images}). You can
-use the host floppy by using @file{/dev/fd0} as filename (@pxref{host_drives}).
+Use @var{file} as floppy disk 0/1 image (@pxref{disk_images}).
  ETEXI
 
  DEF("hda", HAS_ARG, QEMU_OPTION_hda,
qmp-commands.hx +1 -1
index 0663924..faf75da 100644
@@ -2154,7 +2154,7 @@ Each json-object contain the following:
           - "drv": driver format name (json-string)
               - Possible values: "blkdebug", "bochs", "cloop", "dmg",
                                  "file", "file", "ftp", "ftps", "host_cdrom",
-                                "host_device", "host_floppy", "http", "https",
+                                "host_device", "http", "https",
                                  "nbd", "parallels", "qcow", "qcow2", "raw",
                                  "tftp", "vdi", "vmdk", "vpc", "vvfat"
           - "backing_file": backing file name (json-string, optional)
#6 lore raw
Quoted 8 lines · John Snow
Quoted 4 lines · Markus Armbruster

Raise your hand if you have a physical floppy drive in a computer you've powered on in 2015. Okay, I see we got a few weirdos in the audience. That's okay, weirdos are welcome here.

May I introduce to you my reference Q35 machine:
http://i.imgur.com/4gCnetj.jpg

Take good care of it, so it doesn't die on us before pc-q35 is done!

Reviewed-by on v1 1/1
#7 lore raw
In reply to Markus Armbruster
Quoted 2 lines · Markus Armbruster

Raise your hand if you have a physical floppy drive in a computer you've powered on in 2015.

/me raises the hand, my amd test box has one.

I was surprised when I got the machine a few years back. And I never ever actually used the floppy drive in all those years.

Quoted 3 lines

Kidding aside, media change detection doesn't fully work, isn't going to be fixed, and floppy passthrough just isn't earning its keep anymore.

If you really need floppies there is the option to go for usb. Recent machines don't have floppy connectors any more, so that is the only kind of floppy device you can use anyway. And you can usb passthrough it to the guest. Case closed.

cheers,
Gerd

Applied
#8 lore raw
In reply to Markus Armbruster

Am 17.03.2015 um 17:02 hat Markus Armbruster geschrieben:

Quoted 4 lines

Raise your hand if you have a physical floppy drive in a computer you've powered on in 2015. Okay, I see we got a few weirdos in the audience. That's okay, weirdos are welcome here.

Quoted 8 lines

Kidding aside, media change detection doesn't fully work, isn't going to be fixed, and floppy passthrough just isn't earning its keep anymore.

Deprecate block driver host_floppy now, so we can drop it after a grace period.

Thanks, applied to the block branch.

Kevin