]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/disk/efi/efidisk.c: Detect floppies by ACPI ID.
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Wed, 17 Apr 2013 17:05:57 +0000 (19:05 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Wed, 17 Apr 2013 17:05:57 +0000 (19:05 +0200)
It improves performance in qemu.

ChangeLog
grub-core/disk/efi/efidisk.c

index 073207a264951204d76dfbbca160ac4094671d50..9d77a7fa82b622b3cf2e001239504fc45bdbf112 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-04-17  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/disk/efi/efidisk.c: Detect floppies by ACPI ID.
+       It improves performance in qemu.
+
 2013-04-17  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * build-aux/snippet: Add missing gnulib files.
index 0e08d3bec6eb8e206892baf6be68449fd9a18938..e168d07fa8b52fb83f436b225d0437cc2c67ce53 100644 (file)
@@ -329,18 +329,28 @@ name_devices (struct grub_efidisk_data *devices)
     {
       grub_efi_device_path_t *dp;
       grub_efi_block_io_media_t *m;
+      int is_floppy = 0;
 
       dp = d->last_device_path;
       if (! dp)
        continue;
 
       m = d->block_io->media;
-      if (m->logical_partition)
+      if (GRUB_EFI_DEVICE_PATH_TYPE (dp) == GRUB_EFI_ACPI_DEVICE_PATH_TYPE
+         && GRUB_EFI_DEVICE_PATH_SUBTYPE (dp)
+         == GRUB_EFI_ACPI_DEVICE_PATH_SUBTYPE)
+       {
+         grub_efi_acpi_device_path_t *acpi
+           = (grub_efi_acpi_device_path_t *) dp;
+         /* Floppy EISA ID.  */ 
+         if (acpi->hid == 0x60441d0 || acpi->hid == 0x70041d0
+             || acpi->hid == 0x70141d1)
+           is_floppy = 1;
+       }
+      if (is_floppy)
        {
-         /* Only one partition in a non-media device. Assume that this
-            is a floppy drive.  */
 #ifdef DEBUG_NAMES
-         grub_printf ("adding a floppy by guessing: ");
+         grub_printf ("adding a floppy: ");
          grub_efi_print_device_path (d->device_path);
 #endif
          add_device (&fd_devices, d);