From nobody Mon May 6 10:28:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 15481563757463.9442365677805356; Tue, 22 Jan 2019 03:26:15 -0800 (PST) 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 mx1.redhat.com (Postfix) with ESMTPS id D7F1189ACF; Tue, 22 Jan 2019 11:26:13 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9C5C35D739; Tue, 22 Jan 2019 11:26:13 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 428173F7CD; Tue, 22 Jan 2019 11:26:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x0MBQ4Y2011883 for ; Tue, 22 Jan 2019 06:26:04 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1351117C69; Tue, 22 Jan 2019 11:26:04 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8C0AE4142 for ; Tue, 22 Jan 2019 11:26:03 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 22 Jan 2019 12:25:57 +0100 Message-Id: <585481e129344aa255f1492d8e19f20316df4e6b.1548156289.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/2] qemu: process: Improve documentation of values handled by qemuProcessHandleAcpiOstInfo X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 22 Jan 2019 11:26:14 +0000 (UTC) Content-Type: text/plain; charset="utf-8" We forgot to document the specific fields for the 0x103 and 0x200 sources which are tied to device removal and device hotplug respectively. The value description is based on the ACPI 6.2A standard Table 6-207 and Table 6-208. At the time of writing of this patch the standard can be accessed e.g. at: https://www.uefi.org/sites/default/files/resources/ACPI%206_2_A_Sept29.pdf Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_process.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 855bd9cb14..6533106cdd 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -1344,14 +1344,36 @@ qemuProcessHandleDeviceDeleted(qemuMonitorPtr mon A= TTRIBUTE_UNUSED, * 0x01: non-specific failure * 0x02: unrecognized notify code * 0x03 - 0x7f: reserved - * other values are specific to the notification type + * other values are specific to the notification type (see below) * - * for the 0x100 source the following additional codes are standardized + * for the 0x100 source the following additional codes are standardized: * 0x80: OS Shutdown request denied * 0x81: OS Shutdown in progress * 0x82: OS Shutdown completed * 0x83: OS Graceful shutdown not supported - * other values are reserved + * other higher values are reserved + * + * for the 0x003 (Ejection request) and 0x103 (Ejection processing) source + * the following additional codes are standardized: + * 0x80: Device ejection not supported by OSPM + * 0x81: Device in use by application + * 0x82: Device Busy + * 0x83: Ejection dependency is busy or not supported for ejection by = OSPM + * 0x84: Ejection is in progress (pending) + * other higher values are reserved + * + * for the 0x200 source the following additional codes are standardized: + * 0x80: Device insertion in progress (pending) + * 0x81: Device driver load failure + * 0x82: Device insertion not supported by OSPM + * 0x83-0x8F: Reserved + * 0x90-0x9F: Insertion failure - Resources Unavailable as described b= y the + * following bit encodings: + * Bit [3]: Bus or Segment Numbers + * Bit [2]: Interrupts + * Bit [1]: I/O + * Bit [0]: Memory + * other higher values are reserved * * Other fields and semantics are specific to the qemu handling of the eve= nt. * - @alias may be NULL for successful unplug operations --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 10:28:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1548156381793648.0137280938739; Tue, 22 Jan 2019 03:26:21 -0800 (PST) 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 mx1.redhat.com (Postfix) with ESMTPS id 5B7E858E32; Tue, 22 Jan 2019 11:26:19 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1C3385D738; Tue, 22 Jan 2019 11:26:19 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id B45731803396; Tue, 22 Jan 2019 11:26:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x0MBQ4dx011893 for ; Tue, 22 Jan 2019 06:26:04 -0500 Received: by smtp.corp.redhat.com (Postfix) id DA5046A69A; Tue, 22 Jan 2019 11:26:04 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 610CA6A685 for ; Tue, 22 Jan 2019 11:26:04 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 22 Jan 2019 12:25:58 +0100 Message-Id: <058b7eb9be5788357eaa19fc42532b87b948a8ce.1548156289.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/2] qemu: process: Handle all failure values for dimms in qemuProcessHandleAcpiOstInfo X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 22 Jan 2019 11:26:20 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Hanlde all the possible failure codes as per ACPI standard documented in the function header. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1660410 Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_process.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 6533106cdd..993f0e7bd2 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -1403,14 +1403,20 @@ qemuProcessHandleAcpiOstInfo(qemuMonitorPtr mon ATT= RIBUTE_UNUSED, "slotType=3D'%s' slot=3D'%s' source=3D%u status=3D%u", NULLSTR(alias), vm, vm->def->name, slotType, slot, source, s= tatus); - /* handle memory unplug failure */ - if (STREQ(slotType, "DIMM") && alias && status =3D=3D 1) { - qemuDomainSignalDeviceRemoval(vm, alias, - QEMU_DOMAIN_UNPLUGGING_DEVICE_STATUS= _GUEST_REJECTED); + if (!alias) + goto cleanup; + + if (STREQ(slotType, "DIMM")) { + if ((source =3D=3D 0x003 || source =3D=3D 0x103) && + (status =3D=3D 0x01 || (status >=3D 0x80 && status <=3D 0x83))= ) { + qemuDomainSignalDeviceRemoval(vm, alias, + QEMU_DOMAIN_UNPLUGGING_DEVICE_ST= ATUS_GUEST_REJECTED); - event =3D virDomainEventDeviceRemovalFailedNewFromObj(vm, alias); + event =3D virDomainEventDeviceRemovalFailedNewFromObj(vm, alia= s); + } } + cleanup: virObjectUnlock(vm); virObjectEventStateQueue(driver->domainEventState, event); --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list