From: "GH Cao" <driver1998@foxmail.com>
To: "Eric Blake" <eblake@redhat.com>, qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v2 2/4] qga: Fix an enum conversion warningincommands-win32.c, hit by clang.
Date: Fri, 3 May 2019 06:24:36 +0800 [thread overview]
Message-ID: <tencent_EE29897A62292DA76CA785FB55AF5507090A@qq.com> (raw)
In-Reply-To: <d23b59fa-2909-f124-3aab-cc5ded90f063@redhat.com>
On 5/3/19 6:20 AM, Eric Blake wrote:
> Where is enum STORAGE_BUS_TYPE defined?
In the Windows SDK (winioctl.h), so a two-way conversion table is needed.
> In fact, it looks like win2qemu[] is supposed to be that table,
> but it was incorrectly written. You WANT to do:
> diff --git i/qga/commands-win32.c w/qga/commands-win32.c
> index d40d61f605c..6b67f16faf1 100644
> --- i/qga/commands-win32.c
> +++ w/qga/commands-win32.c
> @@ -457,7 +457,7 @@ void qmp_guest_file_flush(int64_t handle, Error **errp)
>
> #ifdef CONFIG_QGA_NTDDSCSI
>
> -static STORAGE_BUS_TYPE win2qemu[] = {
> +static GuestDiskBusType win2qemu[] = {
> [BusTypeUnknown] = GUEST_DISK_BUS_TYPE_UNKNOWN,
> [BusTypeScsi] = GUEST_DISK_BUS_TYPE_SCSI,
> [BusTypeAtapi] = GUEST_DISK_BUS_TYPE_IDE,
>
> with no casts needed, either in the table or in the function that
> references the table.
Yes, I can confirm that fixes the issue, and clearly better than my previous effort.
I'll use this instead in my upcoming v3 patch set.
next prev parent reply other threads:[~2019-05-02 22:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-02 21:18 [Qemu-devel] [PATCH v2 2/4] qga: Fix an enum conversion warningin commands-win32.c, hit by clang driver1998
2019-05-02 21:18 ` driver1998
2019-05-02 21:52 ` Eric Blake
2019-05-02 21:52 ` Eric Blake
2019-05-02 22:24 ` GH Cao [this message]
2019-05-02 22:24 ` [Qemu-devel] [PATCH v2 2/4] qga: Fix an enum conversion warningincommands-win32.c, " GH Cao
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=tencent_EE29897A62292DA76CA785FB55AF5507090A@qq.com \
--to=driver1998@foxmail.com \
--cc=eblake@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).