]> git.proxmox.com Git - qemu.git/blobdiff - block/bochs.c
Read-only device changed to opens it's file for read-only.
[qemu.git] / block / bochs.c
index 34892582ef18237829e5a9cd39af7e1650d098ac..fb83594dba95a2d453696c50c107325615074e37 100644 (file)
@@ -116,11 +116,9 @@ static int bochs_open(BlockDriverState *bs, const char *filename, int flags)
     struct bochs_header bochs;
     struct bochs_header_v1 header_v1;
 
-    fd = open(filename, O_RDWR | O_BINARY);
+    fd = open(filename, O_RDONLY | O_BINARY);
     if (fd < 0) {
-        fd = open(filename, O_RDONLY | O_BINARY);
-        if (fd < 0)
-            return -1;
+        return -1;
     }
 
     bs->read_only = 1; // no write support yet