qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Luiz Capitulino <lcapitulino@redhat.com>
Cc: Ryan Harper <ryanh@us.ibm.com>,
	qemu-devel@nongnu.org, Juan Quintela <quintela@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] Add qerror message if the 'change' target filename can't be opened
Date: Thu, 01 Apr 2010 21:14:30 +0200	[thread overview]
Message-ID: <4BB4F096.10302@redhat.com> (raw)
In-Reply-To: <20100401152233.71e778ed@redhat.com>

Am 01.04.2010 20:22, schrieb Luiz Capitulino:
> On Thu, 1 Apr 2010 15:15:51 -0300
> Luiz Capitulino <lcapitulino@redhat.com> wrote:
> 
>> On Thu, 25 Mar 2010 09:32:58 -0500
>> Ryan Harper <ryanh@us.ibm.com> wrote:
>>
>>> Currently when using the change command to switch the file in the cd drive
>>> the command doesn't complain if the file doesn't exit or can't be opened
>>> and the drive keeps the existing image.  This patch adds a qerror_report
>>> call to print a message out indicating the failure.  This error message
>>> can be used to catch failures.
>>
>>  Looks good to me, but it doesn't keep the existing image, it will silently
>> eject it instead.
> 
>  And, thinking more about it this seems the wrong behavior to me, if it
> fails to open the file, it should not touch the current one.
> 
>  Am I right, Kevin?

Well, it's a monitor command. I guess its meaning has never been clearly
defined, so I tend to say there is no right or wrong. From a user
perspective, intuitively I would expect that it succeeds completely or
maintains the old state, so yes.

However, I don't think it's fixable that easy. You obviously need to
close the image before you can open it. And reopening the image in case
of failure - well, we just had this discussion and I'm sure Juan wants
to comment on it...

It's a case that we should consider if/when we reorganize bdrv_open. The
"bdrv_close, but without closing the fd" thing doesn't work out here
because we need to reuse the same bs. Or maybe open a different bs first
and then copy things over. Could actually work this way.

Kevin

  reply	other threads:[~2010-04-01 19:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-25 14:32 [Qemu-devel] [PATCH] Add qerror message if the 'change' target filename can't be opened Ryan Harper
2010-03-25 16:40 ` Markus Armbruster
2010-03-25 19:20   ` Ryan Harper
2010-03-25 19:42     ` Markus Armbruster
2010-04-01 18:15 ` Luiz Capitulino
2010-04-01 18:22   ` Luiz Capitulino
2010-04-01 19:14     ` Kevin Wolf [this message]
2010-04-01 20:55       ` Luiz Capitulino
2010-04-01 18:23   ` Ryan Harper
2010-04-01 18:31     ` Luiz Capitulino

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=4BB4F096.10302@redhat.com \
    --to=kwolf@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=ryanh@us.ibm.com \
    /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).