From nobody Tue Feb 10 23:00:54 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1507336742867147.914638690674; Fri, 6 Oct 2017 17:39:02 -0700 (PDT) Received: from localhost ([::1]:47801 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0d8s-00077m-Kt for importer@patchew.org; Fri, 06 Oct 2017 20:38:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42477) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cR5-0000xl-9P for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:53:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cR4-0006mw-KN for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:53:43 -0400 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:33100) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cR4-0006ma-FR; Fri, 06 Oct 2017 19:53:42 -0400 Received: by mail-qk0-x242.google.com with SMTP id z12so9700751qkb.0; Fri, 06 Oct 2017 16:53:42 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.53.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:53:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ykI4tnSUBkLz8hzKxB9N2iyqvP6oAmt1ciyJeGB7v/c=; b=HHja9FQXhlZibjKWra5LZLQX77bxC4ibNNhZcp7+2PYtTyz+bBH0m48juFGUEssayT AaT0IcXlysGlxe3vVUUwwYLwWgjYFpyR2Hi1RuFKjUw9XVPIAu61i8GIsztQOwq/WhoQ 5h5jsP/kDLVT0n2DX6b5ztpDoKQeyR+x24thQ4CSOF9hTzprfrAzLrzLofwajoIX51Wf wKOo5aPHh+nX60N5F3bpaL+ie5xfjSetIlcN/jsUTxZeEK60ko1sATYzU9XXR+muZVMl q6U75Sg8wk3WT78bWtmi6nKCfYiU1gnn7XSyGnlGskLLVCWS3Z/4E3m9KSenX3l6sUTm g8Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ykI4tnSUBkLz8hzKxB9N2iyqvP6oAmt1ciyJeGB7v/c=; b=k8mZ8vLV5IKpPOGxj+MXx9RyEQUDsM2L+mubzkznrppH9GkIzat4u4gTBUYx/Yhu+F yNatuDfW3T7K74Spl3e/WDyDhSevdC6+SMaKA6DIHi62Nof6I+fCA6l6LxKdZMcmAEff B59DdP6kwgx7RbdtVXaPeCMjxe3i8MLJifTx5I86iMSsNDcvkZ1N8bVU1CZl9xean2YT sQcr6w3arKX9esj/mWsKjr7Iq1pjZT7Vf5XVvdpsFcUYNRbbNgLT9JjxnSsiE0akul2y ioDgBGIINRvKhGCmLwJVb4qD4GVD6PtWfTwO1K+en+BaPVjT7nhF/hnRVbXJBeJzsUiW bbbw== X-Gm-Message-State: AMCzsaU79hXqtfTbPMzdH9mU8hefKIitTUUQJeuk3oAczIC5A7OiUIRC jIGTQdZZPJv8mYK0Rbcri0U= X-Google-Smtp-Source: AOwi7QCvdc2uq3J7s9Hd6sA1uqX4omoq3y9CsqJMIAw18FRnMociFrs+lDfNsU2t0gqKJ3GeKCsu9Q== X-Received: by 10.55.91.69 with SMTP id p66mr694664qkb.167.1507334021939; Fri, 06 Oct 2017 16:53:41 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Markus Armbruster , Eric Blake , Paolo Bonzini , kvm@vger.kernel.org Date: Fri, 6 Oct 2017 20:49:49 -0300 Message-Id: <20171006235023.11952-55-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::242 Subject: [Qemu-devel] [PATCH 54/88] KVM: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu trival , qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Philippe Mathieu-Daud=C3=A9 [PMD: more changes] Reviewed-by: Gabriel Somlo --- accel/kvm/kvm-all.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 90c88b517d..12568d703c 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -278,7 +278,7 @@ int kvm_destroy_vcpu(CPUState *cpu) goto err; } =20 - vcpu =3D g_malloc0(sizeof(*vcpu)); + vcpu =3D g_new0(struct KVMParkedVcpu, 1); vcpu->vcpu_id =3D kvm_arch_vcpu_id(cpu); vcpu->kvm_fd =3D cpu->kvm_fd; QLIST_INSERT_HEAD(&kvm_state->kvm_parked_vcpus, vcpu, node); @@ -865,7 +865,7 @@ void kvm_memory_listener_register(KVMState *s, KVMMemor= yListener *kml, { int i; =20 - kml->slots =3D g_malloc0(s->nr_slots * sizeof(KVMSlot)); + kml->slots =3D g_new0(KVMSlot, s->nr_slots); kml->as_id =3D as_id; =20 for (i =3D 0; i < s->nr_slots; i++) { @@ -1129,7 +1129,7 @@ int kvm_irqchip_send_msi(KVMState *s, MSIMessage msg) return virq; } =20 - route =3D g_malloc0(sizeof(KVMMSIRoute)); + route =3D g_new0(KVMMSIRoute, 1); route->kroute.gsi =3D virq; route->kroute.type =3D KVM_IRQ_ROUTING_MSI; route->kroute.flags =3D 0; @@ -2243,7 +2243,7 @@ int kvm_insert_breakpoint(CPUState *cpu, target_ulong= addr, return 0; } =20 - bp =3D g_malloc(sizeof(struct kvm_sw_breakpoint)); + bp =3D g_new(struct kvm_sw_breakpoint, 1); bp->pc =3D addr; bp->use_count =3D 1; err =3D kvm_arch_insert_sw_breakpoint(cpu, bp); --=20 2.14.2