On Thu, 20 Jul 2023 at 08:16, xianglai li <lixiang...@loongson.cn> wrote: > > It introduces a new function to unwire the > vcpu<->exioi interrupts for the vcpu hot-(un)plug cases. > > Cc: Xiaojuan Yang <yangxiaoj...@loongson.cn> > Cc: Song Gao <gaos...@loongson.cn> > Cc: "Michael S. Tsirkin" <m...@redhat.com> > Cc: Igor Mammedov <imamm...@redhat.com> > Cc: Ani Sinha <anisi...@redhat.com> > Cc: Paolo Bonzini <pbonz...@redhat.com> > Cc: Richard Henderson <richard.hender...@linaro.org> > Cc: Eduardo Habkost <edua...@habkost.net> > Cc: Marcel Apfelbaum <marcel.apfelb...@gmail.com> > Cc: "Philippe Mathieu-Daudé" <phi...@linaro.org> > Cc: Yanan Wang <wangyana...@huawei.com> > Cc: "Daniel P. Berrangé" <berra...@redhat.com> > Cc: Peter Xu <pet...@redhat.com> > Cc: David Hildenbrand <da...@redhat.com> > Signed-off-by: xianglai li <lixiang...@loongson.cn> > --- > hw/core/gpio.c | 4 ++-- > include/hw/qdev-core.h | 2 ++ > 2 files changed, 4 insertions(+), 2 deletions(-) > > diff --git a/hw/core/gpio.c b/hw/core/gpio.c > index 80d07a6ec9..4fc6409545 100644 > --- a/hw/core/gpio.c > +++ b/hw/core/gpio.c > @@ -143,8 +143,8 @@ qemu_irq qdev_get_gpio_out_connector(DeviceState *dev, > const char *name, int n) > > /* disconnect a GPIO output, returning the disconnected input (if any) */ > > -static qemu_irq qdev_disconnect_gpio_out_named(DeviceState *dev, > - const char *name, int n) > +qemu_irq qdev_disconnect_gpio_out_named(DeviceState *dev, > + const char *name, int n) > { > char *propname = g_strdup_printf("%s[%d]", > name ? name : "unnamed-gpio-out", n);
This function as currently written is intended only for use in qdev_intercept_gpio_out(), which in turn is there only for qtest test case use. I would be a bit cautious about whether there are unexpected issues with trying to use it in "production" functionality with a running QEMU (eg when perhaps some device might be trying to signal the gpio line in another thread while this one is trying to disconnect it). thanks -- PMM