From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CEAF0C07E99 for ; Fri, 9 Jul 2021 08:40:26 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 5400E613C8 for ; Fri, 9 Jul 2021 08:40:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5400E613C8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:35594 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m1m3d-000281-AX for qemu-devel@archiver.kernel.org; Fri, 09 Jul 2021 04:40:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41204) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m1m2i-0001El-9v for qemu-devel@nongnu.org; Fri, 09 Jul 2021 04:39:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:50333) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m1m2e-00069E-Sg for qemu-devel@nongnu.org; Fri, 09 Jul 2021 04:39:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625819963; 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=VT8sCEIPD0AEtr/hoFfbFOM0MkXPDHRv2Yu7lYYl4tc=; b=GkrO7RIk7fQfzsib2RML0q6MHMx6IfVCQnw43brsyGqqTOMTX0Z7V1OwxXXk6absAKcnoz oElSgl20viJb7EwN0lpNdFOQ3W5BrtaWDK+q8uvWJXPF4+EctdtocPIHLOgeyByRs6Daqn MMGeDVo7qJs1UxXOIJ9bYJF7Oqwjsuk= 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-602-DT1zGxc0Nfi2WVUlfUXHlg-1; Fri, 09 Jul 2021 04:39:20 -0400 X-MC-Unique: DT1zGxc0Nfi2WVUlfUXHlg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9B5EF8F4E8; Fri, 9 Jul 2021 08:39:19 +0000 (UTC) Received: from localhost (unknown [10.43.2.75]) by smtp.corp.redhat.com (Postfix) with ESMTP id 788A0189C7; Fri, 9 Jul 2021 08:39:14 +0000 (UTC) Date: Fri, 9 Jul 2021 10:39:13 +0200 From: Igor Mammedov To: Markus Armbruster Subject: Re: [PATCH v4 3/3] memory_hotplug.c: send DEVICE_UNPLUG_ERROR in acpi_memory_hotplug_write() Message-ID: <20210709103913.5c938852@redhat.com> In-Reply-To: <87h7h56jh2.fsf@dusky.pond.sub.org> References: <20210707003314.37110-1-danielhb413@gmail.com> <20210707003314.37110-4-danielhb413@gmail.com> <87h7h56jh2.fsf@dusky.pond.sub.org> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=imammedo@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=170.10.133.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.45, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, eblake@redhat.com, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Thu, 08 Jul 2021 15:08:57 +0200 Markus Armbruster wrote: > Daniel Henrique Barboza writes: > > > MEM_UNPLUG_ERROR is deprecated since the introduction of > > DEVICE_UNPLUG_ERROR. Keep emitting both while the deprecation of > > MEM_UNPLUG_ERROR is pending. > > > > CC: Michael S. Tsirkin > > CC: Igor Mammedov > > Reviewed-by: David Gibson > > Signed-off-by: Daniel Henrique Barboza > > --- > > hw/acpi/memory_hotplug.c | 13 +++++++++++-- > > 1 file changed, 11 insertions(+), 2 deletions(-) > > > > diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c > > index af37889423..fb9f4d2de7 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" > > > > #define MEMORY_SLOTS_NUMBER "MDNR" > > #define MEMORY_HOTPLUG_IO_REGION "HPMR" > > @@ -177,9 +178,17 @@ static void acpi_memory_hotplug_write(void *opaque, hwaddr addr, uint64_t data, > > /* call pc-dimm unplug cb */ > > hotplug_handler_unplug(hotplug_ctrl, dev, &local_err); > > if (local_err) { > > + const char *error_pretty = error_get_pretty(local_err); > > + > > trace_mhp_acpi_pc_dimm_delete_failed(mem_st->selector); > > - qapi_event_send_mem_unplug_error(dev->id, > > - error_get_pretty(local_err)); > > + > > + /* > > + * Send both MEM_UNPLUG_ERROR and DEVICE_UNPLUG_ERROR > > + * while the deprecation of MEM_UNPLUG_ERROR is > > + * pending. > > + */ > > + qapi_event_send_mem_unplug_error(dev->id, error_pretty); > > + qapi_event_send_device_unplug_error(dev->id, error_pretty); > > error_free(local_err); > > break; > > } > > Same question as for PATCH 2: can dev->id be null? only theoretically (if memory device were created directly without using device_add), which as far as I know is not the case as all memory devices are created using -device/device_add so far. ( for device_add case see qdev_device_add->qdev_set_id where 'id' is set to user provided or to generated "device[%d]" value)