From nobody Fri May 3 12:35:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1630976098878806.5845078878289; Mon, 6 Sep 2021 17:54:58 -0700 (PDT) Received: from localhost ([::1]:38046 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNPO5-0002Jh-SX for importer@patchew.org; Mon, 06 Sep 2021 20:54:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34738) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNPHb-0002Z1-DL; Mon, 06 Sep 2021 20:48:16 -0400 Received: from mail-qv1-xf2f.google.com ([2607:f8b0:4864:20::f2f]:40568) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mNPHY-0003nF-SD; Mon, 06 Sep 2021 20:48:15 -0400 Received: by mail-qv1-xf2f.google.com with SMTP id 93so4846032qva.7; Mon, 06 Sep 2021 17:48:12 -0700 (PDT) Received: from rekt.COMFAST ([179.247.136.122]) by smtp.gmail.com with ESMTPSA id x83sm7799538qkb.118.2021.09.06.17.48.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Sep 2021 17:48:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TT0UFxZrmRZc15RE6QSPgF8yShX5v3WEiTd1Mg5K8Pg=; b=p8hrcPOukIVyBbKvt/QbmdCHCchK8lh3Cre87u6DGpMu08yVNGxt/Q27G3GPdD5yzI pubAb4gGT8h1jxJ36ag5pNMzwNwVCnFs5lCCmnfD6V7Xwkf6/5+EfZ7r8FHyvxYmRHtW HHDnRI0Odo/Xf8QrILosAE4dsYEUwAngOYfOAEFEpqxfe6fj+3LFN7vDOvPjhqhSdmdx hKTh4VwzL0YYer+SzdTutdo1ZMjeuWP/4gLZfMXBDr8uTtAq6fSMq5fvZGDTCWmMNOZi +fiu875Alc1fIrTpHz9rynVPbIv1iwPlJ/DHI/rlP+psXUOGqdlM6pvATYMwbJtxiXpQ FWdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TT0UFxZrmRZc15RE6QSPgF8yShX5v3WEiTd1Mg5K8Pg=; b=OWDUXAUCd1m6vEX629PgaRQ4OKCSw3Z0ocr5F3agiOQwdAWSxR/73amYCfXOgr3LDM EiW+dbrbE2Mu7rE9ac4Qc0lNjwysdPFuTrxVBLlatEG/PdbnLhrCV5uwXm/J3+HEu/uX apwywCaKMlemzvRzs5b6WMw/zEmo1aKVy+M0UrtspxvNuSfBQlwbcumW8ZZfXS00m0gM 8vAJVVkdFzTrZmbgnPJZedfIJzVa9NAdAH7sjhsrFnDkqliIloe3rAgRVAJysPg7x6+p pbnebpX63Ply+ypOnR12GLwV1rIyuuCpbF7pGx43ucWpcK2/zHL4GfRN20a6OjI2nmSy ZqlQ== X-Gm-Message-State: AOAM530mVMi0UGBQGCOEJ3BknEoGj7DvWLqn8lrEaH/gdL1cFSu5rlBP ja8m07YQUUf1AqMK8f1ALeookjac+AA= X-Google-Smtp-Source: ABdhPJx92LEut4hKfSprMPF2qBel1XmAN3/5f9e7Xdr6QnoskVLx+GJUTxNW2jE8UCxYN9bxR+hOhw== X-Received: by 2002:a05:6214:762:: with SMTP id f2mr14522747qvz.48.1630975691508; Mon, 06 Sep 2021 17:48:11 -0700 (PDT) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v8 1/7] memory_hotplug.c: handle dev->id = NULL in acpi_memory_hotplug_write() Date: Mon, 6 Sep 2021 21:47:49 -0300 Message-Id: <20210907004755.424931-2-danielhb413@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210907004755.424931-1-danielhb413@gmail.com> References: <20210907004755.424931-1-danielhb413@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2607:f8b0:4864:20::f2f; envelope-from=danielhb413@gmail.com; helo=mail-qv1-xf2f.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Daniel Henrique Barboza , Markus Armbruster , groug@kaod.org, qemu-ppc@nongnu.org, Igor Mammedov , david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630976101150100003 Content-Type: text/plain; charset="utf-8" qapi_event_send_mem_unplug_error() deals with @device being NULL by replacing it with an empty string ("") when emitting the event. Aside from the fact that this behavior (qapi visitor mapping NULL pointer to "") can be patched/changed someday, there's also the lack of utility that the event brings to listeners, e.g. "a memory unplug error happened somewhere". In theory we should just avoit emitting this event at all if dev->id is NULL, but this would be an incompatible change to existing guests. Instead, let's make the forementioned behavior explicit: if dev->id is NULL, pass an empty string to qapi_event_send_mem_unplug_error(). Suggested-by: Markus Armbruster Reviewed-by: Igor Mammedov Reviewed-by: Greg Kurz Reviewed-by: David Gibson Reviewed-by: Markus Armbruster Signed-off-by: Daniel Henrique Barboza Acked-by: Igor Mammedov --- hw/acpi/memory_hotplug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c index af37889423..6a71de408b 100644 --- a/hw/acpi/memory_hotplug.c +++ b/hw/acpi/memory_hotplug.c @@ -178,7 +178,7 @@ static void acpi_memory_hotplug_write(void *opaque, hwa= ddr addr, uint64_t data, hotplug_handler_unplug(hotplug_ctrl, dev, &local_err); if (local_err) { trace_mhp_acpi_pc_dimm_delete_failed(mem_st->selector); - qapi_event_send_mem_unplug_error(dev->id, + qapi_event_send_mem_unplug_error(dev->id ? : "", error_get_pretty(local_er= r)); error_free(local_err); break; --=20 2.31.1 From nobody Fri May 3 12:35:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1630976299976232.69539859332997; Mon, 6 Sep 2021 17:58:19 -0700 (PDT) Received: from localhost ([::1]:44602 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNPRK-0006pa-GT for importer@patchew.org; Mon, 06 Sep 2021 20:58:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34762) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNPHd-0002aT-Jc; Mon, 06 Sep 2021 20:48:19 -0400 Received: from mail-qv1-xf34.google.com ([2607:f8b0:4864:20::f34]:33790) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mNPHb-0003oB-A6; Mon, 06 Sep 2021 20:48:17 -0400 Received: by mail-qv1-xf34.google.com with SMTP id a5so4887495qvq.0; Mon, 06 Sep 2021 17:48:14 -0700 (PDT) Received: from rekt.COMFAST ([179.247.136.122]) by smtp.gmail.com with ESMTPSA id x83sm7799538qkb.118.2021.09.06.17.48.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Sep 2021 17:48:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+wjngqjFqlhlbd6FoQ4dC7BVGynMzSjL+ChAIa/+iuA=; b=j9ZeiK03vZfAxMz1E2QsEU6kZ2CDHdk4CqbKKUM0eq3TahxmPx3YKheqUR6RG1lz7/ WifiaGIH51lhTj5sD9ecsTACx53YeHUjsHqaVH0mdaGEuuxLvH5iNCCqgCAoDjGMXKFc 5afCRjQAjxV5xrbB94AmPqgfiTWlNL4mr8GDqTedd+twce+OBE1IBQeIsCj7Fx4Q4Wz8 QtD8hLCcCXJ0mkYlImgQnMH9r90d3SyEt4BtcRjhKCGOQqDmMRSy5491Lumfp9OVR1JP oi/wft/b+PmFDKWU4IItNK7Hm8+a6cI94OZG1cjTzSenol/Hbyb9+b3LHDMTAWNYa9jz OGYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+wjngqjFqlhlbd6FoQ4dC7BVGynMzSjL+ChAIa/+iuA=; b=AE5sfyFEStoVNqnhnHP50A4jmYOndfOK4/XO+POJj/E28PngD31KHAcVuEJPdI92qI kwbccSvAKQxBJCc9Ur0SZHipsDK5GgVewEPk55XJFZEsg8uB8Sxyi7cvznwfSKdoYY9i oogcHxpE1RnC46x+r7y4agniM89mI80PwuOsSvYgMN6CLwb3WvRFcIGz73JCTvJBPVy+ BQ1ig7F8ez6nCAd1kQrrPWQFRocYpWhCY1x9aRr+ySF9cRIFAn3c+Y8xDJy63k/HMl/f ufbqTNU2uQZaMmKnAIBd7xKKCLRw+rzuDHyKUPslRi2dTMJhsNN4oWjdYT6HoFqllVK/ XBqA== X-Gm-Message-State: AOAM5313OSbJvNv87WlrW7QNgrm4BKDKFCiwCB2gdWYdDWlqsHs522rk eZaMCH2IP/Ov6nC9fGuGKUGgAcXSseE= X-Google-Smtp-Source: ABdhPJxZbGi53s/2QdJ2nkoCWX7FKfX8cFvtOWB1Pe16sIyK/oyvobQG3jhay2WuRrrQEVdhCl5Csw== X-Received: by 2002:a05:6214:12b1:: with SMTP id w17mr4358648qvu.3.1630975693514; Mon, 06 Sep 2021 17:48:13 -0700 (PDT) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v8 2/7] spapr.c: handle dev->id in spapr_memory_unplug_rollback() Date: Mon, 6 Sep 2021 21:47:50 -0300 Message-Id: <20210907004755.424931-3-danielhb413@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210907004755.424931-1-danielhb413@gmail.com> References: <20210907004755.424931-1-danielhb413@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2607:f8b0:4864:20::f34; envelope-from=danielhb413@gmail.com; helo=mail-qv1-xf34.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Markus Armbruster , Daniel Henrique Barboza , qemu-ppc@nongnu.org, groug@kaod.org, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630976300424100001 Content-Type: text/plain; charset="utf-8" As done in hw/acpi/memory_hotplug.c, pass an empty string if dev->id is NULL to qapi_event_send_mem_unplug_error() to avoid relying on a behavior that can be changed in the future. Suggested-by: Markus Armbruster Reviewed-by: Greg Kurz Reviewed-by: David Gibson Reviewed-by: Markus Armbruster Signed-off-by: Daniel Henrique Barboza Acked-by: Igor Mammedov --- hw/ppc/spapr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 81699d4f8b..4f1ee90e9e 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -3690,7 +3690,7 @@ void spapr_memory_unplug_rollback(SpaprMachineState *= spapr, DeviceState *dev) */ qapi_error =3D g_strdup_printf("Memory hotunplug rejected by the guest= " "for device %s", dev->id); - qapi_event_send_mem_unplug_error(dev->id, qapi_error); + qapi_event_send_mem_unplug_error(dev->id ? : "", qapi_error); } =20 /* Callback to be called during DRC release. */ --=20 2.31.1 From nobody Fri May 3 12:35:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16309761151542.4671075058951146; Mon, 6 Sep 2021 17:55:15 -0700 (PDT) Received: from localhost ([::1]:38762 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNPOI-0002nT-Is for importer@patchew.org; Mon, 06 Sep 2021 20:55:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34772) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNPHe-0002aX-Px; Mon, 06 Sep 2021 20:48:20 -0400 Received: from mail-qt1-x832.google.com ([2607:f8b0:4864:20::832]:45055) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mNPHd-0003pg-4l; Mon, 06 Sep 2021 20:48:18 -0400 Received: by mail-qt1-x832.google.com with SMTP id r21so6646075qtw.11; Mon, 06 Sep 2021 17:48:16 -0700 (PDT) Received: from rekt.COMFAST ([179.247.136.122]) by smtp.gmail.com with ESMTPSA id x83sm7799538qkb.118.2021.09.06.17.48.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Sep 2021 17:48:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0JMFEc3ZUKi2sqwCszx5LDecveexk0t++Hz8mUxJXlc=; b=izaYpZXOjtTKFWqfPZusQuQeYOjYdZGjL/vQMuNSyJS4h01jzVpTi5MCYVZ6vKTgt/ MVKkjxra7xPR30tW2RzjwlrmfAb/8SSvGG/QFA5EYgcruoaNlTQO+422DV7qXC+Ioc1p jQVoVjKygzdwCGeSPstZWamrhT+/1G+70ulUQJLK2ItpwsRiwkg1vomo6dFVMWkjfDFL GjhgduGiEX4zzSZZeJrG/K6AelNcyTX60G75Oqwi+aLC2KeAKvNcPp6FCvkUMXW9jl/a 9cKBUDWGa39iOVSbVlVT2/AzSjPC1A394XMIl48+uHyMRUqbBU/koQcg9f5P+/u4jbQg UUWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0JMFEc3ZUKi2sqwCszx5LDecveexk0t++Hz8mUxJXlc=; b=gTU4UYbrL+NPBWVBcDGTGgiDlHmD79E1Qg9mLacKGG08YwN7kXz23qLr9sey+Apny0 UF3cCxOfJVYUSpQI8IXIqBrun3DG8xd5XZOVDXrCyD1kKoLT1NxE9W6+XQaVYHiA4V62 02w3GHeZgvfL+p96jjzNlg1BRFfioLV48fGku7PiJtcvQFy7wvM3gmHaKnmWoxewcY/h tMRtqwvBSAmQ8N6R8rQP6kv/YLP9dVQZnmWnFvBQxLmVdMWQpCRW8eB3539GyZTOaiog FYuT8bdAw5pwPRwCooD26D1GODl00+Nyp8y48NRQ/8kygPYJLxPNtCj3uazJWDd8RtvU btcA== X-Gm-Message-State: AOAM530avuCW6o/yotOtV17JR9JdzjiOl6MM9kuHzSI2ryv3uQ4zJvST jXEy05yMuJwExrC63U0uEdukUQRHxAg= X-Google-Smtp-Source: ABdhPJxnebxLwp2rvM/xRCQNpbfmSEwIpMr9wOLQQn8yML2zSHsLFfoSCB2buVAheqQ3uyhBNFo3XQ== X-Received: by 2002:ac8:4d4e:: with SMTP id x14mr13510570qtv.347.1630975695769; Mon, 06 Sep 2021 17:48:15 -0700 (PDT) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v8 3/7] spapr_drc.c: do not error_report() when drc->dev->id == NULL Date: Mon, 6 Sep 2021 21:47:51 -0300 Message-Id: <20210907004755.424931-4-danielhb413@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210907004755.424931-1-danielhb413@gmail.com> References: <20210907004755.424931-1-danielhb413@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2607:f8b0:4864:20::832; envelope-from=danielhb413@gmail.com; helo=mail-qt1-x832.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Markus Armbruster , Daniel Henrique Barboza , qemu-ppc@nongnu.org, groug@kaod.org, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630976115940100001 Content-Type: text/plain; charset="utf-8" The error_report() call in drc_unisolate_logical() is not considering that drc->dev->id can be NULL, and the underlying functions error_report() calls to do its job (vprintf(), g_strdup_printf() ...) has undefined behavior when trying to handle "%s" with NULL arguments. Besides, there is no utility into reporting that an unknown device was rejected by the guest. Acked-by: David Gibson Reviewed-by: Greg Kurz Reviewed-by: Markus Armbruster Signed-off-by: Daniel Henrique Barboza Acked-by: Igor Mammedov --- hw/ppc/spapr_drc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c index a2f2634601..a4d9496f76 100644 --- a/hw/ppc/spapr_drc.c +++ b/hw/ppc/spapr_drc.c @@ -167,8 +167,11 @@ static uint32_t drc_unisolate_logical(SpaprDrc *drc) } =20 drc->unplug_requested =3D false; - error_report("Device hotunplug rejected by the guest " - "for device %s", drc->dev->id); + + if (drc->dev->id) { + error_report("Device hotunplug rejected by the guest " + "for device %s", drc->dev->id); + } =20 /* * TODO: send a QAPI DEVICE_UNPLUG_ERROR event when --=20 2.31.1 From nobody Fri May 3 12:35:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16309760901043.51451247647708; Mon, 6 Sep 2021 17:54:50 -0700 (PDT) Received: from localhost ([::1]:37366 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNPNx-0001rH-3h for importer@patchew.org; Mon, 06 Sep 2021 20:54:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34796) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNPHk-0002c4-HE; Mon, 06 Sep 2021 20:48:26 -0400 Received: from mail-qt1-x835.google.com ([2607:f8b0:4864:20::835]:40764) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mNPHg-0003rY-RW; Mon, 06 Sep 2021 20:48:23 -0400 Received: by mail-qt1-x835.google.com with SMTP id c19so6659908qte.7; Mon, 06 Sep 2021 17:48:18 -0700 (PDT) Received: from rekt.COMFAST ([179.247.136.122]) by smtp.gmail.com with ESMTPSA id x83sm7799538qkb.118.2021.09.06.17.48.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Sep 2021 17:48:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UsOT6/JeyB56WiKG7UbAHoKZig4euttAV/jLYfKeiOM=; b=PrQ44nydxypCtzRMe0wG5ezmRWqCpDT5i8BzpiOzMT8+Io0/bK65H3wd9/UUacFH2e vgRa5R/jMt0waC6nB5WWWlreePs+4G7InVwQYMccECc8nI2/5pq3336LJ4qbeilNzMXL FBVxQwkGIqFTu1bZDfIp/ae8nUNW/H3Fhf10vogo+mYhAfrHC5zwOd5cG2jVvbt1PKOS JcHdmy4PXOcwtzU9cbAn5oF6UO4CAgBAwjEPlyET/cVr4s/Bd7HlJzyY/OfZNXguoCo+ RlzXD5Qebiu9EMNdmreaDeiwfgTa6T6+N/SxH5C9/JYT5b1aWpEKTK80+xI/LDRFB9qq yQnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UsOT6/JeyB56WiKG7UbAHoKZig4euttAV/jLYfKeiOM=; b=PSdYNKYvW+GJZHv3sCnjnumT2YkbCAxyIl2PCoybTl7O+7SsVL/gjMXiDlaBHmnWAo sHKBbi/0oAA13P7WNd4KavKyocsow2akUeGsZ8N36b14tbuPGyk7iS9iWM8otF5q+cf7 No1iiAJKGz9YF1AFhsZ8f8DixjdGNMgWPloElfByR05NB1kC6NBH/YjpMRybpV5PMuEs GLsZY7lMjzZpQU6w9zhHQQnJFB12GRwwmwrGrHO18B4634p1HQaAXDen66ovPEMmecCw 7SR0U+H6i4aP0OWIErEuJ2ZjX5tMmKl/d1Me/h/9NeKxlFua5UfklO5/wTrEEVNBp+L1 UU0Q== X-Gm-Message-State: AOAM532kR9f5rCu5g/tZSXT4Z0uOSWEKLc/I4utmW8+nK5xm7XGbZW+i orM+YAqV6nK7ZiknNksPYY9PcsnGkFI= X-Google-Smtp-Source: ABdhPJxj0l9BCXUzHg+oxgOmHNJ7JG1MbZK5t+HRiCQbGZ8pZ19IbgLTCtnoOAmiGfTRirDZD54Pxw== X-Received: by 2002:ac8:424c:: with SMTP id r12mr13071293qtm.183.1630975698040; Mon, 06 Sep 2021 17:48:18 -0700 (PDT) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v8 4/7] qapi/qdev.json: fix DEVICE_DELETED parameters doc Date: Mon, 6 Sep 2021 21:47:52 -0300 Message-Id: <20210907004755.424931-5-danielhb413@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210907004755.424931-1-danielhb413@gmail.com> References: <20210907004755.424931-1-danielhb413@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2607:f8b0:4864:20::835; envelope-from=danielhb413@gmail.com; helo=mail-qt1-x835.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Markus Armbruster , Daniel Henrique Barboza , qemu-ppc@nongnu.org, groug@kaod.org, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630976090981100001 Content-Type: text/plain; charset="utf-8" Clarify that @device is optional and that 'path' is the device path from QOM. This change follows Markus' suggestion verbatim, provided in full context here: https://lists.gnu.org/archive/html/qemu-devel/2021-07/msg01891.html Suggested-by: Markus Armbruster Reviewed-by: Greg Kurz Reviewed-by: Markus Armbruster Reviewed-by: David Gibson Signed-off-by: Daniel Henrique Barboza Acked-by: Igor Mammedov --- qapi/qdev.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qapi/qdev.json b/qapi/qdev.json index b83178220b..0e9cb2ae88 100644 --- a/qapi/qdev.json +++ b/qapi/qdev.json @@ -108,9 +108,9 @@ # At this point, it's safe to reuse the specified device ID. Device remova= l can # be initiated by the guest or by HMP/QMP commands. # -# @device: device name +# @device: the device's ID if it has one # -# @path: device path +# @path: the device's QOM path # # Since: 1.5 # --=20 2.31.1 From nobody Fri May 3 12:35:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1630976383995683.39605407366; Mon, 6 Sep 2021 17:59:43 -0700 (PDT) Received: from localhost ([::1]:48432 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNPSh-0000yo-0S for importer@patchew.org; Mon, 06 Sep 2021 20:59:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34798) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNPHk-0002c5-IR; Mon, 06 Sep 2021 20:48:26 -0400 Received: from mail-qv1-xf32.google.com ([2607:f8b0:4864:20::f32]:40571) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mNPHh-0003t8-OV; Mon, 06 Sep 2021 20:48:24 -0400 Received: by mail-qv1-xf32.google.com with SMTP id 93so4846179qva.7; Mon, 06 Sep 2021 17:48:20 -0700 (PDT) Received: from rekt.COMFAST ([179.247.136.122]) by smtp.gmail.com with ESMTPSA id x83sm7799538qkb.118.2021.09.06.17.48.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Sep 2021 17:48:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jv/FTCfQ2t/c85uXR7JxDxmo4FnVjkbZPHxekYv/OSU=; b=IrcDk3Xm4O59Wo+hyTPugrw6iAA9/fStPZg6DxNoPSj7B80/o9TQltV2i0dExwgibq xLMTfusd65Va2NnGzm14tIpwL+m5UTNqfzBHTYdUL57Btr6RXNNCUf+cZqjopXZxz2nN uSC6otDKlfe5TFpBmGRKEYJAxD81N96pdoQBA2A/c7UNeeG4CPZNx9NJqUzmF0qZSkbO PxBSPSfEqTnl5HP5TZ8T4XOtyQnSiQVHvHKS7UNflac49RVrB9kzyC8KTcsoLnMyiZ4x aOhS6Awb18X0sowAkpfpR8lGaOLYpbMJdjQsBm/JavGSn1On6qCxYdiV8Gn4/3T0THnT AnBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jv/FTCfQ2t/c85uXR7JxDxmo4FnVjkbZPHxekYv/OSU=; b=bkF0AiFCa8TTZFfasYfxxBi3gaV2xK2tnLy5MryQt+FrnxUQFRMkxevhUR/E/UWVid /v2lzFnYOFznH/fwuGSjQ2s1dXlw59iM2EngDOf//8qycOPRdbfmjk+4v+oE7+BQa7lS ijRe3YF4SA5LG9xYpqvT1dphxryICPK68pcbI7G7Hk8UMYtlMtO8COfqqzV+K7YFBBWa RN11bLiORS5Hd7MWuQV6F4A9BghAcQDLQk9Klgh48yGrN8Q8JEbfpq3jgStpKzBfmsYE uZodsTs5eUHTrqF9mkfskfZJwW5DciLXldz+dqRZF/o3GKuvGCZhwHPark+tJuR5RAWS eVlA== X-Gm-Message-State: AOAM533ryt1YG6GGkT2lcVUX9Pjr0lGUcZxpBTyg8eW2OqJqWSOt9tdd LCdpHvWNN7ovj616oJkjFbg8jOvM3PQ= X-Google-Smtp-Source: ABdhPJxLbxBLgyWlIGrOm6mw5NBwyXLjv3wTYmlWuUZxtpHKvN1V4/Ja8DNLxSxuXMISDf275jiKng== X-Received: by 2002:a0c:8150:: with SMTP id 74mr14235196qvc.31.1630975700121; Mon, 06 Sep 2021 17:48:20 -0700 (PDT) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v8 5/7] qapi/qdev.json: add DEVICE_UNPLUG_GUEST_ERROR QAPI event Date: Mon, 6 Sep 2021 21:47:53 -0300 Message-Id: <20210907004755.424931-6-danielhb413@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210907004755.424931-1-danielhb413@gmail.com> References: <20210907004755.424931-1-danielhb413@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2607:f8b0:4864:20::f32; envelope-from=danielhb413@gmail.com; helo=mail-qv1-xf32.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Markus Armbruster , Daniel Henrique Barboza , qemu-ppc@nongnu.org, groug@kaod.org, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630976385869100001 Content-Type: text/plain; charset="utf-8" At this moment we only provide one event to report a hotunplug error, MEM_UNPLUG_ERROR. As of Linux kernel 5.12 and QEMU 6.0.0, the pseries machine is now able to report unplug errors for other device types, such as CPUs. Instead of creating a (device_type)_UNPLUG_ERROR for each new device, create a generic DEVICE_UNPLUG_GUEST_ERROR event that can be used by all guest side unplug errors in the future. This event has a similar API as the existing DEVICE_DELETED event, always providing the QOM path of the device and dev->id if there's any. With this new generic event, MEM_UNPLUG_ERROR is now marked as deprecated. Reviewed-by: David Gibson Reviewed-by: Greg Kurz Reviewed-by: Markus Armbruster Signed-off-by: Daniel Henrique Barboza Acked-by: Igor Mammedov --- docs/about/deprecated.rst | 10 ++++++++++ qapi/machine.json | 7 ++++++- qapi/qdev.json | 27 ++++++++++++++++++++++++++- stubs/qdev.c | 7 +++++++ 4 files changed, 49 insertions(+), 2 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 6d438f1c8d..1a8ffc9381 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -204,6 +204,16 @@ The ``I7200`` guest CPU relies on the nanoMIPS ISA, wh= ich is deprecated (the ISA has never been upstreamed to a compiler toolchain). Therefore this CPU is also deprecated. =20 + +QEMU API (QAPI) events +---------------------- + +``MEM_UNPLUG_ERROR`` (since 6.2) +'''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +Use the more generic event ``DEVICE_UNPLUG_GUEST_ERROR`` instead. + + System emulator machines ------------------------ =20 diff --git a/qapi/machine.json b/qapi/machine.json index 157712f006..cd397f1ee4 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -1271,6 +1271,10 @@ # # @msg: Informative message # +# Features: +# @deprecated: This event is deprecated. Use @DEVICE_UNPLUG_GUEST_ERROR +# instead. +# # Since: 2.4 # # Example: @@ -1283,7 +1287,8 @@ # ## { 'event': 'MEM_UNPLUG_ERROR', - 'data': { 'device': 'str', 'msg': 'str' } } + 'data': { 'device': 'str', 'msg': 'str' }, + 'features': ['deprecated'] } =20 ## # @SMPConfiguration: diff --git a/qapi/qdev.json b/qapi/qdev.json index 0e9cb2ae88..d75e68908b 100644 --- a/qapi/qdev.json +++ b/qapi/qdev.json @@ -84,7 +84,9 @@ # This command merely requests that the guest begin the hot removal # process. Completion of the device removal process is signaled wi= th a # DEVICE_DELETED event. Guest reset will automatically complete rem= oval -# for all devices. +# for all devices. If a guest-side error in the hot removal proces= s is +# detected, the device will not be removed and a DEVICE_UNPLUG_GUES= T_ERROR +# event is sent. Some errors cannot be detected. # # Since: 0.14 # @@ -124,3 +126,26 @@ ## { 'event': 'DEVICE_DELETED', 'data': { '*device': 'str', 'path': 'str' } } + +## +# @DEVICE_UNPLUG_GUEST_ERROR: +# +# Emitted when a device hot unplug fails due to a guest reported error. +# +# @device: the device's ID if it has one +# +# @path: the device's QOM path +# +# Since: 6.2 +# +# Example: +# +# <- { "event": "DEVICE_UNPLUG_GUEST_ERROR" +# "data": { "device": "core1", +# "path": "/machine/peripheral/core1" }, +# }, +# "timestamp": { "seconds": 1615570772, "microseconds": 202844 } } +# +## +{ 'event': 'DEVICE_UNPLUG_GUEST_ERROR', + 'data': { '*device': 'str', 'path': 'str' } } diff --git a/stubs/qdev.c b/stubs/qdev.c index 92e6143134..28d6d531e6 100644 --- a/stubs/qdev.c +++ b/stubs/qdev.c @@ -21,3 +21,10 @@ void qapi_event_send_device_deleted(bool has_device, { /* Nothing to do. */ } + +void qapi_event_send_device_unplug_guest_error(bool has_device, + const char *device, + const char *path +{ + /* Nothing to do. */ +} --=20 2.31.1 From nobody Fri May 3 12:35:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1630976305558668.989198693716; Mon, 6 Sep 2021 17:58:25 -0700 (PDT) Received: from localhost ([::1]:45002 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNPRQ-00077b-B7 for importer@patchew.org; Mon, 06 Sep 2021 20:58:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34816) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNPHm-0002cA-8Z; Mon, 06 Sep 2021 20:48:27 -0400 Received: from mail-qv1-xf30.google.com ([2607:f8b0:4864:20::f30]:42669) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mNPHk-0003uu-LV; Mon, 06 Sep 2021 20:48:25 -0400 Received: by mail-qv1-xf30.google.com with SMTP id gf5so4841760qvb.9; Mon, 06 Sep 2021 17:48:23 -0700 (PDT) Received: from rekt.COMFAST ([179.247.136.122]) by smtp.gmail.com with ESMTPSA id x83sm7799538qkb.118.2021.09.06.17.48.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Sep 2021 17:48:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GvmcxEMn4e6RWfLc3TE5EoPeHxym9QX9mPASOKus7u8=; b=mrC90IByvRpflc/4hmgHRjj6NznrWL2z3qeSH1FSVt6lLlGfvqXl7x7DBZpjYSvAuO 5gNd1BXC8RgUZFZiV03MT6lQC9fIZ94QrrJNp1ZGPJXYmx5fm0WQBgr42NWBVUPsvip+ CSnWAyKKTBJe/KgRHZwYFyo8BAMWcnB7PKaib4kY6BSPhlg2+uAVBX99hOsVE77lptBZ hbrt0NiTWd5tYNndc2YRanyT/FH0v26GOfvc4M2LnINfvqCOuGGvn6vLSnma0iT7yvbU oAtVvqPpsHCAlUHyNgxzugxpjz+ugSKiCjvyH80VZMsmm3VcoDQ3vMoj7uTblJeAqHIL 8+tA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GvmcxEMn4e6RWfLc3TE5EoPeHxym9QX9mPASOKus7u8=; b=YtMQUWcwPfIWjl5+owNzTnUtQhSHUNyYASCphLH43vN/I7wlVO9hHDXkFzNiYEAeDJ lGlaUnOtNq3Mhq9LzRVj6SuoiG5oqEqgvGpM/POBnluYzBJzykaixIPtDj64HnHBuXdC svBgiKIN2xe8JEkIff+sGvhPi+5gjnTus7lVEDEoZfuNb4Rko7AyaosTQhSXD7yKjXMW 4J3UT6v87WQLXrAO4cmIiCqsV98JWc3VmmPZxcn9lObN62WO/uFhBh22BfhEwfh1MjEX DRZZV2StN0wAb5K2/RG12fuzbHfh0LUrVcISLxsyVlNzCrZeI21NqIbuO4MnHg8XCD7P uGlw== X-Gm-Message-State: AOAM531hpVJeN8n0ERVYIQLn1oWQEMQB4xXa38kw3rMLvt2M4FfXgVJR Mry87jXLl/KDeQ79LciRXRtIa/MrXwo= X-Google-Smtp-Source: ABdhPJz/VmOgM2m1E/da54Yq+BNm982ZJkFLyOy0pV178hD0v58a//I03gOlxnFsj+JoXa3sujQfvA== X-Received: by 2002:a0c:e1cf:: with SMTP id v15mr14387023qvl.50.1630975702228; Mon, 06 Sep 2021 17:48:22 -0700 (PDT) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v8 6/7] spapr: use DEVICE_UNPLUG_GUEST_ERROR to report unplug errors Date: Mon, 6 Sep 2021 21:47:54 -0300 Message-Id: <20210907004755.424931-7-danielhb413@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210907004755.424931-1-danielhb413@gmail.com> References: <20210907004755.424931-1-danielhb413@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2607:f8b0:4864:20::f30; envelope-from=danielhb413@gmail.com; helo=mail-qv1-xf30.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Markus Armbruster , Daniel Henrique Barboza , qemu-ppc@nongnu.org, groug@kaod.org, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630976306737100001 Content-Type: text/plain; charset="utf-8" Linux Kernel 5.12 is now unisolating CPU DRCs in the device_removal error path, signalling that the hotunplug process wasn't successful. This allow us to send a DEVICE_UNPLUG_GUEST_ERROR in drc_unisolate_logical() to signal this error to the management layer. We also have another error path in spapr_memory_unplug_rollback() for configured LMB DRCs. Kernels older than 5.13 will not unisolate the LMBs in the hotunplug error path, but it will reconfigure them. Let's send the DEVICE_UNPLUG_GUEST_ERROR event in that code path as well to cover the case of older kernels. Acked-by: David Gibson Reviewed-by: Greg Kurz Reviewed-by: Markus Armbruster Signed-off-by: Daniel Henrique Barboza Acked-by: Igor Mammedov --- hw/ppc/spapr.c | 10 +++++++++- hw/ppc/spapr_drc.c | 9 +++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 4f1ee90e9e..206c536d3a 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -29,6 +29,7 @@ #include "qemu/datadir.h" #include "qapi/error.h" #include "qapi/qapi-events-machine.h" +#include "qapi/qapi-events-qdev.h" #include "qapi/visitor.h" #include "sysemu/sysemu.h" #include "sysemu/hostmem.h" @@ -3686,11 +3687,18 @@ void spapr_memory_unplug_rollback(SpaprMachineState= *spapr, DeviceState *dev) =20 /* * Tell QAPI that something happened and the memory - * hotunplug wasn't successful. + * hotunplug wasn't successful. Keep sending + * MEM_UNPLUG_ERROR even while sending + * DEVICE_UNPLUG_GUEST_ERROR until the deprecation of + * MEM_UNPLUG_ERROR is due. */ qapi_error =3D g_strdup_printf("Memory hotunplug rejected by the guest= " "for device %s", dev->id); + qapi_event_send_mem_unplug_error(dev->id ? : "", qapi_error); + + qapi_event_send_device_unplug_guest_error(!!dev->id, dev->id, + dev->canonical_path); } =20 /* Callback to be called during DRC release. */ diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c index a4d9496f76..f8ac0a10df 100644 --- a/hw/ppc/spapr_drc.c +++ b/hw/ppc/spapr_drc.c @@ -17,6 +17,8 @@ #include "hw/ppc/spapr_drc.h" #include "qom/object.h" #include "migration/vmstate.h" +#include "qapi/error.h" +#include "qapi/qapi-events-qdev.h" #include "qapi/visitor.h" #include "qemu/error-report.h" #include "hw/ppc/spapr.h" /* for RTAS return codes */ @@ -173,10 +175,9 @@ static uint32_t drc_unisolate_logical(SpaprDrc *drc) "for device %s", drc->dev->id); } =20 - /* - * TODO: send a QAPI DEVICE_UNPLUG_ERROR event when - * it is implemented. - */ + qapi_event_send_device_unplug_guest_error(!!drc->dev->id, + drc->dev->id, + drc->dev->canonical_= path); } =20 return RTAS_OUT_SUCCESS; /* Nothing to do */ --=20 2.31.1 From nobody Fri May 3 12:35:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1630976575926754.7869568055809; Mon, 6 Sep 2021 18:02:55 -0700 (PDT) Received: from localhost ([::1]:51372 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNPVn-00037v-0A for importer@patchew.org; Mon, 06 Sep 2021 21:02:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34840) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNPHp-0002dQ-26; Mon, 06 Sep 2021 20:48:29 -0400 Received: from mail-qv1-xf34.google.com ([2607:f8b0:4864:20::f34]:45732) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mNPHm-0003vt-A8; Mon, 06 Sep 2021 20:48:28 -0400 Received: by mail-qv1-xf34.google.com with SMTP id bn14so4840661qvb.12; Mon, 06 Sep 2021 17:48:25 -0700 (PDT) Received: from rekt.COMFAST ([179.247.136.122]) by smtp.gmail.com with ESMTPSA id x83sm7799538qkb.118.2021.09.06.17.48.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Sep 2021 17:48:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EgW8Hbfj94ViuTMJoNQ2Pnl4i/3lLVhvBSmCDF91yq0=; b=RlD41plFhfA9CX19r0GM1Iy+T5iak2rBViZjVXCc9yIW59E4+AHIRhREduODI1BS5a UW+G4yJZcCnhuTv7G7Zsb13xRZl+FyknSkQM+8EkBBjwh6x8E5g42d+5C9kHfVYMk715 F0/y75gAW1LJg4cpF5CgA34G7KYJhp/br3tMCYffKNbT/LfGQ+d98Z60wpXe1+VArvT2 UIna42v1qQvxklWS8RXwxHU8Ga4oIPxpnIU0D4CcvDRp3qa3LihSbcdyROmpp6jWLE90 SZqbs7oXgeDejgUVKdrfIjhMG7Eg26SVo+lLOZO4jHLPLMPScHk3UAtoAltMFShhIIx6 3RGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EgW8Hbfj94ViuTMJoNQ2Pnl4i/3lLVhvBSmCDF91yq0=; b=arnyZPo5BfnDzH4gnllQJpUItf48AzHRqTLIz9pcuw8dP9NYYN2JLqx6simL7feWoR BRIh7LhyNvfrly6MrZB46CWjrqwG4HVOU2OHUmNBm+ZM+opaZ4RgLDT0nwPmUoiSukS0 PGfCUSEbQ2MsC3YVdplyZCIhvVcekt+tDboVbcZD04I2Ga1wywQ/e5Kn0G8ic/b2YqFT 1Jblg7ck+AubAR7CRK6Kb4i8sLi2pjkkj7iusCvZ75rnKEL8hgxbq5mYtgqBs8ctOiCx UlNpftp6d5XsNZtPz0m5t6d3/UmtQ0wUsWLF+ZgALvCV5eAnkpa7QUJUgnX59KmH5d7S TPVw== X-Gm-Message-State: AOAM531GoX1v0U8z65BV/mELseZvC0PxAtHWWJA6bHnWcU9w8NQOEoss 4wL7BN9oXyyE9iv+3g/geDSYaZzf5RE= X-Google-Smtp-Source: ABdhPJxG8d6YZuEIb88pWdb/LMaJ+MZpBFCA0Rk/equG+1MabnuQkZL0+VoQbvUg31WE24mTaCqmCw== X-Received: by 2002:ad4:46f0:: with SMTP id h16mr14666084qvw.0.1630975704660; Mon, 06 Sep 2021 17:48:24 -0700 (PDT) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v8 7/7] memory_hotplug.c: send DEVICE_UNPLUG_GUEST_ERROR in acpi_memory_hotplug_write() Date: Mon, 6 Sep 2021 21:47:55 -0300 Message-Id: <20210907004755.424931-8-danielhb413@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210907004755.424931-1-danielhb413@gmail.com> References: <20210907004755.424931-1-danielhb413@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2607:f8b0:4864:20::f34; envelope-from=danielhb413@gmail.com; helo=mail-qv1-xf34.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: "Michael S . Tsirkin" , Daniel Henrique Barboza , groug@kaod.org, Markus Armbruster , qemu-ppc@nongnu.org, Igor Mammedov , david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630976576522100001 Content-Type: text/plain; charset="utf-8" MEM_UNPLUG_ERROR is deprecated since the introduction of DEVICE_UNPLUG_GUEST_ERROR. Keep emitting both while the deprecation of MEM_UNPLUG_ERROR is pending. CC: Michael S. Tsirkin CC: Igor Mammedov Acked-by: Michael S. Tsirkin Reviewed-by: Greg Kurz Reviewed-by: David Gibson Reviewed-by: Igor Mammedov Reviewed-by: Markus Armbruster Signed-off-by: Daniel Henrique Barboza Acked-by: Igor Mammedov --- hw/acpi/memory_hotplug.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c index 6a71de408b..d0fffcf787 100644 --- a/hw/acpi/memory_hotplug.c +++ b/hw/acpi/memory_hotplug.c @@ -8,6 +8,7 @@ #include "qapi/error.h" #include "qapi/qapi-events-acpi.h" #include "qapi/qapi-events-machine.h" +#include "qapi/qapi-events-qdev.h" =20 #define MEMORY_SLOTS_NUMBER "MDNR" #define MEMORY_HOTPLUG_IO_REGION "HPMR" @@ -178,8 +179,16 @@ static void acpi_memory_hotplug_write(void *opaque, hw= addr addr, uint64_t data, hotplug_handler_unplug(hotplug_ctrl, dev, &local_err); if (local_err) { trace_mhp_acpi_pc_dimm_delete_failed(mem_st->selector); + + /* + * Send both MEM_UNPLUG_ERROR and DEVICE_UNPLUG_GUEST_ERROR + * while the deprecation of MEM_UNPLUG_ERROR is + * pending. + */ qapi_event_send_mem_unplug_error(dev->id ? : "", error_get_pretty(local_er= r)); + qapi_event_send_device_unplug_guest_error(!!dev->id, dev->= id, + dev->canonical_p= ath); error_free(local_err); break; } --=20 2.31.1