qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH-for-9.1 v2] hw/i386/pc: Ensure vmport prerequisites are fulfi


From: Kamil Szczęk
Subject: Re: [PATCH-for-9.1 v2] hw/i386/pc: Ensure vmport prerequisites are fulfilled
Date: Fri, 16 Aug 2024 08:27:39 +0000

On Friday, August 16th, 2024 at 10:22, Philippe Mathieu-Daudé 
<philmd@linaro.org> wrote:

> 
> 
> On 16/8/24 10:01, Kamil Szczęk wrote:
> 
> > Since commit 4ccd5fe22feb95137d325f422016a6473541fe9f ('pc: add option
> > to disable PS/2 mouse/keyboard'), the vmport will not be created unless
> > the i8042 PS/2 controller is enabled. To avoid confusion, let's fail if
> > vmport was explicitly requested, but the i8042 controller is disabled.
> > This also changes the behavior of vmport=auto to take i8042 controller
> > availability into account.
> > 
> > Signed-off-by: Kamil Szczęk kamil@szczek.dev
> > ---
> > hw/i386/pc.c | 8 ++++++--
> > hw/i386/pc_piix.c | 3 ++-
> > hw/i386/pc_q35.c | 2 +-
> > qemu-options.hx | 4 ++--
> > 4 files changed, 11 insertions(+), 6 deletions(-)
> > 
> > diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> > index c74931d577..c99f2ce540 100644
> > --- a/hw/i386/pc.c
> > +++ b/hw/i386/pc.c
> > @@ -1075,7 +1075,7 @@ static const MemoryRegionOps ioportF0_io_ops = {
> > };
> > 
> > static void pc_superio_init(ISABus *isa_bus, bool create_fdctrl,
> > - bool create_i8042, bool no_vmport)
> > + bool create_i8042, bool no_vmport, Error **errp)
> > {
> > int i;
> > DriveInfo *fd[MAX_FD];
> > @@ -1100,6 +1100,10 @@ static void pc_superio_init(ISABus *isa_bus, bool 
> > create_fdctrl,
> > }
> > 
> > if (!create_i8042) {
> > + if (!no_vmport) {
> > + error_setg(errp,
> 
> 
> Is 'errp' available? Does this patch compile?

It does and works as expected.

> Anyway, I think you want to call error_report() & exit().

Hmm, the error.h suggests that error_report() & exit() is a legacy approach, 
hence why I've used error_setg & error_fatal ptr. As far as I know both 
approaches are equivalent, no?

> 
> > + "vmport requires the i8042 controller to be enabled");
> > + }
> > return;
> > }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]