From: Paolo Bonzini <pbonzini@redhat.com>
To: Amit Shah <amit.shah@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
Stefan Hajnoczi <stefanha@gmail.com>,
qemu list <qemu-devel@nongnu.org>,
Markus Armbruster <armbru@redhat.com>,
Juan Quintela <quintela@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v3 4/5] atapi: GESN: Standardise event response handling for future additions
Date: Tue, 12 Apr 2011 16:40:39 +0200 [thread overview]
Message-ID: <4DA46467.30208@redhat.com> (raw)
In-Reply-To: <20110412141222.GC13631@amit-x200.redhat.com>
On 04/12/2011 04:12 PM, Amit Shah wrote:
>>>>> > >>> gesn_cdb = (void *)packet;
>>>>> > >>> + gesn_event_header = (void *)packet;
>>>> > >>
>>>> > >> I think this should be buf, not packet.
>>> > >
>>> > > Ah, right. (Though they're the same.)
>> >
>> > Oh, you're right. I wasn't even aware of that. At some point we should
>> > clean this up, it's an invitation for bugs...
> It is. Actually it's surprising gcc didn't tell me that casting from
> const uint8_t * to void * and then writing to the pointer is not a
> good idea.
Perhaps those structs should be made global and added to an atapi.h
header? This way you can avoid (void *) casts.
(In fact, there's a scsi.h file in the Win32 free header files waiting
to be lifted in QEMU... unfortunately, the similar atapi header file has
not been written yet though I think it is in the Windows DDK).
Paolo
next prev parent reply other threads:[~2011-04-12 14:40 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-12 11:43 [Qemu-devel] [PATCH v3 0/5] atapi: Implement 'media' subcommand for GESN Amit Shah
2011-04-12 11:43 ` [Qemu-devel] [PATCH v3 1/5] atapi: Allow GET_EVENT_STATUS_NOTIFICATION after media change Amit Shah
2011-04-12 11:43 ` [Qemu-devel] [PATCH v3 2/5] atapi: Move GET_EVENT_STATUS_NOTIFICATION command handling to its own function Amit Shah
2011-04-12 11:43 ` [Qemu-devel] [PATCH v3 3/5] atapi: GESN: Use structs for commonly-used field types Amit Shah
2011-04-12 13:10 ` Markus Armbruster
2011-04-12 14:00 ` Amit Shah
2011-04-12 11:43 ` [Qemu-devel] [PATCH v3 4/5] atapi: GESN: Standardise event response handling for future additions Amit Shah
2011-04-12 13:09 ` Kevin Wolf
2011-04-12 13:59 ` Amit Shah
2011-04-12 14:07 ` Kevin Wolf
2011-04-12 14:12 ` Amit Shah
2011-04-12 14:40 ` Paolo Bonzini [this message]
2011-04-12 11:43 ` [Qemu-devel] [PATCH v3 5/5] atapi: GESN: implement 'media' subcommand Amit Shah
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=4DA46467.30208@redhat.com \
--to=pbonzini@redhat.com \
--cc=amit.shah@redhat.com \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=stefanha@gmail.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).