qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Naphtali Sprei <nsprei@redhat.com>
To: qemu-devel@nongnu.org
Cc: Naphtali Sprei <nsprei@redhat.com>
Subject: [Qemu-devel] [PATCH 3/3] Read-only device changed to opens it's file for read-only.
Date: Thu, 21 Jan 2010 14:40:41 +0200	[thread overview]
Message-ID: <1264077641-17902-8-git-send-email-nsprei@redhat.com> (raw)
In-Reply-To: <1264077641-17902-7-git-send-email-nsprei@redhat.com>


Signed-off-by: Naphtali Sprei <nsprei@redhat.com>
---
 block/bochs.c     |    6 ++----
 block/parallels.c |    6 ++----
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/block/bochs.c b/block/bochs.c
index 3489258..fb83594 100644
--- a/block/bochs.c
+++ b/block/bochs.c
@@ -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
diff --git a/block/parallels.c b/block/parallels.c
index 63b6738..41b3a7c 100644
--- a/block/parallels.c
+++ b/block/parallels.c
@@ -74,11 +74,9 @@ static int parallels_open(BlockDriverState *bs, const char *filename, int flags)
     int fd, i;
     struct parallels_header ph;
 
-    fd = open(filename, O_RDWR | O_BINARY | O_LARGEFILE);
+    fd = open(filename, O_RDONLY | O_BINARY | O_LARGEFILE);
     if (fd < 0) {
-        fd = open(filename, O_RDONLY | O_BINARY | O_LARGEFILE);
-        if (fd < 0)
-            return -1;
+        return -1;
     }
 
     bs->read_only = 1; // no write support yet
-- 
1.6.3.3

  reply	other threads:[~2010-01-21 12:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-21 12:40 [Qemu-devel] [PATCH 0/3] Even more read-write/read-only fixes and cleanup Naphtali Sprei
2010-01-21 12:40 ` [Qemu-devel] [PATCH 0/3] *** SUBJECT HERE *** Naphtali Sprei
2010-01-21 12:40   ` Naphtali Sprei
2010-01-21 12:40     ` [Qemu-devel] [PATCH 1/3] No need anymoe for bdrv_set_read_only Naphtali Sprei
2010-01-21 12:40       ` [Qemu-devel] [PATCH 1/3] No need anymore " Naphtali Sprei
2010-01-21 12:40         ` [Qemu-devel] [PATCH 2/3] Ask for read-write permissions when opening files Naphtali Sprei
2010-01-21 12:40           ` [Qemu-devel] [PATCH 2/3] Ask for read-write permissions when opening files where needed Naphtali Sprei
2010-01-21 12:40             ` Naphtali Sprei [this message]
2010-01-26 22:05       ` [Qemu-devel] [PATCH 1/3] No need anymoe for bdrv_set_read_only Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1264077641-17902-8-git-send-email-nsprei@redhat.com \
    --to=nsprei@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).