[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PULL 18/20] hw/i386/pc: Unify vmport=auto handling
|
From: |
Kamil Szczęk |
|
Subject: |
Re: [PULL 18/20] hw/i386/pc: Unify vmport=auto handling |
|
Date: |
Tue, 20 Aug 2024 22:55:46 +0000 |
On Wednesday, August 21st, 2024 at 00:45, Richard Henderson
<richard.henderson@linaro.org> wrote:
> On 8/21/24 06:32, Kamil Szczęk wrote:
>
> > Also, just as a test I added a single line of code before the assert:
> >
> > pcms->vmport = -1;
> >
> > And, to my surprise, it compiled successfully without any warning and as
> > expected, aborted on the assert:
> >
> > qemu-system-x86_64: ../hw/i386/pc.c:1225: pc_basic_device_init: Assertion
> > 'pcms->vmport >= 0 && pcms->vmport < ON_OFF_AUTO__MAX' failed.
> >
> > Is this expected behavior?
>
>
> Yes.
>
> The underlying integral type for enum in C is implementation defined.
> It can and does vary between compilers, leading to this sort of thing.
>
> The only reasonable fix is
>
> (unsigned)foo < max
Fair enough, just posted a patch.
- [PULL 03/20] qemu-options.hx: correct formatting -smbios type=4, (continued)
- [PULL 03/20] qemu-options.hx: correct formatting -smbios type=4, Philippe Mathieu-Daudé, 2024/08/19
- [PULL 05/20] target/mips: Use correct MMU index in get_pte(), Philippe Mathieu-Daudé, 2024/08/19
- [PULL 07/20] hw/dma/xilinx_axidma: Use semicolon at end of statement, not comma, Philippe Mathieu-Daudé, 2024/08/19
- [PULL 04/20] target/mips: Pass page table entry size as MemOp to get_pte(), Philippe Mathieu-Daudé, 2024/08/19
- [PULL 08/20] hw/remote/message.c: Don't directly invoke DeviceClass:reset, Philippe Mathieu-Daudé, 2024/08/19
- [PULL 16/20] target/sparc: Restrict STQF to sparcv9, Philippe Mathieu-Daudé, 2024/08/19
- [PULL 18/20] hw/i386/pc: Unify vmport=auto handling, Philippe Mathieu-Daudé, 2024/08/19
[PULL 09/20] linux-user/mips: Do not try to use removed R5900 CPU, Philippe Mathieu-Daudé, 2024/08/19
[PULL 20/20] crypto/tlscredspsk: Free username on finalize, Philippe Mathieu-Daudé, 2024/08/19
[PULL 11/20] linux-user/mips: Select MIPS64R2-generic for Rel2 binaries, Philippe Mathieu-Daudé, 2024/08/19
[PULL 13/20] tests/avocado: exec_command should not consume console output, Philippe Mathieu-Daudé, 2024/08/19
[PULL 17/20] hw/ppc/Kconfig: Add missing SERIAL_ISA dependency to POWERNV machine, Philippe Mathieu-Daudé, 2024/08/19
[PULL 06/20] target/mips: Load PTE as DATA, Philippe Mathieu-Daudé, 2024/08/19
[PULL 10/20] linux-user/mips: Select Octeon68XX CPU for Octeon binaries, Philippe Mathieu-Daudé, 2024/08/19
[PULL 12/20] linux-user/mips: Select Loongson CPU for Loongson binaries, Philippe Mathieu-Daudé, 2024/08/19
[PULL 15/20] contrib/plugins/execlog: Fix shadowed declaration warning, Philippe Mathieu-Daudé, 2024/08/19
[PULL 19/20] hw/i386/pc: Ensure vmport prerequisites are fulfilled, Philippe Mathieu-Daudé, 2024/08/19