From: Kevin Wolf <kwolf@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>,
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>,
quintela@redhat.com, qemu-devel@nongnu.org,
Ryan Harper <ryanh@us.ibm.com>, Amit Shah <amit.shah@redhat.com>
Subject: Re: [Qemu-devel] Re: [PATCH 3/3] raw-posix: Re-open host CD-ROM after media change
Date: Thu, 24 Mar 2011 13:42:34 +0100 [thread overview]
Message-ID: <4D8B3C3A.3030407@redhat.com> (raw)
In-Reply-To: <AANLkTin5rN8gYv9S5aDXUTFGfCJZujMmzy_XK1=Sg8fh@mail.gmail.com>
Am 23.03.2011 21:50, schrieb Stefan Hajnoczi:
> On Wed, Mar 23, 2011 at 8:27 PM, Juan Quintela <quintela@redhat.com> wrote:
>> Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> wrote:
>>> +
>>> + if (s->fd == -1) {
>>> + s->fd = qemu_open(bs->filename, s->open_flags, 0644);
>>
>> Everything else on that file uses plain "open" not "qemu_open".
>> diference is basically that qemu_open() adds flag O_CLOEXEC.
>>
>> I don't know if this one should be vanilla open or the other ones
>> qemu_open().
>>
>> What do you think?
>
> raw_open_common() uses qemu_open(). That's why I used it.
And I think it's correct. There's no reason not to set O_CLOEXEC here.
Maybe some of the open() users need to be fixed.
>>> + if (s->fd < 0) {
>>> + return 0;
>>> + }
>>> + }
>>> +
>>> + ret = (ioctl(s->fd, CDROM_DRIVE_STATUS, CDSL_CURRENT) == CDS_DISC_OK);
>>
>> parens are not needed around ==.
>
> Yes, if you want I'll remove them. I just did it for readability.
I like them.
Kevin
next prev parent reply other threads:[~2011-03-24 12:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-23 17:40 [Qemu-devel] [PATCH 0/3] block: Correct size across CD-ROM media change Stefan Hajnoczi
2011-03-23 17:40 ` [Qemu-devel] [PATCH 1/3] trace: Trace bdrv_set_locked() Stefan Hajnoczi
2011-03-23 17:40 ` [Qemu-devel] [PATCH 2/3] block: Do not cache device size for removable media Stefan Hajnoczi
2011-03-23 20:18 ` [Qemu-devel] " Juan Quintela
2011-03-23 20:46 ` Stefan Hajnoczi
2011-03-23 17:40 ` [Qemu-devel] [PATCH 3/3] raw-posix: Re-open host CD-ROM after media change Stefan Hajnoczi
2011-03-23 20:27 ` [Qemu-devel] " Juan Quintela
2011-03-23 20:50 ` Stefan Hajnoczi
2011-03-24 12:42 ` Kevin Wolf [this message]
2011-03-24 19:00 ` Stefan Hajnoczi
2011-03-24 21:23 ` Juan Quintela
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=4D8B3C3A.3030407@redhat.com \
--to=kwolf@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=amit.shah@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=ryanh@us.ibm.com \
--cc=stefanha@gmail.com \
--cc=stefanha@linux.vnet.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).