qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* Re: [Qemu-devel] [PATCH v2 2/4] qga: Fix an enum conversion warningin commands-win32.c, hit by clang.
@ 2019-05-02 21:18 driver1998
  2019-05-02 21:18 ` driver1998
  2019-05-02 21:52 ` Eric Blake
  0 siblings, 2 replies; 6+ messages in thread
From: driver1998 @ 2019-05-02 21:18 UTC (permalink / raw)
  To: qemu-devel, Eric Blake

On 5/1/19 2:25 AM, Eric Blake wrote:
> This adds lots of explicit casts. Are they actually necessary? Without
> seeing the actual warning, it seems fishy to have to be this explicit.

So here are the warnings, on clang version 9.0.0 (trunk 351977).

qga/commands-win32.c:461:24: error: implicit conversion from enumeration type 'enum GuestDiskBusType' to different
      enumeration type 'STORAGE_BUS_TYPE' (aka 'enum _STORAGE_BUS_TYPE') [-Werror,-Wenum-conversion]
    [BusTypeUnknown] = GUEST_DISK_BUS_TYPE_UNKNOWN,
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
qga/commands-win32.c:462:21: error: implicit conversion from enumeration type 'enum GuestDiskBusType' to different
      enumeration type 'STORAGE_BUS_TYPE' (aka 'enum _STORAGE_BUS_TYPE') [-Werror,-Wenum-conversion]
    [BusTypeScsi] = GUEST_DISK_BUS_TYPE_SCSI,
                    ^~~~~~~~~~~~~~~~~~~~~~~~
qga/commands-win32.c:463:22: error: implicit conversion from enumeration type 'enum GuestDiskBusType' to different
      enumeration type 'STORAGE_BUS_TYPE' (aka 'enum _STORAGE_BUS_TYPE') [-Werror,-Wenum-conversion]
    [BusTypeAtapi] = GUEST_DISK_BUS_TYPE_IDE,
                     ^~~~~~~~~~~~~~~~~~~~~~~
qga/commands-win32.c:464:20: error: implicit conversion from enumeration type 'enum GuestDiskBusType' to different
      enumeration type 'STORAGE_BUS_TYPE' (aka 'enum _STORAGE_BUS_TYPE') [-Werror,-Wenum-conversion]
    [BusTypeAta] = GUEST_DISK_BUS_TYPE_IDE,
                   ^~~~~~~~~~~~~~~~~~~~~~~
qga/commands-win32.c:465:21: error: implicit conversion from enumeration type 'enum GuestDiskBusType' to different
      enumeration type 'STORAGE_BUS_TYPE' (aka 'enum _STORAGE_BUS_TYPE') [-Werror,-Wenum-conversion]
    [BusType1394] = GUEST_DISK_BUS_TYPE_IEEE1394,
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
qga/commands-win32.c:466:20: error: implicit conversion from enumeration type 'enum GuestDiskBusType' to different
      enumeration type 'STORAGE_BUS_TYPE' (aka 'enum _STORAGE_BUS_TYPE') [-Werror,-Wenum-conversion]
    [BusTypeSsa] = GUEST_DISK_BUS_TYPE_SSA,
                   ^~~~~~~~~~~~~~~~~~~~~~~
qga/commands-win32.c:467:22: error: implicit conversion from enumeration type 'enum GuestDiskBusType' to different
      enumeration type 'STORAGE_BUS_TYPE' (aka 'enum _STORAGE_BUS_TYPE') [-Werror,-Wenum-conversion]
    [BusTypeFibre] = GUEST_DISK_BUS_TYPE_SSA,
                     ^~~~~~~~~~~~~~~~~~~~~~~
qga/commands-win32.c:468:20: error: implicit conversion from enumeration type 'enum GuestDiskBusType' to different
      enumeration type 'STORAGE_BUS_TYPE' (aka 'enum _STORAGE_BUS_TYPE') [-Werror,-Wenum-conversion]
    [BusTypeUsb] = GUEST_DISK_BUS_TYPE_USB,
                   ^~~~~~~~~~~~~~~~~~~~~~~
qga/commands-win32.c:469:21: error: implicit conversion from enumeration type 'enum GuestDiskBusType' to different
      enumeration type 'STORAGE_BUS_TYPE' (aka 'enum _STORAGE_BUS_TYPE') [-Werror,-Wenum-conversion]
    [BusTypeRAID] = GUEST_DISK_BUS_TYPE_RAID,
                    ^~~~~~~~~~~~~~~~~~~~~~~~
qga/commands-win32.c:470:22: error: implicit conversion from enumeration type 'enum GuestDiskBusType' to different
      enumeration type 'STORAGE_BUS_TYPE' (aka 'enum _STORAGE_BUS_TYPE') [-Werror,-Wenum-conversion]
    [BusTypeiScsi] = GUEST_DISK_BUS_TYPE_ISCSI,
  CC      qga/qapi-generated/qga-qapi-visit.o
                     ^~~~~~~~~~~~~~~~~~~~~~~~~
qga/commands-win32.c:471:20: error: implicit conversion from enumeration type 'enum GuestDiskBusType' to different
      enumeration type 'STORAGE_BUS_TYPE' (aka 'enum _STORAGE_BUS_TYPE') [-Werror,-Wenum-conversion]
    [BusTypeSas] = GUEST_DISK_BUS_TYPE_SAS,
                   ^~~~~~~~~~~~~~~~~~~~~~~
qga/commands-win32.c:472:21: error: implicit conversion from enumeration type 'enum GuestDiskBusType' to different
      enumeration type 'STORAGE_BUS_TYPE' (aka 'enum _STORAGE_BUS_TYPE') [-Werror,-Wenum-conversion]
    [BusTypeSata] = GUEST_DISK_BUS_TYPE_SATA,
                    ^~~~~~~~~~~~~~~~~~~~~~~~
qga/commands-win32.c:473:20: error: implicit conversion from enumeration type 'enum GuestDiskBusType' to different
      enumeration type 'STORAGE_BUS_TYPE' (aka 'enum _STORAGE_BUS_TYPE') [-Werror,-Wenum-conversion]
    [BusTypeSd] =  GUEST_DISK_BUS_TYPE_SD,
                   ^~~~~~~~~~~~~~~~~~~~~~
qga/commands-win32.c:474:20: error: implicit conversion from enumeration type 'enum GuestDiskBusType' to different
      enumeration type 'STORAGE_BUS_TYPE' (aka 'enum _STORAGE_BUS_TYPE') [-Werror,-Wenum-conversion]
    [BusTypeMmc] = GUEST_DISK_BUS_TYPE_MMC,
                   ^~~~~~~~~~~~~~~~~~~~~~~
qga/commands-win32.c:486:12: error: implicit conversion from enumeration type 'STORAGE_BUS_TYPE'
      (aka 'enum _STORAGE_BUS_TYPE') to different enumeration type 'GuestDiskBusType' (aka 'enum GuestDiskBusType')
      [-Werror,-Wenum-conversion]
    return win2qemu[(int)bus];
    ~~~~~~ ^~~~~~~~~~~~~~~~~~

> Or is it complaining that GuestDiskBusType and STORAGE_BUS_TYPE are
> distinct types, and that we are indeed cross-assigning between the two
> enums because we intentionally want them to share values?

It looks like it is, according to the last warning.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2/4] qga: Fix an enum conversion warningin commands-win32.c, hit by clang.
  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
  1 sibling, 0 replies; 6+ messages in thread
From: driver1998 @ 2019-05-02 21:18 UTC (permalink / raw)
  To: qemu-devel, Eric Blake

On 5/1/19 2:25 AM, Eric Blake wrote:
> This adds lots of explicit casts. Are they actually necessary? Without
> seeing the actual warning, it seems fishy to have to be this explicit.

So here are the warnings, on clang version 9.0.0 (trunk 351977).

qga/commands-win32.c:461:24: error: implicit conversion from enumeration type 'enum GuestDiskBusType' to different
      enumeration type 'STORAGE_BUS_TYPE' (aka 'enum _STORAGE_BUS_TYPE') [-Werror,-Wenum-conversion]
    [BusTypeUnknown] = GUEST_DISK_BUS_TYPE_UNKNOWN,
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
qga/commands-win32.c:462:21: error: implicit conversion from enumeration type 'enum GuestDiskBusType' to different
      enumeration type 'STORAGE_BUS_TYPE' (aka 'enum _STORAGE_BUS_TYPE') [-Werror,-Wenum-conversion]
    [BusTypeScsi] = GUEST_DISK_BUS_TYPE_SCSI,
                    ^~~~~~~~~~~~~~~~~~~~~~~~
qga/commands-win32.c:463:22: error: implicit conversion from enumeration type 'enum GuestDiskBusType' to different
      enumeration type 'STORAGE_BUS_TYPE' (aka 'enum _STORAGE_BUS_TYPE') [-Werror,-Wenum-conversion]
    [BusTypeAtapi] = GUEST_DISK_BUS_TYPE_IDE,
                     ^~~~~~~~~~~~~~~~~~~~~~~
qga/commands-win32.c:464:20: error: implicit conversion from enumeration type 'enum GuestDiskBusType' to different
      enumeration type 'STORAGE_BUS_TYPE' (aka 'enum _STORAGE_BUS_TYPE') [-Werror,-Wenum-conversion]
    [BusTypeAta] = GUEST_DISK_BUS_TYPE_IDE,
                   ^~~~~~~~~~~~~~~~~~~~~~~
qga/commands-win32.c:465:21: error: implicit conversion from enumeration type 'enum GuestDiskBusType' to different
      enumeration type 'STORAGE_BUS_TYPE' (aka 'enum _STORAGE_BUS_TYPE') [-Werror,-Wenum-conversion]
    [BusType1394] = GUEST_DISK_BUS_TYPE_IEEE1394,
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
qga/commands-win32.c:466:20: error: implicit conversion from enumeration type 'enum GuestDiskBusType' to different
      enumeration type 'STORAGE_BUS_TYPE' (aka 'enum _STORAGE_BUS_TYPE') [-Werror,-Wenum-conversion]
    [BusTypeSsa] = GUEST_DISK_BUS_TYPE_SSA,
                   ^~~~~~~~~~~~~~~~~~~~~~~
qga/commands-win32.c:467:22: error: implicit conversion from enumeration type 'enum GuestDiskBusType' to different
      enumeration type 'STORAGE_BUS_TYPE' (aka 'enum _STORAGE_BUS_TYPE') [-Werror,-Wenum-conversion]
    [BusTypeFibre] = GUEST_DISK_BUS_TYPE_SSA,
                     ^~~~~~~~~~~~~~~~~~~~~~~
qga/commands-win32.c:468:20: error: implicit conversion from enumeration type 'enum GuestDiskBusType' to different
      enumeration type 'STORAGE_BUS_TYPE' (aka 'enum _STORAGE_BUS_TYPE') [-Werror,-Wenum-conversion]
    [BusTypeUsb] = GUEST_DISK_BUS_TYPE_USB,
                   ^~~~~~~~~~~~~~~~~~~~~~~
qga/commands-win32.c:469:21: error: implicit conversion from enumeration type 'enum GuestDiskBusType' to different
      enumeration type 'STORAGE_BUS_TYPE' (aka 'enum _STORAGE_BUS_TYPE') [-Werror,-Wenum-conversion]
    [BusTypeRAID] = GUEST_DISK_BUS_TYPE_RAID,
                    ^~~~~~~~~~~~~~~~~~~~~~~~
qga/commands-win32.c:470:22: error: implicit conversion from enumeration type 'enum GuestDiskBusType' to different
      enumeration type 'STORAGE_BUS_TYPE' (aka 'enum _STORAGE_BUS_TYPE') [-Werror,-Wenum-conversion]
    [BusTypeiScsi] = GUEST_DISK_BUS_TYPE_ISCSI,
  CC      qga/qapi-generated/qga-qapi-visit.o
                     ^~~~~~~~~~~~~~~~~~~~~~~~~
qga/commands-win32.c:471:20: error: implicit conversion from enumeration type 'enum GuestDiskBusType' to different
      enumeration type 'STORAGE_BUS_TYPE' (aka 'enum _STORAGE_BUS_TYPE') [-Werror,-Wenum-conversion]
    [BusTypeSas] = GUEST_DISK_BUS_TYPE_SAS,
                   ^~~~~~~~~~~~~~~~~~~~~~~
qga/commands-win32.c:472:21: error: implicit conversion from enumeration type 'enum GuestDiskBusType' to different
      enumeration type 'STORAGE_BUS_TYPE' (aka 'enum _STORAGE_BUS_TYPE') [-Werror,-Wenum-conversion]
    [BusTypeSata] = GUEST_DISK_BUS_TYPE_SATA,
                    ^~~~~~~~~~~~~~~~~~~~~~~~
qga/commands-win32.c:473:20: error: implicit conversion from enumeration type 'enum GuestDiskBusType' to different
      enumeration type 'STORAGE_BUS_TYPE' (aka 'enum _STORAGE_BUS_TYPE') [-Werror,-Wenum-conversion]
    [BusTypeSd] =  GUEST_DISK_BUS_TYPE_SD,
                   ^~~~~~~~~~~~~~~~~~~~~~
qga/commands-win32.c:474:20: error: implicit conversion from enumeration type 'enum GuestDiskBusType' to different
      enumeration type 'STORAGE_BUS_TYPE' (aka 'enum _STORAGE_BUS_TYPE') [-Werror,-Wenum-conversion]
    [BusTypeMmc] = GUEST_DISK_BUS_TYPE_MMC,
                   ^~~~~~~~~~~~~~~~~~~~~~~
qga/commands-win32.c:486:12: error: implicit conversion from enumeration type 'STORAGE_BUS_TYPE'
      (aka 'enum _STORAGE_BUS_TYPE') to different enumeration type 'GuestDiskBusType' (aka 'enum GuestDiskBusType')
      [-Werror,-Wenum-conversion]
    return win2qemu[(int)bus];
    ~~~~~~ ^~~~~~~~~~~~~~~~~~

> Or is it complaining that GuestDiskBusType and STORAGE_BUS_TYPE are
> distinct types, and that we are indeed cross-assigning between the two
> enums because we intentionally want them to share values?

It looks like it is, according to the last warning.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2/4] qga: Fix an enum conversion warningin commands-win32.c, hit by clang.
  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   ` [Qemu-devel] [PATCH v2 2/4] qga: Fix an enum conversion warningincommands-win32.c, " GH Cao
  1 sibling, 2 replies; 6+ messages in thread
From: Eric Blake @ 2019-05-02 21:52 UTC (permalink / raw)
  To: driver1998, qemu-devel

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

On 5/2/19 4:18 PM, driver1998 wrote:
> On 5/1/19 2:25 AM, Eric Blake wrote:
>> This adds lots of explicit casts. Are they actually necessary? Without
>> seeing the actual warning, it seems fishy to have to be this explicit.
> 
> So here are the warnings, on clang version 9.0.0 (trunk 351977).
> 
> qga/commands-win32.c:461:24: error: implicit conversion from enumeration type 'enum GuestDiskBusType' to different
>       enumeration type 'STORAGE_BUS_TYPE' (aka 'enum _STORAGE_BUS_TYPE') [-Werror,-Wenum-conversion]
>     [BusTypeUnknown] = GUEST_DISK_BUS_TYPE_UNKNOWN,
>                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~

> qga/commands-win32.c:486:12: error: implicit conversion from enumeration type 'STORAGE_BUS_TYPE'
>       (aka 'enum _STORAGE_BUS_TYPE') to different enumeration type 'GuestDiskBusType' (aka 'enum GuestDiskBusType')
>       [-Werror,-Wenum-conversion]
>     return win2qemu[(int)bus];
>     ~~~~~~ ^~~~~~~~~~~~~~~~~~

Where is enum STORAGE_BUS_TYPE defined? I see GuestDiskBusType (via
qga/qapi-schema.json's 'enum':'GuestDiskBusType'), but if
STORAGE_BUS_TYPE is a type declared by some external project, we are
probably better off writing a two-way conversion table or switch
statement, rather than relying on the two enums currently happening to
have identical values (but where that might break if we accidentally
rearrange our .json QAPI file or if the external file changes their
enum).  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.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2/4] qga: Fix an enum conversion warningin commands-win32.c, hit by clang.
  2019-05-02 21:52 ` Eric Blake
@ 2019-05-02 21:52   ` Eric Blake
  2019-05-02 22:24   ` [Qemu-devel] [PATCH v2 2/4] qga: Fix an enum conversion warningincommands-win32.c, " GH Cao
  1 sibling, 0 replies; 6+ messages in thread
From: Eric Blake @ 2019-05-02 21:52 UTC (permalink / raw)
  To: driver1998, qemu-devel

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

On 5/2/19 4:18 PM, driver1998 wrote:
> On 5/1/19 2:25 AM, Eric Blake wrote:
>> This adds lots of explicit casts. Are they actually necessary? Without
>> seeing the actual warning, it seems fishy to have to be this explicit.
> 
> So here are the warnings, on clang version 9.0.0 (trunk 351977).
> 
> qga/commands-win32.c:461:24: error: implicit conversion from enumeration type 'enum GuestDiskBusType' to different
>       enumeration type 'STORAGE_BUS_TYPE' (aka 'enum _STORAGE_BUS_TYPE') [-Werror,-Wenum-conversion]
>     [BusTypeUnknown] = GUEST_DISK_BUS_TYPE_UNKNOWN,
>                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~

> qga/commands-win32.c:486:12: error: implicit conversion from enumeration type 'STORAGE_BUS_TYPE'
>       (aka 'enum _STORAGE_BUS_TYPE') to different enumeration type 'GuestDiskBusType' (aka 'enum GuestDiskBusType')
>       [-Werror,-Wenum-conversion]
>     return win2qemu[(int)bus];
>     ~~~~~~ ^~~~~~~~~~~~~~~~~~

Where is enum STORAGE_BUS_TYPE defined? I see GuestDiskBusType (via
qga/qapi-schema.json's 'enum':'GuestDiskBusType'), but if
STORAGE_BUS_TYPE is a type declared by some external project, we are
probably better off writing a two-way conversion table or switch
statement, rather than relying on the two enums currently happening to
have identical values (but where that might break if we accidentally
rearrange our .json QAPI file or if the external file changes their
enum).  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.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2/4] qga: Fix an enum conversion warningincommands-win32.c, hit by clang.
  2019-05-02 21:52 ` Eric Blake
  2019-05-02 21:52   ` Eric Blake
@ 2019-05-02 22:24   ` GH Cao
  2019-05-02 22:24     ` GH Cao
  1 sibling, 1 reply; 6+ messages in thread
From: GH Cao @ 2019-05-02 22:24 UTC (permalink / raw)
  To: Eric Blake, qemu-devel

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2/4] qga: Fix an enum conversion warningincommands-win32.c, hit by clang.
  2019-05-02 22:24   ` [Qemu-devel] [PATCH v2 2/4] qga: Fix an enum conversion warningincommands-win32.c, " GH Cao
@ 2019-05-02 22:24     ` GH Cao
  0 siblings, 0 replies; 6+ messages in thread
From: GH Cao @ 2019-05-02 22:24 UTC (permalink / raw)
  To: Eric Blake, qemu-devel

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-05-02 22:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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   ` [Qemu-devel] [PATCH v2 2/4] qga: Fix an enum conversion warningincommands-win32.c, " GH Cao
2019-05-02 22:24     ` GH Cao

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).