Skip to contentSkip to conversation

raw-posix: Fix /dev/cdrom magic on OS X

PATCH In review Kevin Wolf 3 participants 3 messages Jun 12, 2013 – Jun 13, 2013 Block layer

lore
Share & tools
lore

Kevin Wolf

author
#0 lore raw

PATCH 1/1 raw-posix: Fix /dev/cdrom magic on OS X

The raw-posix driver has code to provide a /dev/cdrom on OS X even though it doesn't really exist. However, since commit c66a6157 the real filename is dismissed after finding it, so opening /dev/cdrom fails. Put the filename back into the options QDict to make this work again.

---
 block/raw-posix.c | 1 +
 1 file changed, 1 insertion(+)
block/raw-posix.c +1 -0
index c0ccf27..90ce9f8 100644
@@ -1350,6 +1350,7 @@ static int hdev_open(BlockDriverState *bs, QDict *options, int flags)
                 qemu_close(fd);
             }
             filename = bsdPath;
+            qdict_put(options, "filename", qstring_from_str(filename));
         }
 
         if ( mediaIterator )
Signature · 1 line
1.8.1.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Kevin Wolf

The raw-posix driver has code to provide a /dev/cdrom on OS X even though it doesn't really exist. However, since commit c66a6157 the real filename is dismissed after finding it, so opening /dev/cdrom fails. Put the filename back into the options QDict to make this work again.

---
 block/raw-posix.c | 1 +
 1 file changed, 1 insertion(+)
#2 lore raw
In reply to Kevin Wolf

Am 12.06.2013 16:22, schrieb Kevin Wolf:

Quoted 16 lines

The raw-posix driver has code to provide a /dev/cdrom on OS X even though it doesn't really exist. However, since commit c66a6157 the real filename is dismissed after finding it, so opening /dev/cdrom fails. Put the filename back into the options QDict to make this work again.

---
 block/raw-posix.c | 1 +
 1 file changed, 1 insertion(+)
block/raw-posix.c +0 -0
index c0ccf27..90ce9f8 100644

block/raw-posix.c static int hdev_open(BlockDriverState *bs, QDict *options, int flags) · line 1356

Quoted 7 lines
block/raw-posix.c +1 -0
@@ -1350,6 +1350,7 @@ static int hdev_open(BlockDriverState *bs, QDict *options, int flags)
                 qemu_close(fd);
             }
             filename = bsdPath;
+            qdict_put(options, "filename", qstring_from_str(filename));
         }
 
         if ( mediaIterator )

On Mac OS X v10.5.8 ppc64 I get:

qemu-system-x86_64: -cdrom /dev/cdrom: could not open disk image /dev/cdrom: No such file or directory

On ppc I get a crash even without options, seems unrelated though.

Andreas