From patchwork Tue Sep 7 00:47:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1525093 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=j9ZeiK03; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4H3RgR64KXz9sW4 for ; Tue, 7 Sep 2021 10:57:07 +1000 (AEST) Received: from localhost ([::1]:42290 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNPQ9-0005HY-Kw for incoming@patchwork.ozlabs.org; Mon, 06 Sep 2021 20:57:05 -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) 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) 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) 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 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 --- 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 = 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); } /* Callback to be called during DRC release. */