qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Reda Sallahi <fullmanet@gmail.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org,
	Kevin Wolf <kwolf@redhat.com>, Max Reitz <mreitz@redhat.com>,
	Fam Zheng <famz@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v5] qemu-img: change opening method for the output in dd
Date: Tue, 13 Sep 2016 16:35:18 +0100	[thread overview]
Message-ID: <20160913153518.GA5677@stefanha-x1.localdomain> (raw)
In-Reply-To: <20160826071940.1179-1-fullmanet@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 523 bytes --]

On Fri, Aug 26, 2016 at 09:19:40AM +0200, Reda Sallahi wrote:
> -    blk2 = img_open(image_opts, out.filename, out_fmt, BDRV_O_RDWR,
> -                    false, false);
> +    ret = access(out_filename, F_OK); /* Check if file exists */

The QEMU block layer does not use POSIX file I/O because it needs to
support protocols like iSCSI and ssh.

The only way to test for the existence of a disk image is by opening it
with block layer APIs.

Can you just move the img_open() call from the else statement up here
instead?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

  reply	other threads:[~2016-09-13 15:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-26  7:19 [Qemu-devel] [PATCH v5] qemu-img: change opening method for the output in dd Reda Sallahi
2016-09-13 15:35 ` Stefan Hajnoczi [this message]
2016-09-30 15:33   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi

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=20160913153518.GA5677@stefanha-x1.localdomain \
    --to=stefanha@redhat.com \
    --cc=famz@redhat.com \
    --cc=fullmanet@gmail.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --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).