From nobody Tue Feb 10 05:39:50 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576850352; cv=none; d=zohomail.com; s=zohoarc; b=TB85wp97Aj89isP6nHwhb3WRNP6ZtcXyE3WqY1V1zjyKV/jtgVXbZYe7ONi3w1joGyY6ksXReLpsEY+UxD4SGU31IvjowUImnG8HvQV2JMuAiVoFvL0aQObdAdUI5zNKM1ksgJn+JENS6En6pWlJtdx2qKOjpfeSLG07y4X+WSM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576850352; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=e8K/FLULfXHTN5ZAN9Exbeupoe9LUHxcOqfCTxUQKNg=; b=QIc12129Aqz8QoYP8hxSER4nRai3mmKYZNbYGxxY5/7i2wvZKvXFC6oS/0W7k64AKdDs5JlTXpGvdVANXB3scIehTOxQmURANfutVWeGSsH0AqOy2TlellOuSfgK8xWjcfphUFEnTjV7k3/SImJ85C8WG5Dp+fpO9Iwlmli7+9w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576850352185567.8924168746913; Fri, 20 Dec 2019 05:59:12 -0800 (PST) Received: from localhost ([::1]:56302 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iiIoA-0005cc-Fz for importer@patchew.org; Fri, 20 Dec 2019 08:59:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55511) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iiIfH-0007ab-HJ for qemu-devel@nongnu.org; Fri, 20 Dec 2019 08:50:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iiIfG-0007z0-0u for qemu-devel@nongnu.org; Fri, 20 Dec 2019 08:49:59 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:59484 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iiIfF-0007we-Ql for qemu-devel@nongnu.org; Fri, 20 Dec 2019 08:49:57 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-68-vI5AOhaXM2m4gEJhL_n7Qg-1; Fri, 20 Dec 2019 08:49:55 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E8B31107B7F4; Fri, 20 Dec 2019 13:49:54 +0000 (UTC) Received: from localhost (ovpn-112-54.ams2.redhat.com [10.36.112.54]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0A0776B56C; Fri, 20 Dec 2019 13:49:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576849797; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=e8K/FLULfXHTN5ZAN9Exbeupoe9LUHxcOqfCTxUQKNg=; b=eas/QRLPJDoIeB0EUo6uQ6/J0Ggqw2K0Q6nLHMhKKns5OX3GZVVvSHVGHI8U/VXIUL+B3L tAePNsNn8P/cC7DBNpycHBdLxv0T4gADKCpV8CcjnRmg51OxhCRGjb23oNgl1k3+VYwB3l ilEBPpa4Fz6K+UezBwNgOuk98ilkFVA= From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Subject: [PATCH v5 22/37] vmmouse: replace PROP_PTR with PROP_LINK Date: Fri, 20 Dec 2019 17:45:46 +0400 Message-Id: <20191220134601.571905-23-marcandre.lureau@redhat.com> In-Reply-To: <20191220134601.571905-1-marcandre.lureau@redhat.com> References: <20191220134601.571905-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MC-Unique: vI5AOhaXM2m4gEJhL_n7Qg-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.61 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" While at it, use the expected type. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/i386/pc.c | 6 +++--- hw/i386/vmmouse.c | 8 +++----- hw/input/pckbd.c | 8 +++----- include/hw/input/i8042.h | 4 +++- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index a4fda69b49..8054bc4147 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1156,9 +1156,9 @@ static void pc_superio_init(ISABus *isa_bus, bool cre= ate_fdctrl, bool no_vmport) vmmouse =3D NULL; } if (vmmouse) { - DeviceState *dev =3D DEVICE(vmmouse); - qdev_prop_set_ptr(dev, "ps2_mouse", i8042); - qdev_init_nofail(dev); + object_property_set_link(OBJECT(vmmouse), OBJECT(i8042), + "i8042", &error_abort); + qdev_init_nofail(DEVICE(vmmouse)); } port92 =3D isa_create_simple(isa_bus, TYPE_PORT92); =20 diff --git a/hw/i386/vmmouse.c b/hw/i386/vmmouse.c index 41ad91ad53..c0c329f817 100644 --- a/hw/i386/vmmouse.c +++ b/hw/i386/vmmouse.c @@ -66,7 +66,7 @@ typedef struct VMMouseState uint16_t status; uint8_t absolute; QEMUPutMouseEntry *entry; - void *ps2_mouse; + ISAKBDState *i8042; } VMMouseState; =20 static uint32_t vmmouse_get_status(VMMouseState *s) @@ -105,7 +105,7 @@ static void vmmouse_mouse_event(void *opaque, int x, in= t y, int dz, int buttons_ =20 /* need to still generate PS2 events to notify driver to read from queue */ - i8042_isa_mouse_fake_event(s->ps2_mouse); + i8042_isa_mouse_fake_event(s->i8042); } =20 static void vmmouse_remove_handler(VMMouseState *s) @@ -275,7 +275,7 @@ static void vmmouse_realizefn(DeviceState *dev, Error *= *errp) } =20 static Property vmmouse_properties[] =3D { - DEFINE_PROP_PTR("ps2_mouse", VMMouseState, ps2_mouse), + DEFINE_PROP_LINK("i8042", VMMouseState, i8042, TYPE_I8042, ISAKBDState= *), DEFINE_PROP_END_OF_LIST(), }; =20 @@ -287,8 +287,6 @@ static void vmmouse_class_initfn(ObjectClass *klass, vo= id *data) dc->reset =3D vmmouse_reset; dc->vmsd =3D &vmstate_vmmouse; dc->props =3D vmmouse_properties; - /* Reason: pointer property "ps2_mouse" */ - dc->user_creatable =3D false; } =20 static const TypeInfo vmmouse_info =3D { diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c index 2f09f780ba..60a4130320 100644 --- a/hw/input/pckbd.c +++ b/hw/input/pckbd.c @@ -482,17 +482,15 @@ void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_i= rq, =20 #define I8042(obj) OBJECT_CHECK(ISAKBDState, (obj), TYPE_I8042) =20 -typedef struct ISAKBDState { +struct ISAKBDState { ISADevice parent_obj; =20 KBDState kbd; MemoryRegion io[2]; -} ISAKBDState; +}; =20 -void i8042_isa_mouse_fake_event(void *opaque) +void i8042_isa_mouse_fake_event(ISAKBDState *isa) { - ISADevice *dev =3D opaque; - ISAKBDState *isa =3D I8042(dev); KBDState *s =3D &isa->kbd; =20 ps2_mouse_fake_event(s->mouse); diff --git a/include/hw/input/i8042.h b/include/hw/input/i8042.h index 246e6f3335..8eaebf50ce 100644 --- a/include/hw/input/i8042.h +++ b/include/hw/input/i8042.h @@ -14,10 +14,12 @@ =20 #define I8042_A20_LINE "a20" =20 +typedef struct ISAKBDState ISAKBDState; + void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq, MemoryRegion *region, ram_addr_t size, hwaddr mask); -void i8042_isa_mouse_fake_event(void *opaque); +void i8042_isa_mouse_fake_event(ISAKBDState *isa); void i8042_setup_a20_line(ISADevice *dev, qemu_irq a20_out); =20 #endif /* HW_INPUT_I8042_H */ --=20 2.24.0.308.g228f53135a