From nobody Sat May 4 19:08:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600026841; cv=none; d=zohomail.com; s=zohoarc; b=CtPOt2TpF+x69WMKPCWPyaxMIm9sAhNn7xUh22iIdCeK15seHmqCoCqWX+wyAXEAKjzS4Jc0dLX6kscDD8DGTNU7BPV9Enrq8jNR7/8PJDvOK8HLcA+EVcFYDCMwoKkzZAGIXRt7e04ZnxWAH5J4ZpAlccnrGSZBTgqpPy1ACa0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600026841; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=xfPMayHNm783GOWFtl2CrD6xAn1YPu/97T94zZoINI8=; b=h3YYHQDhez33+iqZxVXhkRSSu8wUQnI9lwl4gEEJb2EMrz1aDl5PuITbl/fqG4ziiADcnJ3ey66+TCDVcD/OEN/+VYX1pTuD+sa+THbVlKFfcv9VsowSuTEsIWX3o7jawQAIbVtoqGWzHfLCwuo/zNiab5yy4SYKRju6CaX/XdM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1600026841343457.06078070786623; Sun, 13 Sep 2020 12:54:01 -0700 (PDT) Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-2-QSxyGGQVN4mWNfsA83lHgA-1; Sun, 13 Sep 2020 15:53:58 -0400 Received: by mail-wr1-f70.google.com with SMTP id x15so5861950wrm.7 for ; Sun, 13 Sep 2020 12:53:58 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (65.red-83-57-170.dynamicip.rima-tde.net. [83.57.170.65]) by smtp.gmail.com with ESMTPSA id g8sm15347100wmd.12.2020.09.13.12.53.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2020 12:53:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600026840; 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=xfPMayHNm783GOWFtl2CrD6xAn1YPu/97T94zZoINI8=; b=WnIgECR59ymuh1/qLnOucpoc6+415A0ZMzWmiH/eoz2Su8EFpSNqQyF+HggjDpvlbPALJH CYoK3sraQiVsf2MTDznU3Z4B+lmtNlLc/Y1pmAY4UMcQaRUR7YeSw0Tey6ONXyXzbdgdrP w0kHgtAqnhArJl2780acD8AHckJza1I= X-MC-Unique: QSxyGGQVN4mWNfsA83lHgA-1 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=xfPMayHNm783GOWFtl2CrD6xAn1YPu/97T94zZoINI8=; b=aXGW/QJA+r0NHmZFdrt9n39pBfI8gDmNjvoEYNcGSDYvEjuRMPSBF1T6yChT5YCEkB co1MlB+ftWe9CdEzfSj7d5ZHAY45OipwHMFekGhbfH4DpBmDE62a+ObXeLmoJ5XrEwQ9 tfrjaqokk7SNTcpILRVVKmgZH46xohaxC3fDfQIgW3w8ti4oP0f8ZxIdErsByOWamlCi XZcKNccllxLLxQ+sNsMzlTNKNGoae25o1u3nI1OouN63DcaHLaTlJQ6dL6V1enelLDMm unuTCVCZdf09lJGde1CaWWn/BAAjyC57U9MdbR0pjNMEBhCG0/r1JtuswMa4g0eODqrR EHaQ== X-Gm-Message-State: AOAM5301V08jIbDFBovETgN8+//rIzK0s2neQU0YX89vIHlzX485kFPY +MM4WQ0Lq4BpQR0bUoMCV6dvz77vxD4wzzOyxEU1l7f/PTv2K3IEa/IISOcRRj46dzTbX99rgmG 8OVuxO6eQMbkaOg== X-Received: by 2002:a5d:4a4a:: with SMTP id v10mr8439115wrs.72.1600026836895; Sun, 13 Sep 2020 12:53:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTYM92yCBaWNnRp/KGzkM4msI3lzvf7tGvxVTeXgkPMoVdDEi5F20yzfkGFgeubr0N6UdJhQ== X-Received: by 2002:a5d:4a4a:: with SMTP id v10mr8439098wrs.72.1600026836687; Sun, 13 Sep 2020 12:53:56 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Cc: Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v5 1/8] qapi: Restrict LostTickPolicy enum to machine code Date: Sun, 13 Sep 2020 21:53:41 +0200 Message-Id: <20200913195348.1064154-2-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200913195348.1064154-1-philmd@redhat.com> References: <20200913195348.1064154-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Acked-by: Markus Armbruster Acked-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- qapi/machine.json | 32 ++++++++++++++++++++++++++++++++ qapi/misc.json | 32 -------------------------------- include/hw/rtc/mc146818rtc.h | 2 +- hw/core/qdev-properties.c | 1 + hw/i386/kvm/i8254.c | 2 +- 5 files changed, 35 insertions(+), 34 deletions(-) diff --git a/qapi/machine.json b/qapi/machine.json index 0ac1880e4a4..b6396aa3fea 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -426,6 +426,38 @@ ## { 'command': 'query-target', 'returns': 'TargetInfo' } =20 +## +# @LostTickPolicy: +# +# Policy for handling lost ticks in timer devices. Ticks end up getting +# lost when, for example, the guest is paused. +# +# @discard: throw away the missed ticks and continue with future injection +# normally. The guest OS will see the timer jump ahead by a +# potentially quite significant amount all at once, as if the +# intervening chunk of time had simply not existed; needless to +# say, such a sudden jump can easily confuse a guest OS which is +# not specifically prepared to deal with it. Assuming the guest +# OS can deal correctly with the time jump, the time in the guest +# and in the host should now match. +# +# @delay: continue to deliver ticks at the normal rate. The guest OS will +# not notice anything is amiss, as from its point of view time will +# have continued to flow normally. The time in the guest should n= ow +# be behind the time in the host by exactly the amount of time dur= ing +# which ticks have been missed. +# +# @slew: deliver ticks at a higher rate to catch up with the missed ticks. +# The guest OS will not notice anything is amiss, as from its point +# of view time will have continued to flow normally. Once the timer +# has managed to catch up with all the missing ticks, the time in +# the guest and in the host should match. +# +# Since: 2.0 +## +{ 'enum': 'LostTickPolicy', + 'data': ['discard', 'delay', 'slew' ] } + ## # @NumaOptionsType: # diff --git a/qapi/misc.json b/qapi/misc.json index 8cf6ebe67cb..b21963a176d 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -8,38 +8,6 @@ =20 { 'include': 'common.json' } =20 -## -# @LostTickPolicy: -# -# Policy for handling lost ticks in timer devices. Ticks end up getting -# lost when, for example, the guest is paused. -# -# @discard: throw away the missed ticks and continue with future injection -# normally. The guest OS will see the timer jump ahead by a -# potentially quite significant amount all at once, as if the -# intervening chunk of time had simply not existed; needless to -# say, such a sudden jump can easily confuse a guest OS which is -# not specifically prepared to deal with it. Assuming the guest -# OS can deal correctly with the time jump, the time in the guest -# and in the host should now match. -# -# @delay: continue to deliver ticks at the normal rate. The guest OS will -# not notice anything is amiss, as from its point of view time will -# have continued to flow normally. The time in the guest should n= ow -# be behind the time in the host by exactly the amount of time dur= ing -# which ticks have been missed. -# -# @slew: deliver ticks at a higher rate to catch up with the missed ticks. -# The guest OS will not notice anything is amiss, as from its point -# of view time will have continued to flow normally. Once the timer -# has managed to catch up with all the missing ticks, the time in -# the guest and in the host should match. -# -# Since: 2.0 -## -{ 'enum': 'LostTickPolicy', - 'data': ['discard', 'delay', 'slew' ] } - ## # @add_client: # diff --git a/include/hw/rtc/mc146818rtc.h b/include/hw/rtc/mc146818rtc.h index e58e006d0d0..eb69182ca33 100644 --- a/include/hw/rtc/mc146818rtc.h +++ b/include/hw/rtc/mc146818rtc.h @@ -9,7 +9,7 @@ #ifndef HW_RTC_MC146818RTC_H #define HW_RTC_MC146818RTC_H =20 -#include "qapi/qapi-types-misc.h" +#include "qapi/qapi-types-machine.h" #include "qemu/queue.h" #include "qemu/timer.h" #include "hw/isa/isa.h" diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 098298c78e6..343c824da04 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -4,6 +4,7 @@ #include "qapi/error.h" #include "hw/pci/pci.h" #include "qapi/qapi-types-block.h" +#include "qapi/qapi-types-machine.h" #include "qapi/qapi-types-misc.h" #include "qapi/qmp/qerror.h" #include "qemu/ctype.h" diff --git a/hw/i386/kvm/i8254.c b/hw/i386/kvm/i8254.c index e18fd337fab..40d84734e7f 100644 --- a/hw/i386/kvm/i8254.c +++ b/hw/i386/kvm/i8254.c @@ -25,7 +25,7 @@ =20 #include "qemu/osdep.h" #include -#include "qapi/qapi-types-misc.h" +#include "qapi/qapi-types-machine.h" #include "qapi/error.h" #include "qemu/module.h" #include "qemu/timer.h" --=20 2.26.2 From nobody Sat May 4 19:08:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600026845; cv=none; d=zohomail.com; s=zohoarc; b=Px/++BYmYOCghLLotiVcYnTE0suaTsjRNOyVM8T6hUYwWiiM3W4jTV340XH9LjBbaS3130YpNLwrMwYUuI3eHvVRkmk8WTAPE2EvqQfORWKD/gg9O66Y3wZ+FlEae42p4Q6Pv8KTqwajUum9lQjDGrSuqj4+x4x6RKlmzT3AZMI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600026845; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=DOKnWX2iitjDbaYV++fqOhPdaz2ukNmCIoazESmp5Ss=; b=S9/HytBfbIz2N7dq51hhHBhGh3/R/66grpxZ9LNugTaZToHSAVqkSiEeffJPU02zQRVmUuzoyTsyl7ptZbLO5iSvtGyLtJs/z7d4zLfGovNCSH7ZzKJR+pwpqHk3jBuMS8M6uCZc4pF+8Xd5lqZpwMhQyASKrrwk2uVm+k9sKAo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1600026845554985.6422717185005; Sun, 13 Sep 2020 12:54:05 -0700 (PDT) Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-31-HFnTe6AUMGG2XWKR45KlZQ-1; Sun, 13 Sep 2020 15:54:02 -0400 Received: by mail-wr1-f71.google.com with SMTP id f18so5908799wrv.19 for ; Sun, 13 Sep 2020 12:54:02 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (65.red-83-57-170.dynamicip.rima-tde.net. [83.57.170.65]) by smtp.gmail.com with ESMTPSA id 185sm16936093wma.18.2020.09.13.12.54.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2020 12:54:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600026844; 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=DOKnWX2iitjDbaYV++fqOhPdaz2ukNmCIoazESmp5Ss=; b=PlWt5VFzMTImHkOnCsukQIajrmwAKFWaWFA+wif7vqH2pndMI9x/QHkCX5MJIIDDn5SIlv eA84u9WsT/8uJM+VqqqCiIrQVYqJdRm4uqFm39k8y23BVNMt8RyDzN7a+pBn7jscc79X1C pHklZ4Wf6OO6lTGTttNdtZUpxLIYmWs= X-MC-Unique: HFnTe6AUMGG2XWKR45KlZQ-1 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=DOKnWX2iitjDbaYV++fqOhPdaz2ukNmCIoazESmp5Ss=; b=mzhrxdwXGWDhMU4hn7zysQsSFciNfsbs8c3Y+wi5qnWENjkC6fyvtLIohIlaQ+6HFo EnPZ5syIfrqDiahlV/N7u5+jYNmSJ0Srver57M8hws1SARKyDU5+fSEQ1clFfS9VqG7i j7bc2plab0QWV/PSkOhm7rOu29aAsn4NzN8FxbBEl+xCAh8ACYLGmsDWO7P58v8CUG7m K12fTIGtlqwOZcS+CFNsy5Eo9uZXFj6jQEjwSGGcbdFPs6u2Oz+MzkLbFeH9BV47Zmjz P0DPjCchdCoeejqhnAVdGk3yN41B6Xdo7Q8cYBko3ixIMiM31pTDo1brlV8F4QOIzIRo EDdA== X-Gm-Message-State: AOAM533PzTV3hriIQkVUuod4UdRrtmeIIc2v1/5whZiejX/PnT3w2tiL ZGrvtzr4zH90ESQXjbKfuISUOZ5nGQaoKBCn5N9ZriV8NSTdaLksuMCTjFzaBvvAaAZmoGz5egY hvvSoNIcDchIRSg== X-Received: by 2002:adf:e84a:: with SMTP id d10mr13117168wrn.66.1600026841617; Sun, 13 Sep 2020 12:54:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwydVMNI8O82MHC3Yh09m15o42bkAztsq9W/dTzfnny7bIiJEB+QUX7yZgSJskz2nx1S48kcQ== X-Received: by 2002:adf:e84a:: with SMTP id d10mr13117161wrn.66.1600026841452; Sun, 13 Sep 2020 12:54:01 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Cc: Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v5 2/8] qapi: Correct balloon documentation Date: Sun, 13 Sep 2020 21:53:42 +0200 Message-Id: <20200913195348.1064154-3-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200913195348.1064154-1-philmd@redhat.com> References: <20200913195348.1064154-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) The documentation incorrectly uses the "size of the balloon" description when it should be "logical size of the VM". Fix it. The relation between both values is: logical_vm_size =3D vm_ram_size - balloon_size Reported-by: David Hildenbrand Suggested-by: David Hildenbrand Reviewed-by: David Hildenbrand Acked-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Markus Armbruster --- qapi/misc.json | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/qapi/misc.json b/qapi/misc.json index b21963a176d..a667fdf03e5 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -192,7 +192,8 @@ # # Information about the guest balloon device. # -# @actual: the number of bytes the balloon currently contains +# @actual: the logical size of the VM in bytes +# Formula used: logical_vm_size =3D vm_ram_size - balloon_size # # Since: 0.14.0 # @@ -228,7 +229,8 @@ # Emitted when the guest changes the actual BALLOON level. This value is # equivalent to the @actual field return by the 'query-balloon' command # -# @actual: actual level of the guest memory balloon in bytes +# @actual: the logical size of the VM in bytes +# Formula used: logical_vm_size =3D vm_ram_size - balloon_size # # Note: this event is rate-limited. # @@ -759,7 +761,10 @@ # # Request the balloon driver to change its balloon size. # -# @value: the target size of the balloon in bytes +# @value: the target logical size of the VM in bytes +# We can deduce the size of the balloon using this formula: +# logical_vm_size =3D vm_ram_size - balloon_size +# From it we have: balloon_size =3D vm_ram_size - @value # # Returns: - Nothing on success # - If the balloon driver is enabled but not functional because t= he KVM @@ -777,6 +782,8 @@ # -> { "execute": "balloon", "arguments": { "value": 536870912 } } # <- { "return": {} } # +# With a 2.5GiB guest this command inflated the balloon to 3GiB. +# ## { 'command': 'balloon', 'data': {'value': 'int'} } =20 --=20 2.26.2 From nobody Sat May 4 19:08:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=philmd@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600026850; cv=none; d=zohomail.com; s=zohoarc; b=jp+iDD8mN7S8zf7CZOR/xQPadpW1bndv69OoLDQv0fcGHO2AJMGx/UvHxaqgzhUF4a3xwSiS+YBAGzT9j1eQWPvOIFq+YJ4PbLdmzZY+P97xj5Wj4JLNhGz0UhaClBd4ru+GyVVAflM+j+HzHR/cp2Wbl99KaaIogsiAOpIIMV8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600026850; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=s58NT/XtbMue0yIDndW+PTp7hI5RkZ8pFFsif9e2Zk0=; b=S7ckMZqixensJrSbL16lRKaaBGNI9nqKbMgV3Eb69DS//Vzkrxfi+eOkFfnIbbNOwdqjbaEv7NfUPJS4cppZBMPEHAWjxIIGH+lAaSbMbbbYAXjk52tP4WM60SHGHQaMLjH61SML9nJ3DPj2UjkrCk13c9dfyS2wD2VT+r88KUA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1600026850849671.7058721759158; Sun, 13 Sep 2020 12:54:10 -0700 (PDT) Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-442-qa5xS9sHO7SB8SOiNoiy3g-1; Sun, 13 Sep 2020 15:54:07 -0400 Received: by mail-wr1-f71.google.com with SMTP id j7so5933294wro.14 for ; Sun, 13 Sep 2020 12:54:07 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (65.red-83-57-170.dynamicip.rima-tde.net. [83.57.170.65]) by smtp.gmail.com with ESMTPSA id k12sm16550155wrn.39.2020.09.13.12.54.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2020 12:54:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600026849; 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=s58NT/XtbMue0yIDndW+PTp7hI5RkZ8pFFsif9e2Zk0=; b=cPEqLVZCMDLcojm3WxUdk70QTs2su/j+9nbyGQrHscDAENoxTpsEbEa3BI/H1V3RPmasWp xQe7QaqXY8pxtBRRi3jXjNzDMLaH/2XhChrFVg3ZN59dM7ORUOvV2KVG2yuVpti28cb/3r hJxPjEo1ONCsBgXVIEm5mU3LhUndR6I= X-MC-Unique: qa5xS9sHO7SB8SOiNoiy3g-1 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=s58NT/XtbMue0yIDndW+PTp7hI5RkZ8pFFsif9e2Zk0=; b=EP7MkJ+5v5fTEIcrw6u7HrXkw+y6FjpDy971WDfcPF4Yi0NoFIVHQEjjPIv6ChT0Mo gDFzu1lyA0vE+j/2iIC8wjNkPXveN09z1WdhoxUHOPyN59xdm/byxqznhAJ+uaJd5bwL TDblgDS0Hhuf7NAZf5xm+PXb/NJP/cs/CTSZAcxuFExwZu+P0TjpwceVCrVhjAiXYMw6 8BhspfTRlcNNwlAGEAR/Tm+vTp1Mrrw941B6H6Ablkc2UahN3WdHL3SM4phR6WHINTUs KiRC+bQ93eDqn9v8ZbHHMs/nI2NcXrvdwYQIV+guJ1rk5WIVE5yDnWdrokrDq/+WHurK QhzA== X-Gm-Message-State: AOAM531XK+NfB44PPZU8SFlpFRewNbhfs2Nm09Z9vibRuiVd+d/HlmC4 6uPzfPdfKddXZuOtf7NRfkQdCq69WLXV7VUTdBWB7RQi5boV/Lyk+ikNFUmedd1xuF6oY1nqbvK 1jWA8/aO5/1BEYw== X-Received: by 2002:a1c:4e16:: with SMTP id g22mr7630616wmh.99.1600026846319; Sun, 13 Sep 2020 12:54:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkDZQibCM1pVGh+/rjdZ6XfOcEoc1re/ZCBWMGi7s9Ba7b++onL3XrCu5uDBv9Mg/FKXVYSQ== X-Received: by 2002:a1c:4e16:: with SMTP id g22mr7630599wmh.99.1600026846017; Sun, 13 Sep 2020 12:54:06 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Cc: Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v5 3/8] qapi: Restrict balloon-related commands to machine code Date: Sun, 13 Sep 2020 21:53:43 +0200 Message-Id: <20200913195348.1064154-4-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200913195348.1064154-1-philmd@redhat.com> References: <20200913195348.1064154-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Only qemu-system-FOO and qemu-storage-daemon provide QMP monitors, therefore such declarations and definitions are irrelevant for user-mode emulation. Restricting the balloon-related commands to machine.json allows pulling less declarations/definitions to user-mode. Reviewed-by: David Hildenbrand Acked-by: Markus Armbruster Acked-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- qapi/machine.json | 90 ++++++++++++++++++++++++++++++++++++++ qapi/misc.json | 90 -------------------------------------- include/sysemu/balloon.h | 2 +- hw/virtio/virtio-balloon.c | 2 +- monitor/hmp-cmds.c | 1 + softmmu/balloon.c | 2 +- 6 files changed, 94 insertions(+), 93 deletions(-) diff --git a/qapi/machine.json b/qapi/machine.json index b6396aa3fea..04f0a907c75 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -969,3 +969,93 @@ 'data': 'NumaOptions', 'allow-preconfig': true } + +## +# @balloon: +# +# Request the balloon driver to change its balloon size. +# +# @value: the target logical size of the VM in bytes +# We can deduce the size of the balloon using this formula: +# logical_vm_size =3D vm_ram_size - balloon_size +# From it we have: balloon_size =3D vm_ram_size - @value +# +# Returns: - Nothing on success +# - If the balloon driver is enabled but not functional because t= he KVM +# kernel module cannot support it, KvmMissingCap +# - If no balloon device is present, DeviceNotActive +# +# Notes: This command just issues a request to the guest. When it returns, +# the balloon size may not have changed. A guest can change the ba= lloon +# size independent of this command. +# +# Since: 0.14.0 +# +# Example: +# +# -> { "execute": "balloon", "arguments": { "value": 536870912 } } +# <- { "return": {} } +# +# With a 2.5GiB guest this command inflated the ballon to 3GiB. +# +## +{ 'command': 'balloon', 'data': {'value': 'int'} } + +## +# @BalloonInfo: +# +# Information about the guest balloon device. +# +# @actual: the logical size of the VM in bytes +# Formula used: logical_vm_size =3D vm_ram_size - balloon_size +# +# Since: 0.14.0 +# +## +{ 'struct': 'BalloonInfo', 'data': {'actual': 'int' } } + +## +# @query-balloon: +# +# Return information about the balloon device. +# +# Returns: - @BalloonInfo on success +# - If the balloon driver is enabled but not functional because t= he KVM +# kernel module cannot support it, KvmMissingCap +# - If no balloon device is present, DeviceNotActive +# +# Since: 0.14.0 +# +# Example: +# +# -> { "execute": "query-balloon" } +# <- { "return": { +# "actual": 1073741824, +# } +# } +# +## +{ 'command': 'query-balloon', 'returns': 'BalloonInfo' } + +## +# @BALLOON_CHANGE: +# +# Emitted when the guest changes the actual BALLOON level. This value is +# equivalent to the @actual field return by the 'query-balloon' command +# +# @actual: the logical size of the VM in bytes +# Formula used: logical_vm_size =3D vm_ram_size - balloon_size +# +# Note: this event is rate-limited. +# +# Since: 1.2 +# +# Example: +# +# <- { "event": "BALLOON_CHANGE", +# "data": { "actual": 944766976 }, +# "timestamp": { "seconds": 1267020223, "microseconds": 435656 } } +# +## +{ 'event': 'BALLOON_CHANGE', + 'data': { 'actual': 'int' } } diff --git a/qapi/misc.json b/qapi/misc.json index a667fdf03e5..7a14c50094d 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -187,65 +187,6 @@ { 'command': 'query-iothreads', 'returns': ['IOThreadInfo'], 'allow-preconfig': true } =20 -## -# @BalloonInfo: -# -# Information about the guest balloon device. -# -# @actual: the logical size of the VM in bytes -# Formula used: logical_vm_size =3D vm_ram_size - balloon_size -# -# Since: 0.14.0 -# -## -{ 'struct': 'BalloonInfo', 'data': {'actual': 'int' } } - -## -# @query-balloon: -# -# Return information about the balloon device. -# -# Returns: - @BalloonInfo on success -# - If the balloon driver is enabled but not functional because t= he KVM -# kernel module cannot support it, KvmMissingCap -# - If no balloon device is present, DeviceNotActive -# -# Since: 0.14.0 -# -# Example: -# -# -> { "execute": "query-balloon" } -# <- { "return": { -# "actual": 1073741824, -# } -# } -# -## -{ 'command': 'query-balloon', 'returns': 'BalloonInfo' } - -## -# @BALLOON_CHANGE: -# -# Emitted when the guest changes the actual BALLOON level. This value is -# equivalent to the @actual field return by the 'query-balloon' command -# -# @actual: the logical size of the VM in bytes -# Formula used: logical_vm_size =3D vm_ram_size - balloon_size -# -# Note: this event is rate-limited. -# -# Since: 1.2 -# -# Example: -# -# <- { "event": "BALLOON_CHANGE", -# "data": { "actual": 944766976 }, -# "timestamp": { "seconds": 1267020223, "microseconds": 435656 } } -# -## -{ 'event': 'BALLOON_CHANGE', - 'data': { 'actual': 'int' } } - ## # @PciMemoryRange: # @@ -756,37 +697,6 @@ ## { 'command': 'inject-nmi' } =20 -## -# @balloon: -# -# Request the balloon driver to change its balloon size. -# -# @value: the target logical size of the VM in bytes -# We can deduce the size of the balloon using this formula: -# logical_vm_size =3D vm_ram_size - balloon_size -# From it we have: balloon_size =3D vm_ram_size - @value -# -# Returns: - Nothing on success -# - If the balloon driver is enabled but not functional because t= he KVM -# kernel module cannot support it, KvmMissingCap -# - If no balloon device is present, DeviceNotActive -# -# Notes: This command just issues a request to the guest. When it returns, -# the balloon size may not have changed. A guest can change the ba= lloon -# size independent of this command. -# -# Since: 0.14.0 -# -# Example: -# -# -> { "execute": "balloon", "arguments": { "value": 536870912 } } -# <- { "return": {} } -# -# With a 2.5GiB guest this command inflated the balloon to 3GiB. -# -## -{ 'command': 'balloon', 'data': {'value': 'int'} } - ## # @human-monitor-command: # diff --git a/include/sysemu/balloon.h b/include/sysemu/balloon.h index 20a2defe3aa..867687b73ac 100644 --- a/include/sysemu/balloon.h +++ b/include/sysemu/balloon.h @@ -15,7 +15,7 @@ #define QEMU_BALLOON_H =20 #include "exec/cpu-common.h" -#include "qapi/qapi-types-misc.h" +#include "qapi/qapi-types-machine.h" =20 typedef void (QEMUBalloonEvent)(void *opaque, ram_addr_t target); typedef void (QEMUBalloonStatus)(void *opaque, BalloonInfo *info); diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index 22cb5df717b..b22b5beda3c 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -24,7 +24,7 @@ #include "hw/virtio/virtio-balloon.h" #include "exec/address-spaces.h" #include "qapi/error.h" -#include "qapi/qapi-events-misc.h" +#include "qapi/qapi-events-machine.h" #include "qapi/visitor.h" #include "trace.h" #include "qemu/error-report.h" diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index 7711726fd22..de01ba20845 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -32,6 +32,7 @@ #include "qapi/qapi-commands-block.h" #include "qapi/qapi-commands-char.h" #include "qapi/qapi-commands-control.h" +#include "qapi/qapi-commands-machine.h" #include "qapi/qapi-commands-migration.h" #include "qapi/qapi-commands-misc.h" #include "qapi/qapi-commands-net.h" diff --git a/softmmu/balloon.c b/softmmu/balloon.c index 23452295cd9..e0e8969a4b9 100644 --- a/softmmu/balloon.c +++ b/softmmu/balloon.c @@ -29,7 +29,7 @@ #include "sysemu/kvm.h" #include "sysemu/balloon.h" #include "qapi/error.h" -#include "qapi/qapi-commands-misc.h" +#include "qapi/qapi-commands-machine.h" #include "qapi/qmp/qerror.h" #include "trace.h" =20 --=20 2.26.2 From nobody Sat May 4 19:08:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600026855; cv=none; d=zohomail.com; s=zohoarc; b=VJ5KXFKjeUPtZSLK4QpPME7hJAOW6PQ4u3zUxaR+ZdH+gs52amEMHII/ExggFzFDZQJhQYRsQcBywe64TUDVy8dxtCCfgr2NtTCU4EDtUSvW3hDQu5Lp6YtQ3cmXP/8jTH7NzCG8T9wMg0IFtUL5TVZa23nXuuT+aF/6YyEeSdc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600026855; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=fQxGCFGFZIPrIS0+25PGhLER6VDhh3qQR1cx3IEfDOs=; b=TSNl7HgUe0r7vJ+pZ1Yi0qBDdj/GMvJQx1LITcRNxsDIlSlHp7AkveH0KK0YJ2aJlTRkTbhQmsjdW1pmTGGmh0oTn3aCL8eQUhEYO9rsk8RJBcEdyLTX1o5jWy0P64DqRzRnVRVHnp8NyCzrhU4WXyUlOAC7qpYRlYcRWOgAZ0s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1600026855062797.4916197298471; Sun, 13 Sep 2020 12:54:15 -0700 (PDT) Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-268-0Kg8BrY1MImN2xYaqBxKaQ-1; Sun, 13 Sep 2020 15:54:12 -0400 Received: by mail-wm1-f71.google.com with SMTP id s24so2739068wmh.1 for ; Sun, 13 Sep 2020 12:54:12 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (65.red-83-57-170.dynamicip.rima-tde.net. [83.57.170.65]) by smtp.gmail.com with ESMTPSA id g12sm16949914wro.89.2020.09.13.12.54.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2020 12:54:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600026854; 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=fQxGCFGFZIPrIS0+25PGhLER6VDhh3qQR1cx3IEfDOs=; b=ZAHt1DSrEvkAhO/wic2ZVU8js6CyrSpuDJoSaa3ox8N/OEcOZToUj9VM/ytvx/ysofZk8x j5UVNDVryhrkYsye6eMTozTCvbHzP30JkcsjYu3hhIn5+J2rlTA2A+i0OVRVJWRy/5BTwL 22Lf3/QcCrBzEoKh0XkBnEf5ekAYpm0= X-MC-Unique: 0Kg8BrY1MImN2xYaqBxKaQ-1 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=fQxGCFGFZIPrIS0+25PGhLER6VDhh3qQR1cx3IEfDOs=; b=DoWQOKrJkXztodwRNTvVfdTvdE2aqd4E8jzQ1OPSTl4f0S4kuaRI6qMLnhIrMlsU2d E3zNasDA1Fl6Bw8z0roIROa3KaOSD5cGgFMce4s0GwVGQZP8irdD/fHfjJjaet8NfY2i 4Lhj1ZK2//TGQ91nFZj/ZyRaquyHr0cJyOFAUIfaitcvY8kwaC9gLIe7zzwIHzxaEFLp xZU2PnyfIDvABGKgYdr1mfWTgkBtLks7rN8hnYXoAPP7WVAfV83ktgsTFYbnInFqw6Cu joVWyHEoMDr3+oe0vqV0Of3JyecR4tTvfOwQ8/fbXcW2RsVh2Wh8FEUiZdUCV2ZxExq3 hxdQ== X-Gm-Message-State: AOAM532DJsVk2z2IMNkWh4fDZ/xMdkGNGejZ7vpK0NiKbGMnnj6HydTw kJ3b/bLEWyJAKEQ2b6/Si9T+jLi3dK9evvA6CXZUd6YRv2NsYDhdvt73/HqXwDkXw8hS0vTRSg8 xhhDXhBZPSeh0vw== X-Received: by 2002:a7b:cb4e:: with SMTP id v14mr11600948wmj.5.1600026850768; Sun, 13 Sep 2020 12:54:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwiXS9OvI/5tKHzLKENq3JUzOxjJWcGitz9hO833vmqPKAKNMWoQTQs70rRZgMaOSKxa+NGaQ== X-Received: by 2002:a7b:cb4e:: with SMTP id v14mr11600940wmj.5.1600026850609; Sun, 13 Sep 2020 12:54:10 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Cc: Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v5 4/8] qapi: Restrict query-vm-generation-id command to machine code Date: Sun, 13 Sep 2020 21:53:44 +0200 Message-Id: <20200913195348.1064154-5-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200913195348.1064154-1-philmd@redhat.com> References: <20200913195348.1064154-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0.003 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Only qemu-system-FOO and qemu-storage-daemon provide QMP monitors, therefore such declarations and definitions are irrelevant for user-mode emulation. Restricting the query-vm-generation-id command to machine.json allows pulling less declarations/definitions to user-mode. Acked-by: Igor Mammedov Acked-by: Markus Armbruster Acked-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- qapi/machine.json | 20 ++++++++++++++++++++ qapi/misc.json | 21 --------------------- hw/acpi/vmgenid.c | 2 +- stubs/vmgenid.c | 2 +- 4 files changed, 22 insertions(+), 23 deletions(-) diff --git a/qapi/machine.json b/qapi/machine.json index 04f0a907c75..dd2815fa670 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -426,6 +426,26 @@ ## { 'command': 'query-target', 'returns': 'TargetInfo' } =20 +## +# @GuidInfo: +# +# GUID information. +# +# @guid: the globally unique identifier +# +# Since: 2.9 +## +{ 'struct': 'GuidInfo', 'data': {'guid': 'str'} } + +## +# @query-vm-generation-id: +# +# Show Virtual Machine Generation ID +# +# Since: 2.9 +## +{ 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' } + ## # @LostTickPolicy: # diff --git a/qapi/misc.json b/qapi/misc.json index 7a14c50094d..edcc91e1060 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -1479,24 +1479,3 @@ # ## { 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} } - -## -# @GuidInfo: -# -# GUID information. -# -# @guid: the globally unique identifier -# -# Since: 2.9 -## -{ 'struct': 'GuidInfo', 'data': {'guid': 'str'} } - -## -# @query-vm-generation-id: -# -# Show Virtual Machine Generation ID -# -# Since: 2.9 -## -{ 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' } - diff --git a/hw/acpi/vmgenid.c b/hw/acpi/vmgenid.c index 53db6af75d0..2c8152d5088 100644 --- a/hw/acpi/vmgenid.c +++ b/hw/acpi/vmgenid.c @@ -12,7 +12,7 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" -#include "qapi/qapi-commands-misc.h" +#include "qapi/qapi-commands-machine.h" #include "qemu/module.h" #include "hw/acpi/acpi.h" #include "hw/acpi/aml-build.h" diff --git a/stubs/vmgenid.c b/stubs/vmgenid.c index 568e42b0648..bfad656c6cc 100644 --- a/stubs/vmgenid.c +++ b/stubs/vmgenid.c @@ -1,6 +1,6 @@ #include "qemu/osdep.h" #include "qapi/error.h" -#include "qapi/qapi-commands-misc.h" +#include "qapi/qapi-commands-machine.h" #include "qapi/qmp/qerror.h" =20 GuidInfo *qmp_query_vm_generation_id(Error **errp) --=20 2.26.2 From nobody Sat May 4 19:08:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600026859; cv=none; d=zohomail.com; s=zohoarc; b=g3NxAr8Y7ywfsvzYIqXS9ikvdedHupMRLf0GcaqJPrepbZVvdcPPqwJLFmL6PSHHE58SQCNop2/BSaPYvpXtwMgKS44OCZivvjZuwPNU5PXcBUWmjHGdyJODN2MPiF7ZFs/bjmUzrsWNRNGB9znwuTFWcshTj7oZRpVAwCvscXE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600026859; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=NqVl6gN7jdmxdMWUHNKtIYsmgxfGAIKur+nDAT3Se9E=; b=T4+ca4ImBheSt2uNqSVSo3Ezp7jsj46ROPIIpGEHfWnI8pJFm+OtuDX3r4EYXL8H+wP4rk4I+DWTEBsxB85EB6rPIgowGpgS/eaUW9iHBy5WOH/BFq8w8JAR9XUB+N7tACNeX48+TJUTG0MKMtsO5222i3Vu8IlSqZPI3TBcCFw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1600026859454479.30603307026706; Sun, 13 Sep 2020 12:54:19 -0700 (PDT) Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-516-PIrsy2kMNwihtssv8438wA-1; Sun, 13 Sep 2020 15:54:16 -0400 Received: by mail-wr1-f70.google.com with SMTP id w7so5940428wrp.2 for ; Sun, 13 Sep 2020 12:54:16 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (65.red-83-57-170.dynamicip.rima-tde.net. [83.57.170.65]) by smtp.gmail.com with ESMTPSA id y1sm15454264wma.36.2020.09.13.12.54.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2020 12:54:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600026858; 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=NqVl6gN7jdmxdMWUHNKtIYsmgxfGAIKur+nDAT3Se9E=; b=SCkokcLvrMYfBnAM3I//sCetM6i3pyYApSCxtS4fhjswVviQ9kWNS0WijBs1LQ6gTpR1ew KyCFewGDBGnu6U6nOoPDNn6PKQZy+zW8JCVwbCFTX5vUwIaHI31tep1vQPQrcFgu5Hiuu9 uS3tGAoSw7c6yeaQBVR3s0eFsUShMRk= X-MC-Unique: PIrsy2kMNwihtssv8438wA-1 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=NqVl6gN7jdmxdMWUHNKtIYsmgxfGAIKur+nDAT3Se9E=; b=YTPHfLFMWsBDnjHU/SbIVzdtTEX52bbPoq02jeu735zhK7gpCgUNo4j+t2o20B4n8W 3eLlTIwYVRSIKugnbbVAOk7C68m3gs4Bd/ZEmVhyo3TUWNrry4Denq1GYiVV9963Rhgr NXqKfpKkPS3Rde0/auLj+I4dzuwLljobY56gRlbT9b7jwqkFOk5xzEgnODjtqtusRmV/ 4j4tJ5Epgjc9rc5MRprlMnQP2JW94mXsNrvl6PVz2nwm5LjGQMpU3B6DjZp3OyRkCze2 6lATh5uQBBGCz0ADXJCKzuOaZZZ7Iur6lk40+eBiIY61YwtDyUU9or36eLxnEuKeHLyH UJVg== X-Gm-Message-State: AOAM530vg4KiSoRQTD+aUHF89xjwcXwIHruJy6h1koItF08uFtnxfwwj DUUjGc63rYEz5FSe16EWU00RyU3MFqSN38k5BNgXQPwB8jyzMmLyh8xKEXkTEAF2O5ploWx0+Ie 9n28CZjuWIM862Q== X-Received: by 2002:a5d:6311:: with SMTP id i17mr11689500wru.243.1600026855312; Sun, 13 Sep 2020 12:54:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyulBi4lh5itvxJwq/+H6e9XW2IkB7Y8Cv8cHB4Av2ZszWJJMtd9B8Iwa019XSvXoASyQUf0A== X-Received: by 2002:a5d:6311:: with SMTP id i17mr11689487wru.243.1600026855136; Sun, 13 Sep 2020 12:54:15 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Cc: Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v5 5/8] qapi: Restrict query-uuid command to machine code Date: Sun, 13 Sep 2020 21:53:45 +0200 Message-Id: <20200913195348.1064154-6-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200913195348.1064154-1-philmd@redhat.com> References: <20200913195348.1064154-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Only qemu-system-FOO and qemu-storage-daemon provide QMP monitors, therefore such declarations and definitions are irrelevant for user-mode emulation. Restricting the query-uuid command to machine.json allows pulling less declarations/definitions to user-mode. Acked-by: Markus Armbruster Acked-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- qapi/machine.json | 30 ++++++++++++++++++++++++++++++ qapi/misc.json | 30 ------------------------------ block/iscsi.c | 2 +- stubs/uuid.c | 2 +- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/qapi/machine.json b/qapi/machine.json index dd2815fa670..9b849be2aa6 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -426,6 +426,36 @@ ## { 'command': 'query-target', 'returns': 'TargetInfo' } =20 +## +# @UuidInfo: +# +# Guest UUID information (Universally Unique Identifier). +# +# @UUID: the UUID of the guest +# +# Since: 0.14.0 +# +# Notes: If no UUID was specified for the guest, a null UUID is returned. +## +{ 'struct': 'UuidInfo', 'data': {'UUID': 'str'} } + +## +# @query-uuid: +# +# Query the guest UUID information. +# +# Returns: The @UuidInfo for the guest +# +# Since: 0.14.0 +# +# Example: +# +# -> { "execute": "query-uuid" } +# <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } } +# +## +{ 'command': 'query-uuid', 'returns': 'UuidInfo', 'allow-preconfig': true } + ## # @GuidInfo: # diff --git a/qapi/misc.json b/qapi/misc.json index edcc91e1060..05db6295fe0 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -98,36 +98,6 @@ ## { 'command': 'query-kvm', 'returns': 'KvmInfo' } =20 -## -# @UuidInfo: -# -# Guest UUID information (Universally Unique Identifier). -# -# @UUID: the UUID of the guest -# -# Since: 0.14.0 -# -# Notes: If no UUID was specified for the guest, a null UUID is returned. -## -{ 'struct': 'UuidInfo', 'data': {'UUID': 'str'} } - -## -# @query-uuid: -# -# Query the guest UUID information. -# -# Returns: The @UuidInfo for the guest -# -# Since: 0.14.0 -# -# Example: -# -# -> { "execute": "query-uuid" } -# <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } } -# -## -{ 'command': 'query-uuid', 'returns': 'UuidInfo', 'allow-preconfig': true } - ## # @IOThreadInfo: # diff --git a/block/iscsi.c b/block/iscsi.c index bd2122a3a44..e30a7e3606b 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -42,7 +42,7 @@ #include "qemu/uuid.h" #include "sysemu/replay.h" #include "qapi/error.h" -#include "qapi/qapi-commands-misc.h" +#include "qapi/qapi-commands-machine.h" #include "qapi/qmp/qdict.h" #include "qapi/qmp/qstring.h" #include "crypto/secret.h" diff --git a/stubs/uuid.c b/stubs/uuid.c index 67f182fa3aa..e5112eb3f60 100644 --- a/stubs/uuid.c +++ b/stubs/uuid.c @@ -1,5 +1,5 @@ #include "qemu/osdep.h" -#include "qapi/qapi-commands-misc.h" +#include "qapi/qapi-commands-machine.h" #include "qemu/uuid.h" =20 UuidInfo *qmp_query_uuid(Error **errp) --=20 2.26.2 From nobody Sat May 4 19:08:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600026864; cv=none; d=zohomail.com; s=zohoarc; b=OdaUgedLU5v1QYULz+rNmGcdCk1XVyJuBg/Rug5kD1H7CGywVvqZnTRapUxhUSsTFrbmXjbL1lNTnPiva4ILpBGRKjKgiGQXUokXpdz1hixHxvji3tSbyzanHnRRiPn+JLcyf/OAFiszR3CjsEZqX4D8o+IfgQLnlB4GwSB6F/k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600026864; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=XKKM3MMvaieCjl80oR6LZSA2au+FTTXY452d1zBdI20=; b=inE/XKKTX12FUucUG2zmLBjvvF+4tb0S57omc2ZjbhXDKjbHadzrcTz5GZplGeYeGAfYB2+C0IBTZc/VORrEUyXhcoybYLwCh3XIKEh4TE5amiDYI/N0tslo3YIt/DFbjWuijtgMWnG0R2MqTPOlOemeF0ykh0iH9OKvethljJc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1600026864823659.9674499126205; Sun, 13 Sep 2020 12:54:24 -0700 (PDT) Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-235-meItGVeWOYWimPlT1G_aDA-1; Sun, 13 Sep 2020 15:54:21 -0400 Received: by mail-wr1-f72.google.com with SMTP id l9so5876276wrq.20 for ; Sun, 13 Sep 2020 12:54:21 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (65.red-83-57-170.dynamicip.rima-tde.net. [83.57.170.65]) by smtp.gmail.com with ESMTPSA id a13sm4468487wme.26.2020.09.13.12.54.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2020 12:54:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600026863; 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=XKKM3MMvaieCjl80oR6LZSA2au+FTTXY452d1zBdI20=; b=FYtwXhCHu0ahL66PTPNYEU4YJLsxXSJV6IE0GjMYm2wvjl+u/gWSeFsgEm/bXGhOSeSiWh VWvG2Ij9va9ntqPtnPEGZ/wYPD3GgjL6QHcIhiuKnPJegG9mxIjQSb8GOnX2o+6ndcTA56 3Hb9MqY/8k5DnGNpC1INrqKUpAMn4cw= X-MC-Unique: meItGVeWOYWimPlT1G_aDA-1 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=XKKM3MMvaieCjl80oR6LZSA2au+FTTXY452d1zBdI20=; b=aRWUIevZSAHJZv6QCvjDTjVEaL59W9UNgF1mwiPh1Fv+QwTy2doJOVgEUiEY6XUJiN Ql0dBLyVcIDVXKQ2zXnGw+EK766PgLWeKlg91tqLi4G01iVIIv1IiDn6klM7ZJoUW+Up X6a0NhNvBZyPU24Jy01QYg8zilVr7d1+XxXIftrMb16a6TLb9VcsYbv5i+3gUKsjs7+l JHhjofY0NgEcm1Z4CUdP+TNrBvuVgOujyKsg5KV5ytdcaHg45sC2VKq6M0MIfYCmtBn4 OLXqj2WxNXjWm96btYyvFxa2jN77fE/P8qaVnT38hna5vyiIXKr+GN4jKE4uQRpLT+0j UQQQ== X-Gm-Message-State: AOAM530xA/92KF7WvKufJllZMIgQBjh+2WuG2SUoMVqoUPYM8TpOBxDL uX8eEm6CxADplnDpv5Yj9Kb2BlX4PPeEicQ38gUuvlb58yCKhh4d5Cj3O/hpcqJAeAod2BqO+iM UFPA4tQcWU0M/fg== X-Received: by 2002:a7b:cb82:: with SMTP id m2mr12305549wmi.56.1600026860290; Sun, 13 Sep 2020 12:54:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQGl3enJKL1jwV7fPHgkwQ/wW6+xwZz9qmQqXGQkYrQy91ZouKWh4GhrkFLM7gT3ccVUEsUw== X-Received: by 2002:a7b:cb82:: with SMTP id m2mr12305520wmi.56.1600026859692; Sun, 13 Sep 2020 12:54:19 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Cc: Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v5 6/8] qapi: Restrict device memory commands to machine code Date: Sun, 13 Sep 2020 21:53:46 +0200 Message-Id: <20200913195348.1064154-7-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200913195348.1064154-1-philmd@redhat.com> References: <20200913195348.1064154-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0.003 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Only qemu-system-FOO and qemu-storage-daemon provide QMP monitors, therefore such declarations and definitions are irrelevant for user-mode emulation. Restricting the memory commands to machine.json allows pulling less declarations/definitions to user-mode. Acked-by: Igor Mammedov Acked-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Markus Armbruster --- qapi/machine.json | 216 +++++++++++++++++++++++++++++++ qapi/misc.json | 217 -------------------------------- include/hw/mem/memory-device.h | 2 +- include/hw/virtio/virtio-pmem.h | 2 +- hw/acpi/memory_hotplug.c | 1 + hw/virtio/virtio-mem-pci.c | 1 + 6 files changed, 220 insertions(+), 219 deletions(-) diff --git a/qapi/machine.json b/qapi/machine.json index 9b849be2aa6..39fbefb033b 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -1109,3 +1109,219 @@ ## { 'event': 'BALLOON_CHANGE', 'data': { 'actual': 'int' } } + +## +# @MemoryInfo: +# +# Actual memory information in bytes. +# +# @base-memory: size of "base" memory specified with command line +# option -m. +# +# @plugged-memory: size of memory that can be hot-unplugged. This field +# is omitted if target doesn't support memory hotplug +# (i.e. CONFIG_MEM_DEVICE not defined at build time). +# +# Since: 2.11.0 +## +{ 'struct': 'MemoryInfo', + 'data' : { 'base-memory': 'size', '*plugged-memory': 'size' } } + +## +# @query-memory-size-summary: +# +# Return the amount of initially allocated and present hotpluggable (if +# enabled) memory in bytes. +# +# Example: +# +# -> { "execute": "query-memory-size-summary" } +# <- { "return": { "base-memory": 4294967296, "plugged-memory": 0 } } +# +# Since: 2.11.0 +## +{ 'command': 'query-memory-size-summary', 'returns': 'MemoryInfo' } + +## +# @PCDIMMDeviceInfo: +# +# PCDIMMDevice state information +# +# @id: device's ID +# +# @addr: physical address, where device is mapped +# +# @size: size of memory that the device provides +# +# @slot: slot number at which device is plugged in +# +# @node: NUMA node number where device is plugged in +# +# @memdev: memory backend linked with device +# +# @hotplugged: true if device was hotplugged +# +# @hotpluggable: true if device if could be added/removed while machine is= running +# +# Since: 2.1 +## +{ 'struct': 'PCDIMMDeviceInfo', + 'data': { '*id': 'str', + 'addr': 'int', + 'size': 'int', + 'slot': 'int', + 'node': 'int', + 'memdev': 'str', + 'hotplugged': 'bool', + 'hotpluggable': 'bool' + } +} + +## +# @VirtioPMEMDeviceInfo: +# +# VirtioPMEM state information +# +# @id: device's ID +# +# @memaddr: physical address in memory, where device is mapped +# +# @size: size of memory that the device provides +# +# @memdev: memory backend linked with device +# +# Since: 4.1 +## +{ 'struct': 'VirtioPMEMDeviceInfo', + 'data': { '*id': 'str', + 'memaddr': 'size', + 'size': 'size', + 'memdev': 'str' + } +} + +## +# @VirtioMEMDeviceInfo: +# +# VirtioMEMDevice state information +# +# @id: device's ID +# +# @memaddr: physical address in memory, where device is mapped +# +# @requested-size: the user requested size of the device +# +# @size: the (current) size of memory that the device provides +# +# @max-size: the maximum size of memory that the device can provide +# +# @block-size: the block size of memory that the device provides +# +# @node: NUMA node number where device is assigned to +# +# @memdev: memory backend linked with the region +# +# Since: 5.1 +## +{ 'struct': 'VirtioMEMDeviceInfo', + 'data': { '*id': 'str', + 'memaddr': 'size', + 'requested-size': 'size', + 'size': 'size', + 'max-size': 'size', + 'block-size': 'size', + 'node': 'int', + 'memdev': 'str' + } +} + +## +# @MemoryDeviceInfo: +# +# Union containing information about a memory device +# +# nvdimm is included since 2.12. virtio-pmem is included since 4.1. +# virtio-mem is included since 5.1. +# +# Since: 2.1 +## +{ 'union': 'MemoryDeviceInfo', + 'data': { 'dimm': 'PCDIMMDeviceInfo', + 'nvdimm': 'PCDIMMDeviceInfo', + 'virtio-pmem': 'VirtioPMEMDeviceInfo', + 'virtio-mem': 'VirtioMEMDeviceInfo' + } +} + +## +# @query-memory-devices: +# +# Lists available memory devices and their state +# +# Since: 2.1 +# +# Example: +# +# -> { "execute": "query-memory-devices" } +# <- { "return": [ { "data": +# { "addr": 5368709120, +# "hotpluggable": true, +# "hotplugged": true, +# "id": "d1", +# "memdev": "/objects/memX", +# "node": 0, +# "size": 1073741824, +# "slot": 0}, +# "type": "dimm" +# } ] } +# +## +{ 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] } + +## +# @MEMORY_DEVICE_SIZE_CHANGE: +# +# Emitted when the size of a memory device changes. Only emitted for memory +# devices that can actually change the size (e.g., virtio-mem due to guest +# action). +# +# @id: device's ID +# @size: the new size of memory that the device provides +# +# Note: this event is rate-limited. +# +# Since: 5.1 +# +# Example: +# +# <- { "event": "MEMORY_DEVICE_SIZE_CHANGE", +# "data": { "id": "vm0", "size": 1073741824}, +# "timestamp": { "seconds": 1588168529, "microseconds": 201316 } } +# +## +{ 'event': 'MEMORY_DEVICE_SIZE_CHANGE', + 'data': { '*id': 'str', 'size': 'size' } } + + +## +# @MEM_UNPLUG_ERROR: +# +# Emitted when memory hot unplug error occurs. +# +# @device: device name +# +# @msg: Informative message +# +# Since: 2.4 +# +# Example: +# +# <- { "event": "MEM_UNPLUG_ERROR" +# "data": { "device": "dimm1", +# "msg": "acpi: device unplug for unsupported device" +# }, +# "timestamp": { "seconds": 1265044230, "microseconds": 450486 } } +# +## +{ 'event': 'MEM_UNPLUG_ERROR', + 'data': { 'device': 'str', 'msg': 'str' } } diff --git a/qapi/misc.json b/qapi/misc.json index 05db6295fe0..71d11365ead 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -826,39 +826,6 @@ ## { 'command': 'closefd', 'data': {'fdname': 'str'} } =20 -## -# @MemoryInfo: -# -# Actual memory information in bytes. -# -# @base-memory: size of "base" memory specified with command line -# option -m. -# -# @plugged-memory: size of memory that can be hot-unplugged. This field -# is omitted if target doesn't support memory hotplug -# (i.e. CONFIG_MEM_DEVICE not defined at build time). -# -# Since: 2.11.0 -## -{ 'struct': 'MemoryInfo', - 'data' : { 'base-memory': 'size', '*plugged-memory': 'size' } } - -## -# @query-memory-size-summary: -# -# Return the amount of initially allocated and present hotpluggable (if -# enabled) memory in bytes. -# -# Example: -# -# -> { "execute": "query-memory-size-summary" } -# <- { "return": { "base-memory": 4294967296, "plugged-memory": 0 } } -# -# Since: 2.11.0 -## -{ 'command': 'query-memory-size-summary', 'returns': 'MemoryInfo' } - - ## # @AddfdInfo: # @@ -1154,190 +1121,6 @@ 'returns': ['CommandLineOptionInfo'], 'allow-preconfig': true } =20 -## -# @PCDIMMDeviceInfo: -# -# PCDIMMDevice state information -# -# @id: device's ID -# -# @addr: physical address, where device is mapped -# -# @size: size of memory that the device provides -# -# @slot: slot number at which device is plugged in -# -# @node: NUMA node number where device is plugged in -# -# @memdev: memory backend linked with device -# -# @hotplugged: true if device was hotplugged -# -# @hotpluggable: true if device if could be added/removed while machine is= running -# -# Since: 2.1 -## -{ 'struct': 'PCDIMMDeviceInfo', - 'data': { '*id': 'str', - 'addr': 'int', - 'size': 'int', - 'slot': 'int', - 'node': 'int', - 'memdev': 'str', - 'hotplugged': 'bool', - 'hotpluggable': 'bool' - } -} - -## -# @VirtioPMEMDeviceInfo: -# -# VirtioPMEM state information -# -# @id: device's ID -# -# @memaddr: physical address in memory, where device is mapped -# -# @size: size of memory that the device provides -# -# @memdev: memory backend linked with device -# -# Since: 4.1 -## -{ 'struct': 'VirtioPMEMDeviceInfo', - 'data': { '*id': 'str', - 'memaddr': 'size', - 'size': 'size', - 'memdev': 'str' - } -} - -## -# @VirtioMEMDeviceInfo: -# -# VirtioMEMDevice state information -# -# @id: device's ID -# -# @memaddr: physical address in memory, where device is mapped -# -# @requested-size: the user requested size of the device -# -# @size: the (current) size of memory that the device provides -# -# @max-size: the maximum size of memory that the device can provide -# -# @block-size: the block size of memory that the device provides -# -# @node: NUMA node number where device is assigned to -# -# @memdev: memory backend linked with the region -# -# Since: 5.1 -## -{ 'struct': 'VirtioMEMDeviceInfo', - 'data': { '*id': 'str', - 'memaddr': 'size', - 'requested-size': 'size', - 'size': 'size', - 'max-size': 'size', - 'block-size': 'size', - 'node': 'int', - 'memdev': 'str' - } -} - -## -# @MemoryDeviceInfo: -# -# Union containing information about a memory device -# -# nvdimm is included since 2.12. virtio-pmem is included since 4.1. -# virtio-mem is included since 5.1. -# -# Since: 2.1 -## -{ 'union': 'MemoryDeviceInfo', - 'data': { 'dimm': 'PCDIMMDeviceInfo', - 'nvdimm': 'PCDIMMDeviceInfo', - 'virtio-pmem': 'VirtioPMEMDeviceInfo', - 'virtio-mem': 'VirtioMEMDeviceInfo' - } -} - -## -# @query-memory-devices: -# -# Lists available memory devices and their state -# -# Since: 2.1 -# -# Example: -# -# -> { "execute": "query-memory-devices" } -# <- { "return": [ { "data": -# { "addr": 5368709120, -# "hotpluggable": true, -# "hotplugged": true, -# "id": "d1", -# "memdev": "/objects/memX", -# "node": 0, -# "size": 1073741824, -# "slot": 0}, -# "type": "dimm" -# } ] } -# -## -{ 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] } - -## -# @MEMORY_DEVICE_SIZE_CHANGE: -# -# Emitted when the size of a memory device changes. Only emitted for memory -# devices that can actually change the size (e.g., virtio-mem due to guest -# action). -# -# @id: device's ID -# @size: the new size of memory that the device provides -# -# Note: this event is rate-limited. -# -# Since: 5.1 -# -# Example: -# -# <- { "event": "MEMORY_DEVICE_SIZE_CHANGE", -# "data": { "id": "vm0", "size": 1073741824}, -# "timestamp": { "seconds": 1588168529, "microseconds": 201316 } } -# -## -{ 'event': 'MEMORY_DEVICE_SIZE_CHANGE', - 'data': { '*id': 'str', 'size': 'size' } } - - -## -# @MEM_UNPLUG_ERROR: -# -# Emitted when memory hot unplug error occurs. -# -# @device: device name -# -# @msg: Informative message -# -# Since: 2.4 -# -# Example: -# -# <- { "event": "MEM_UNPLUG_ERROR" -# "data": { "device": "dimm1", -# "msg": "acpi: device unplug for unsupported device" -# }, -# "timestamp": { "seconds": 1265044230, "microseconds": 450486 } } -# -## -{ 'event': 'MEM_UNPLUG_ERROR', - 'data': { 'device': 'str', 'msg': 'str' } } - ## # @ACPISlotType: # diff --git a/include/hw/mem/memory-device.h b/include/hw/mem/memory-device.h index cde52e83c9a..30d7e99f52c 100644 --- a/include/hw/mem/memory-device.h +++ b/include/hw/mem/memory-device.h @@ -14,7 +14,7 @@ #define MEMORY_DEVICE_H =20 #include "hw/qdev-core.h" -#include "qapi/qapi-types-misc.h" +#include "qapi/qapi-types-machine.h" #include "qom/object.h" =20 #define TYPE_MEMORY_DEVICE "memory-device" diff --git a/include/hw/virtio/virtio-pmem.h b/include/hw/virtio/virtio-pme= m.h index 56df9a03cea..826ddd3d564 100644 --- a/include/hw/virtio/virtio-pmem.h +++ b/include/hw/virtio/virtio-pmem.h @@ -15,7 +15,7 @@ #define HW_VIRTIO_PMEM_H =20 #include "hw/virtio/virtio.h" -#include "qapi/qapi-types-misc.h" +#include "qapi/qapi-types-machine.h" #include "qom/object.h" =20 #define TYPE_VIRTIO_PMEM "virtio-pmem" diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c index 8d2e82240ff..dfe57af4292 100644 --- a/hw/acpi/memory_hotplug.c +++ b/hw/acpi/memory_hotplug.c @@ -7,6 +7,7 @@ #include "migration/vmstate.h" #include "trace.h" #include "qapi/error.h" +#include "qapi/qapi-events-machine.h" #include "qapi/qapi-events-misc.h" =20 #define MEMORY_SLOTS_NUMBER "MDNR" diff --git a/hw/virtio/virtio-mem-pci.c b/hw/virtio/virtio-mem-pci.c index 590cec041b4..913f4a33260 100644 --- a/hw/virtio/virtio-mem-pci.c +++ b/hw/virtio/virtio-mem-pci.c @@ -14,6 +14,7 @@ #include "virtio-mem-pci.h" #include "hw/mem/memory-device.h" #include "qapi/error.h" +#include "qapi/qapi-events-machine.h" #include "qapi/qapi-events-misc.h" =20 static void virtio_mem_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp) --=20 2.26.2 From nobody Sat May 4 19:08:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600026869; cv=none; d=zohomail.com; s=zohoarc; b=FfRaZn5KQM8aVU26EuqPdi1kdS3DjA3q/31MeT1BMIdwwuDcBgvcyrJCGGR4D6uqPMZyxxorz8rYAHqc47nqVOWDDDmNqxGUsPiOp2WWfnSbpJsOraSXh4+ptCfxkmOF2qnjCPakxXFb8POZX4BwYqIjavAlr5ZSX1VDR92Mq8E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600026869; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=Vt3GauXB8RmWljCTkEJoTwgSexPXcV4Fej1DSmNDtX0=; b=XKmx/KjfdD8cAu8I7AlQYj5pVno8h8zEyMmr/N6TDCdJ55ar/WMTyl5zZPDfbZBajvnxjZcjFsS1EZZxxXeMwK0zB92l7W5J29WecvDzAj+kcWIyY9G8IYoejm3yYtWO1CViEZW4FxEIdkw9sfz7dvHigs75RW1dcsIhSms9gt0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 160002686937230.753188789203364; Sun, 13 Sep 2020 12:54:29 -0700 (PDT) Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-63-z5ytbzrtMx2ur6GUmUUpdA-1; Sun, 13 Sep 2020 15:54:26 -0400 Received: by mail-wr1-f69.google.com with SMTP id r15so5886641wrt.8 for ; Sun, 13 Sep 2020 12:54:26 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (65.red-83-57-170.dynamicip.rima-tde.net. [83.57.170.65]) by smtp.gmail.com with ESMTPSA id u17sm15296850wmm.4.2020.09.13.12.54.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2020 12:54:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600026868; 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=Vt3GauXB8RmWljCTkEJoTwgSexPXcV4Fej1DSmNDtX0=; b=Qd9QArZa92DR8aGspK/Mbjv4R8jNJpe+QO1Op8sbU7j3HKm29Fpqg64XFyOB/5tr2iTnDE 64N7TAcwbDxZUxcGQfKLCYp8iMIjpuD0hWYB/NXrgmM3dsxp/im7sdGl1FqCjxD17obEAt dcJzljLvN/0BcawxVJ7JssmEv5JzTzY= X-MC-Unique: z5ytbzrtMx2ur6GUmUUpdA-1 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=Vt3GauXB8RmWljCTkEJoTwgSexPXcV4Fej1DSmNDtX0=; b=Jz719buU5G7GDpDzsm9K0yu2NaEUTooGUVDGJvmyYi+NKHrupdn+sjjGmO/iNvY6l/ sqcBbqTqN0QBNGah7Z1pb3//RMMUr1bFxwBQTKOBc1W57iSEw+KjYfQi/lqSprXcp1/I 6H+qEQ1kMnARd74OrbOj+N4caDfIKEadOhkqq83aD509gvVCtRltSPJ0VoFUgIvIvt1h H+a0j4xU/DGFRBu0bcDWyLYWxDLHaIq4kFicyr5OmEOYfBcKRhMbtfD6kLniBcLwCXtD BKeakVAJFXmu4EbF0or2rTh/LK8/1nI4kMOuSwju0GIA4lYr1wji+AZc2MmWMGCAzWAk 7WKQ== X-Gm-Message-State: AOAM532bHzY4eAxfP8wTLC/uabjoOdIMa1N7JSNKk4oGxu0Rk/o1RRWH c1eEQDkWGY50kMhxrkhdhPiRsHNfNKcuNYGt3X6CX0BzkuBNFMq3PKVfkDekDwPyUkMjwGRGz7X nzKHJtRjMgaQ7jQ== X-Received: by 2002:adf:fd8c:: with SMTP id d12mr12271646wrr.283.1600026864860; Sun, 13 Sep 2020 12:54:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVQKatLHzghVNFDaG7rCEf6c2uTkkPUpdMJ5DIT6j7b/AT4eT0nC9ipxzLEBqgNnxup7AmCw== X-Received: by 2002:adf:fd8c:: with SMTP id d12mr12271624wrr.283.1600026864554; Sun, 13 Sep 2020 12:54:24 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Cc: Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v5 7/8] qapi: Extract ACPI commands to 'acpi.json' Date: Sun, 13 Sep 2020 21:53:47 +0200 Message-Id: <20200913195348.1064154-8-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200913195348.1064154-1-philmd@redhat.com> References: <20200913195348.1064154-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0.004 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Only qemu-system-FOO and qemu-storage-daemon provide QMP monitors, therefore such declarations and definitions are irrelevant for user-mode emulation. Extracting the ACPI commands to their own schema reduces the size of the qapi-misc* headers generated, and allows pulling less declarations/definitions to user-mode. Suggested-by: Markus Armbruster Acked-by: Igor Mammedov Acked-by: Markus Armbruster Acked-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- qapi/acpi.json | 141 +++++++++++++++++++++++++++ qapi/misc.json | 131 ------------------------- qapi/qapi-schema.json | 1 + include/hw/acpi/acpi_dev_interface.h | 2 +- hw/acpi/core.c | 2 +- hw/acpi/cpu.c | 2 +- hw/acpi/memory_hotplug.c | 2 +- monitor/qmp-cmds.c | 1 + MAINTAINERS | 1 + qapi/meson.build | 1 + 10 files changed, 149 insertions(+), 135 deletions(-) create mode 100644 qapi/acpi.json diff --git a/qapi/acpi.json b/qapi/acpi.json new file mode 100644 index 00000000000..51f0d55db73 --- /dev/null +++ b/qapi/acpi.json @@ -0,0 +1,141 @@ +# -*- Mode: Python -*- +# vim: filetype=3Dpython +# +# This work is licensed under the terms of the GNU GPL, version 2 or later. +# See the COPYING file in the top-level directory. +# SPDX-License-Identifier: GPL-2.0-or-later + +## +# =3D ACPI +## + +## +# @AcpiTableOptions: +# +# Specify an ACPI table on the command line to load. +# +# At most one of @file and @data can be specified. The list of files speci= fied +# by any one of them is loaded and concatenated in order. If both are omit= ted, +# @data is implied. +# +# Other fields / optargs can be used to override fields of the generic ACPI +# table header; refer to the ACPI specification 5.0, section 5.2.6 System +# Description Table Header. If a header field is not overridden, then the +# corresponding value from the concatenated blob is used (in case of @file= ), or +# it is filled in with a hard-coded value (in case of @data). +# +# String fields are copied into the matching ACPI member from lowest addre= ss +# upwards, and silently truncated / NUL-padded to length. +# +# @sig: table signature / identifier (4 bytes) +# +# @rev: table revision number (dependent on signature, 1 byte) +# +# @oem_id: OEM identifier (6 bytes) +# +# @oem_table_id: OEM table identifier (8 bytes) +# +# @oem_rev: OEM-supplied revision number (4 bytes) +# +# @asl_compiler_id: identifier of the utility that created the table +# (4 bytes) +# +# @asl_compiler_rev: revision number of the utility that created the +# table (4 bytes) +# +# @file: colon (:) separated list of pathnames to load and +# concatenate as table data. The resultant binary blob is expected = to +# have an ACPI table header. At least one file is required. This fi= eld +# excludes @data. +# +# @data: colon (:) separated list of pathnames to load and +# concatenate as table data. The resultant binary blob must not hav= e an +# ACPI table header. At least one file is required. This field excl= udes +# @file. +# +# Since: 1.5 +## +{ 'struct': 'AcpiTableOptions', + 'data': { + '*sig': 'str', + '*rev': 'uint8', + '*oem_id': 'str', + '*oem_table_id': 'str', + '*oem_rev': 'uint32', + '*asl_compiler_id': 'str', + '*asl_compiler_rev': 'uint32', + '*file': 'str', + '*data': 'str' }} + +## +# @ACPISlotType: +# +# @DIMM: memory slot +# @CPU: logical CPU slot (since 2.7) +## +{ 'enum': 'ACPISlotType', 'data': [ 'DIMM', 'CPU' ] } + +## +# @ACPIOSTInfo: +# +# OSPM Status Indication for a device +# For description of possible values of @source and @status fields +# see "_OST (OSPM Status Indication)" chapter of ACPI5.0 spec. +# +# @device: device ID associated with slot +# +# @slot: slot ID, unique per slot of a given @slot-type +# +# @slot-type: type of the slot +# +# @source: an integer containing the source event +# +# @status: an integer containing the status code +# +# Since: 2.1 +## +{ 'struct': 'ACPIOSTInfo', + 'data' : { '*device': 'str', + 'slot': 'str', + 'slot-type': 'ACPISlotType', + 'source': 'int', + 'status': 'int' } } + +## +# @query-acpi-ospm-status: +# +# Return a list of ACPIOSTInfo for devices that support status +# reporting via ACPI _OST method. +# +# Since: 2.1 +# +# Example: +# +# -> { "execute": "query-acpi-ospm-status" } +# <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "so= urce": 1, "status": 0}, +# { "slot": "1", "slot-type": "DIMM", "source": 0, "statu= s": 0}, +# { "slot": "2", "slot-type": "DIMM", "source": 0, "statu= s": 0}, +# { "slot": "3", "slot-type": "DIMM", "source": 0, "statu= s": 0} +# ]} +# +## +{ 'command': 'query-acpi-ospm-status', 'returns': ['ACPIOSTInfo'] } + +## +# @ACPI_DEVICE_OST: +# +# Emitted when guest executes ACPI _OST method. +# +# @info: OSPM Status Indication +# +# Since: 2.1 +# +# Example: +# +# <- { "event": "ACPI_DEVICE_OST", +# "data": { "device": "d1", "slot": "0", +# "slot-type": "DIMM", "source": 1, "status": 0 } } +# +## +{ 'event': 'ACPI_DEVICE_OST', + 'data': { 'info': 'ACPIOSTInfo' } } diff --git a/qapi/misc.json b/qapi/misc.json index 71d11365ead..4b00b18e547 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -970,64 +970,6 @@ ## { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] } =20 -## -# @AcpiTableOptions: -# -# Specify an ACPI table on the command line to load. -# -# At most one of @file and @data can be specified. The list of files speci= fied -# by any one of them is loaded and concatenated in order. If both are omit= ted, -# @data is implied. -# -# Other fields / optargs can be used to override fields of the generic ACPI -# table header; refer to the ACPI specification 5.0, section 5.2.6 System -# Description Table Header. If a header field is not overridden, then the -# corresponding value from the concatenated blob is used (in case of @file= ), or -# it is filled in with a hard-coded value (in case of @data). -# -# String fields are copied into the matching ACPI member from lowest addre= ss -# upwards, and silently truncated / NUL-padded to length. -# -# @sig: table signature / identifier (4 bytes) -# -# @rev: table revision number (dependent on signature, 1 byte) -# -# @oem_id: OEM identifier (6 bytes) -# -# @oem_table_id: OEM table identifier (8 bytes) -# -# @oem_rev: OEM-supplied revision number (4 bytes) -# -# @asl_compiler_id: identifier of the utility that created the table -# (4 bytes) -# -# @asl_compiler_rev: revision number of the utility that created the -# table (4 bytes) -# -# @file: colon (:) separated list of pathnames to load and -# concatenate as table data. The resultant binary blob is expected = to -# have an ACPI table header. At least one file is required. This fi= eld -# excludes @data. -# -# @data: colon (:) separated list of pathnames to load and -# concatenate as table data. The resultant binary blob must not hav= e an -# ACPI table header. At least one file is required. This field excl= udes -# @file. -# -# Since: 1.5 -## -{ 'struct': 'AcpiTableOptions', - 'data': { - '*sig': 'str', - '*rev': 'uint8', - '*oem_id': 'str', - '*oem_table_id': 'str', - '*oem_rev': 'uint32', - '*asl_compiler_id': 'str', - '*asl_compiler_rev': 'uint32', - '*file': 'str', - '*data': 'str' }} - ## # @CommandLineParameterType: # @@ -1121,79 +1063,6 @@ 'returns': ['CommandLineOptionInfo'], 'allow-preconfig': true } =20 -## -# @ACPISlotType: -# -# @DIMM: memory slot -# @CPU: logical CPU slot (since 2.7) -## -{ 'enum': 'ACPISlotType', 'data': [ 'DIMM', 'CPU' ] } - -## -# @ACPIOSTInfo: -# -# OSPM Status Indication for a device -# For description of possible values of @source and @status fields -# see "_OST (OSPM Status Indication)" chapter of ACPI5.0 spec. -# -# @device: device ID associated with slot -# -# @slot: slot ID, unique per slot of a given @slot-type -# -# @slot-type: type of the slot -# -# @source: an integer containing the source event -# -# @status: an integer containing the status code -# -# Since: 2.1 -## -{ 'struct': 'ACPIOSTInfo', - 'data' : { '*device': 'str', - 'slot': 'str', - 'slot-type': 'ACPISlotType', - 'source': 'int', - 'status': 'int' } } - -## -# @query-acpi-ospm-status: -# -# Return a list of ACPIOSTInfo for devices that support status -# reporting via ACPI _OST method. -# -# Since: 2.1 -# -# Example: -# -# -> { "execute": "query-acpi-ospm-status" } -# <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "so= urce": 1, "status": 0}, -# { "slot": "1", "slot-type": "DIMM", "source": 0, "statu= s": 0}, -# { "slot": "2", "slot-type": "DIMM", "source": 0, "statu= s": 0}, -# { "slot": "3", "slot-type": "DIMM", "source": 0, "statu= s": 0} -# ]} -# -## -{ 'command': 'query-acpi-ospm-status', 'returns': ['ACPIOSTInfo'] } - -## -# @ACPI_DEVICE_OST: -# -# Emitted when guest executes ACPI _OST method. -# -# @info: OSPM Status Indication -# -# Since: 2.1 -# -# Example: -# -# <- { "event": "ACPI_DEVICE_OST", -# "data": { "device": "d1", "slot": "0", -# "slot-type": "DIMM", "source": 1, "status": 0 } } -# -## -{ 'event': 'ACPI_DEVICE_OST', - 'data': { 'info': 'ACPIOSTInfo' } } - ## # @ReplayMode: # diff --git a/qapi/qapi-schema.json b/qapi/qapi-schema.json index f03ff91ceb5..4d8b3a9afe2 100644 --- a/qapi/qapi-schema.json +++ b/qapi/qapi-schema.json @@ -85,3 +85,4 @@ { 'include': 'misc.json' } { 'include': 'misc-target.json' } { 'include': 'audio.json' } +{ 'include': 'acpi.json' } diff --git a/include/hw/acpi/acpi_dev_interface.h b/include/hw/acpi/acpi_de= v_interface.h index 9adf1e47067..769ff55c7ee 100644 --- a/include/hw/acpi/acpi_dev_interface.h +++ b/include/hw/acpi/acpi_dev_interface.h @@ -1,7 +1,7 @@ #ifndef ACPI_DEV_INTERFACE_H #define ACPI_DEV_INTERFACE_H =20 -#include "qapi/qapi-types-misc.h" +#include "qapi/qapi-types-acpi.h" #include "qom/object.h" #include "hw/boards.h" #include "hw/qdev-core.h" diff --git a/hw/acpi/core.c b/hw/acpi/core.c index ac06db34504..ade9158cbf1 100644 --- a/hw/acpi/core.c +++ b/hw/acpi/core.c @@ -27,7 +27,7 @@ #include "qapi/error.h" #include "qapi/opts-visitor.h" #include "qapi/qapi-events-run-state.h" -#include "qapi/qapi-visit-misc.h" +#include "qapi/qapi-visit-acpi.h" #include "qemu/error-report.h" #include "qemu/module.h" #include "qemu/option.h" diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c index 3d6a500fb7e..2d4ee1a7a44 100644 --- a/hw/acpi/cpu.c +++ b/hw/acpi/cpu.c @@ -3,7 +3,7 @@ #include "migration/vmstate.h" #include "hw/acpi/cpu.h" #include "qapi/error.h" -#include "qapi/qapi-events-misc.h" +#include "qapi/qapi-events-acpi.h" #include "trace.h" #include "sysemu/numa.h" =20 diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c index dfe57af4292..f2552b2a462 100644 --- a/hw/acpi/memory_hotplug.c +++ b/hw/acpi/memory_hotplug.c @@ -7,8 +7,8 @@ #include "migration/vmstate.h" #include "trace.h" #include "qapi/error.h" +#include "qapi/qapi-events-acpi.h" #include "qapi/qapi-events-machine.h" -#include "qapi/qapi-events-misc.h" =20 #define MEMORY_SLOTS_NUMBER "MDNR" #define MEMORY_HOTPLUG_IO_REGION "HPMR" diff --git a/monitor/qmp-cmds.c b/monitor/qmp-cmds.c index 864cbfa32e6..0ab5b785805 100644 --- a/monitor/qmp-cmds.c +++ b/monitor/qmp-cmds.c @@ -30,6 +30,7 @@ #include "sysemu/blockdev.h" #include "sysemu/block-backend.h" #include "qapi/error.h" +#include "qapi/qapi-commands-acpi.h" #include "qapi/qapi-commands-block.h" #include "qapi/qapi-commands-control.h" #include "qapi/qapi-commands-machine.h" diff --git a/MAINTAINERS b/MAINTAINERS index cf96fa83795..5ce0ccad49b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1613,6 +1613,7 @@ F: hw/acpi/* F: hw/smbios/* F: hw/i386/acpi-build.[hc] F: hw/arm/virt-acpi-build.c +F: qapi/acpi.json F: tests/qtest/bios-tables-test* F: tests/qtest/acpi-utils.[hc] F: tests/data/acpi/ diff --git a/qapi/meson.build b/qapi/meson.build index 2b2872a41d8..f57acc24026 100644 --- a/qapi/meson.build +++ b/qapi/meson.build @@ -14,6 +14,7 @@ util_ss.add(files( )) =20 qapi_all_modules =3D [ + 'acpi', 'audio', 'authz', 'block-core', --=20 2.26.2 From nobody Sat May 4 19:08:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600026874; cv=none; d=zohomail.com; s=zohoarc; b=czh4x1Zsv9FARNCO0UbiDLVrPaSmRsWSTC0NLhFcRMgfiY8TBNmJU8oaCvIeZOCWAuC1GFHLfkEG1I59eA31hUPPOUga2qAAURInHLbRCZrUHJvx9cSMc+47sQ0tS7Slt1QIZ4SntWEbr4izLAyBldeuxMuEzVx7VZvB6/zLQ/4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600026874; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=Jiuz3W2sZ7VlK8ICF0vLUvvEj8+IXBRkvq6aeyu4OD4=; b=KoSCmcAAiu+WlNSbumUn6/SHL99hqXwXZASvPBj9cQVf3rruVgFjWMOPTVnM177nNexjhF0bX1fb2w1KRG6tMpAEHEmB3wSfbk5jIuyaWP2ByoSqmnfMEef0ikz7RUZeni9Udvl4GzBBh4MhBsz21WijDlYbfGfSYo3HiXE5c64= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1600026874349863.877032510369; Sun, 13 Sep 2020 12:54:34 -0700 (PDT) Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-331-UPucX94WPOaIVne_ZHI5iA-1; Sun, 13 Sep 2020 15:54:31 -0400 Received: by mail-wr1-f72.google.com with SMTP id k13so5940339wrl.4 for ; Sun, 13 Sep 2020 12:54:31 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (65.red-83-57-170.dynamicip.rima-tde.net. [83.57.170.65]) by smtp.gmail.com with ESMTPSA id n4sm16622024wrp.61.2020.09.13.12.54.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2020 12:54:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600026873; 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=Jiuz3W2sZ7VlK8ICF0vLUvvEj8+IXBRkvq6aeyu4OD4=; b=AiQX24ryy3I+pdQ/5crzhzzSqkuFGhgclxtZEMLlS+s61vreOIqlg0/6+EVLhm1zZMj6P1 QkE1aFRxEo0jPYfOzcqJzy8WlTxrbAciVE4pr2E+WPrKnemJF55aYJ8Gij8qUb8qMQWZYs 6BBQIJZCn2UdmWmDKX9NXCWM0neaIJU= X-MC-Unique: UPucX94WPOaIVne_ZHI5iA-1 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=Jiuz3W2sZ7VlK8ICF0vLUvvEj8+IXBRkvq6aeyu4OD4=; b=Ax1+m3iQ3V0I3cWWRIa5Z4FI7/D4/JXYjzQLlIrnYVgwzfrTUTz2/ecWtyYnOc/BNl IBTv8OTx2P1jpqyUdwoyvMjloJ+fmhkRcoWTppt+nGBW1MuvXHe2ZHA9mxhihPrjGNvW btO+D+7MRh9FeQ3yP3wg/4T/uzWmqqWC0t/wO3N4Jk9cBn2/A+5av8gBNy+11nowolUI jCyhnpPEsmMR6dMt6N9U4zsyqgm6PtE+Zp0N3NSn/16bc5A1VkGJkr5b1B4fWl8sP0ce q3g28bNNEg7+C51HnAe2/YletvA/XAbG4Z0iE9BeBbMzfT2mtcLw4jc6CfAn86MxI6Rl 4LKQ== X-Gm-Message-State: AOAM530U+4NvvfCVQXBr/DRNfwGawbnjOQFlI/Oo0wOtpVrMv+3A3asj 6cNMVivsu3fTYtByOac+iq8Ors1JOVx/XDI4wfJQzPQNxlvOqWGgr7mAw+iAjF27zUji4LDHXLZ HwpsnoNj2Pw9YYA== X-Received: by 2002:adf:fd8c:: with SMTP id d12mr12271860wrr.283.1600026869426; Sun, 13 Sep 2020 12:54:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJznSYQGOYPg6I8x5MW5/y4mBTtz82MhAaRCP2sFBxod0BM5X62rNnePMqgMBZ4Luqku6by9fg== X-Received: by 2002:adf:fd8c:: with SMTP id d12mr12271842wrr.283.1600026869078; Sun, 13 Sep 2020 12:54:29 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Cc: Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v5 8/8] qapi: Extract PCI commands to 'pci.json' Date: Sun, 13 Sep 2020 21:53:48 +0200 Message-Id: <20200913195348.1064154-9-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200913195348.1064154-1-philmd@redhat.com> References: <20200913195348.1064154-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Only qemu-system-FOO and qemu-storage-daemon provide QMP monitors, therefore such declarations and definitions are irrelevant for user-mode emulation. Extracting the PCI commands to their own schema reduces the size of the qapi-misc* headers generated, and allows pulling less declarations/definitions to user-mode. Suggested-by: Markus Armbruster Acked-by: Markus Armbruster Acked-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- qapi/misc.json | 306 ---------------------------------------- qapi/pci.json | 316 ++++++++++++++++++++++++++++++++++++++++++ qapi/qapi-schema.json | 1 + hw/pci/pci-stub.c | 2 +- hw/pci/pci.c | 2 +- monitor/hmp-cmds.c | 1 + MAINTAINERS | 1 + qapi/meson.build | 1 + 8 files changed, 322 insertions(+), 308 deletions(-) create mode 100644 qapi/pci.json diff --git a/qapi/misc.json b/qapi/misc.json index 4b00b18e547..694d2142f37 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -157,312 +157,6 @@ { 'command': 'query-iothreads', 'returns': ['IOThreadInfo'], 'allow-preconfig': true } =20 -## -# @PciMemoryRange: -# -# A PCI device memory region -# -# @base: the starting address (guest physical) -# -# @limit: the ending address (guest physical) -# -# Since: 0.14.0 -## -{ 'struct': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} } - -## -# @PciMemoryRegion: -# -# Information about a PCI device I/O region. -# -# @bar: the index of the Base Address Register for this region -# -# @type: - 'io' if the region is a PIO region -# - 'memory' if the region is a MMIO region -# -# @size: memory size -# -# @prefetch: if @type is 'memory', true if the memory is prefetchable -# -# @mem_type_64: if @type is 'memory', true if the BAR is 64-bit -# -# Since: 0.14.0 -## -{ 'struct': 'PciMemoryRegion', - 'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int', - '*prefetch': 'bool', '*mem_type_64': 'bool' } } - -## -# @PciBusInfo: -# -# Information about a bus of a PCI Bridge device -# -# @number: primary bus interface number. This should be the number of the -# bus the device resides on. -# -# @secondary: secondary bus interface number. This is the number of the -# main bus for the bridge -# -# @subordinate: This is the highest number bus that resides below the -# bridge. -# -# @io_range: The PIO range for all devices on this bridge -# -# @memory_range: The MMIO range for all devices on this bridge -# -# @prefetchable_range: The range of prefetchable MMIO for all devices on -# this bridge -# -# Since: 2.4 -## -{ 'struct': 'PciBusInfo', - 'data': {'number': 'int', 'secondary': 'int', 'subordinate': 'int', - 'io_range': 'PciMemoryRange', - 'memory_range': 'PciMemoryRange', - 'prefetchable_range': 'PciMemoryRange' } } - -## -# @PciBridgeInfo: -# -# Information about a PCI Bridge device -# -# @bus: information about the bus the device resides on -# -# @devices: a list of @PciDeviceInfo for each device on this bridge -# -# Since: 0.14.0 -## -{ 'struct': 'PciBridgeInfo', - 'data': {'bus': 'PciBusInfo', '*devices': ['PciDeviceInfo']} } - -## -# @PciDeviceClass: -# -# Information about the Class of a PCI device -# -# @desc: a string description of the device's class -# -# @class: the class code of the device -# -# Since: 2.4 -## -{ 'struct': 'PciDeviceClass', - 'data': {'*desc': 'str', 'class': 'int'} } - -## -# @PciDeviceId: -# -# Information about the Id of a PCI device -# -# @device: the PCI device id -# -# @vendor: the PCI vendor id -# -# @subsystem: the PCI subsystem id (since 3.1) -# -# @subsystem-vendor: the PCI subsystem vendor id (since 3.1) -# -# Since: 2.4 -## -{ 'struct': 'PciDeviceId', - 'data': {'device': 'int', 'vendor': 'int', '*subsystem': 'int', - '*subsystem-vendor': 'int'} } - -## -# @PciDeviceInfo: -# -# Information about a PCI device -# -# @bus: the bus number of the device -# -# @slot: the slot the device is located in -# -# @function: the function of the slot used by the device -# -# @class_info: the class of the device -# -# @id: the PCI device id -# -# @irq: if an IRQ is assigned to the device, the IRQ number -# -# @irq_pin: the IRQ pin, zero means no IRQ (since 5.1) -# -# @qdev_id: the device name of the PCI device -# -# @pci_bridge: if the device is a PCI bridge, the bridge information -# -# @regions: a list of the PCI I/O regions associated with the device -# -# Notes: the contents of @class_info.desc are not stable and should only be -# treated as informational. -# -# Since: 0.14.0 -## -{ 'struct': 'PciDeviceInfo', - 'data': {'bus': 'int', 'slot': 'int', 'function': 'int', - 'class_info': 'PciDeviceClass', 'id': 'PciDeviceId', - '*irq': 'int', 'irq_pin': 'int', 'qdev_id': 'str', - '*pci_bridge': 'PciBridgeInfo', 'regions': ['PciMemoryRegion'] = }} - -## -# @PciInfo: -# -# Information about a PCI bus -# -# @bus: the bus index -# -# @devices: a list of devices on this bus -# -# Since: 0.14.0 -## -{ 'struct': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']= } } - -## -# @query-pci: -# -# Return information about the PCI bus topology of the guest. -# -# Returns: a list of @PciInfo for each PCI bus. Each bus is -# represented by a json-object, which has a key with a json-array= of -# all PCI devices attached to it. Each device is represented by a -# json-object. -# -# Since: 0.14.0 -# -# Example: -# -# -> { "execute": "query-pci" } -# <- { "return": [ -# { -# "bus": 0, -# "devices": [ -# { -# "bus": 0, -# "qdev_id": "", -# "slot": 0, -# "class_info": { -# "class": 1536, -# "desc": "Host bridge" -# }, -# "id": { -# "device": 32902, -# "vendor": 4663 -# }, -# "function": 0, -# "regions": [ -# ] -# }, -# { -# "bus": 0, -# "qdev_id": "", -# "slot": 1, -# "class_info": { -# "class": 1537, -# "desc": "ISA bridge" -# }, -# "id": { -# "device": 32902, -# "vendor": 28672 -# }, -# "function": 0, -# "regions": [ -# ] -# }, -# { -# "bus": 0, -# "qdev_id": "", -# "slot": 1, -# "class_info": { -# "class": 257, -# "desc": "IDE controller" -# }, -# "id": { -# "device": 32902, -# "vendor": 28688 -# }, -# "function": 1, -# "regions": [ -# { -# "bar": 4, -# "size": 16, -# "address": 49152, -# "type": "io" -# } -# ] -# }, -# { -# "bus": 0, -# "qdev_id": "", -# "slot": 2, -# "class_info": { -# "class": 768, -# "desc": "VGA controller" -# }, -# "id": { -# "device": 4115, -# "vendor": 184 -# }, -# "function": 0, -# "regions": [ -# { -# "prefetch": true, -# "mem_type_64": false, -# "bar": 0, -# "size": 33554432, -# "address": 4026531840, -# "type": "memory" -# }, -# { -# "prefetch": false, -# "mem_type_64": false, -# "bar": 1, -# "size": 4096, -# "address": 4060086272, -# "type": "memory" -# }, -# { -# "prefetch": false, -# "mem_type_64": false, -# "bar": 6, -# "size": 65536, -# "address": -1, -# "type": "memory" -# } -# ] -# }, -# { -# "bus": 0, -# "qdev_id": "", -# "irq": 11, -# "slot": 4, -# "class_info": { -# "class": 1280, -# "desc": "RAM controller" -# }, -# "id": { -# "device": 6900, -# "vendor": 4098 -# }, -# "function": 0, -# "regions": [ -# { -# "bar": 0, -# "size": 32, -# "address": 49280, -# "type": "io" -# } -# ] -# } -# ] -# } -# ] -# } -# -# Note: This example has been shortened as the real response is too long. -# -## -{ 'command': 'query-pci', 'returns': ['PciInfo'] } - ## # @stop: # diff --git a/qapi/pci.json b/qapi/pci.json new file mode 100644 index 00000000000..b79cbd787be --- /dev/null +++ b/qapi/pci.json @@ -0,0 +1,316 @@ +# -*- Mode: Python -*- +# vim: filetype=3Dpython +# +# This work is licensed under the terms of the GNU GPL, version 2 or later. +# See the COPYING file in the top-level directory. +# SPDX-License-Identifier: GPL-2.0-or-later + +## +# =3D PCI +## + +## +# @PciMemoryRange: +# +# A PCI device memory region +# +# @base: the starting address (guest physical) +# +# @limit: the ending address (guest physical) +# +# Since: 0.14.0 +## +{ 'struct': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} } + +## +# @PciMemoryRegion: +# +# Information about a PCI device I/O region. +# +# @bar: the index of the Base Address Register for this region +# +# @type: - 'io' if the region is a PIO region +# - 'memory' if the region is a MMIO region +# +# @size: memory size +# +# @prefetch: if @type is 'memory', true if the memory is prefetchable +# +# @mem_type_64: if @type is 'memory', true if the BAR is 64-bit +# +# Since: 0.14.0 +## +{ 'struct': 'PciMemoryRegion', + 'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int', + '*prefetch': 'bool', '*mem_type_64': 'bool' } } + +## +# @PciBusInfo: +# +# Information about a bus of a PCI Bridge device +# +# @number: primary bus interface number. This should be the number of the +# bus the device resides on. +# +# @secondary: secondary bus interface number. This is the number of the +# main bus for the bridge +# +# @subordinate: This is the highest number bus that resides below the +# bridge. +# +# @io_range: The PIO range for all devices on this bridge +# +# @memory_range: The MMIO range for all devices on this bridge +# +# @prefetchable_range: The range of prefetchable MMIO for all devices on +# this bridge +# +# Since: 2.4 +## +{ 'struct': 'PciBusInfo', + 'data': {'number': 'int', 'secondary': 'int', 'subordinate': 'int', + 'io_range': 'PciMemoryRange', + 'memory_range': 'PciMemoryRange', + 'prefetchable_range': 'PciMemoryRange' } } + +## +# @PciBridgeInfo: +# +# Information about a PCI Bridge device +# +# @bus: information about the bus the device resides on +# +# @devices: a list of @PciDeviceInfo for each device on this bridge +# +# Since: 0.14.0 +## +{ 'struct': 'PciBridgeInfo', + 'data': {'bus': 'PciBusInfo', '*devices': ['PciDeviceInfo']} } + +## +# @PciDeviceClass: +# +# Information about the Class of a PCI device +# +# @desc: a string description of the device's class +# +# @class: the class code of the device +# +# Since: 2.4 +## +{ 'struct': 'PciDeviceClass', + 'data': {'*desc': 'str', 'class': 'int'} } + +## +# @PciDeviceId: +# +# Information about the Id of a PCI device +# +# @device: the PCI device id +# +# @vendor: the PCI vendor id +# +# @subsystem: the PCI subsystem id (since 3.1) +# +# @subsystem-vendor: the PCI subsystem vendor id (since 3.1) +# +# Since: 2.4 +## +{ 'struct': 'PciDeviceId', + 'data': {'device': 'int', 'vendor': 'int', '*subsystem': 'int', + '*subsystem-vendor': 'int'} } + +## +# @PciDeviceInfo: +# +# Information about a PCI device +# +# @bus: the bus number of the device +# +# @slot: the slot the device is located in +# +# @function: the function of the slot used by the device +# +# @class_info: the class of the device +# +# @id: the PCI device id +# +# @irq: if an IRQ is assigned to the device, the IRQ number +# +# @irq_pin: the IRQ pin, zero means no IRQ (since 5.1) +# +# @qdev_id: the device name of the PCI device +# +# @pci_bridge: if the device is a PCI bridge, the bridge information +# +# @regions: a list of the PCI I/O regions associated with the device +# +# Notes: the contents of @class_info.desc are not stable and should only be +# treated as informational. +# +# Since: 0.14.0 +## +{ 'struct': 'PciDeviceInfo', + 'data': {'bus': 'int', 'slot': 'int', 'function': 'int', + 'class_info': 'PciDeviceClass', 'id': 'PciDeviceId', + '*irq': 'int', 'irq_pin': 'int', 'qdev_id': 'str', + '*pci_bridge': 'PciBridgeInfo', 'regions': ['PciMemoryRegion'] = }} + +## +# @PciInfo: +# +# Information about a PCI bus +# +# @bus: the bus index +# +# @devices: a list of devices on this bus +# +# Since: 0.14.0 +## +{ 'struct': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']= } } + +## +# @query-pci: +# +# Return information about the PCI bus topology of the guest. +# +# Returns: a list of @PciInfo for each PCI bus. Each bus is +# represented by a json-object, which has a key with a json-array= of +# all PCI devices attached to it. Each device is represented by a +# json-object. +# +# Since: 0.14.0 +# +# Example: +# +# -> { "execute": "query-pci" } +# <- { "return": [ +# { +# "bus": 0, +# "devices": [ +# { +# "bus": 0, +# "qdev_id": "", +# "slot": 0, +# "class_info": { +# "class": 1536, +# "desc": "Host bridge" +# }, +# "id": { +# "device": 32902, +# "vendor": 4663 +# }, +# "function": 0, +# "regions": [ +# ] +# }, +# { +# "bus": 0, +# "qdev_id": "", +# "slot": 1, +# "class_info": { +# "class": 1537, +# "desc": "ISA bridge" +# }, +# "id": { +# "device": 32902, +# "vendor": 28672 +# }, +# "function": 0, +# "regions": [ +# ] +# }, +# { +# "bus": 0, +# "qdev_id": "", +# "slot": 1, +# "class_info": { +# "class": 257, +# "desc": "IDE controller" +# }, +# "id": { +# "device": 32902, +# "vendor": 28688 +# }, +# "function": 1, +# "regions": [ +# { +# "bar": 4, +# "size": 16, +# "address": 49152, +# "type": "io" +# } +# ] +# }, +# { +# "bus": 0, +# "qdev_id": "", +# "slot": 2, +# "class_info": { +# "class": 768, +# "desc": "VGA controller" +# }, +# "id": { +# "device": 4115, +# "vendor": 184 +# }, +# "function": 0, +# "regions": [ +# { +# "prefetch": true, +# "mem_type_64": false, +# "bar": 0, +# "size": 33554432, +# "address": 4026531840, +# "type": "memory" +# }, +# { +# "prefetch": false, +# "mem_type_64": false, +# "bar": 1, +# "size": 4096, +# "address": 4060086272, +# "type": "memory" +# }, +# { +# "prefetch": false, +# "mem_type_64": false, +# "bar": 6, +# "size": 65536, +# "address": -1, +# "type": "memory" +# } +# ] +# }, +# { +# "bus": 0, +# "qdev_id": "", +# "irq": 11, +# "slot": 4, +# "class_info": { +# "class": 1280, +# "desc": "RAM controller" +# }, +# "id": { +# "device": 6900, +# "vendor": 4098 +# }, +# "function": 0, +# "regions": [ +# { +# "bar": 0, +# "size": 32, +# "address": 49280, +# "type": "io" +# } +# ] +# } +# ] +# } +# ] +# } +# +# Note: This example has been shortened as the real response is too long. +# +## +{ 'command': 'query-pci', 'returns': ['PciInfo'] } diff --git a/qapi/qapi-schema.json b/qapi/qapi-schema.json index 4d8b3a9afe2..54c8ba64441 100644 --- a/qapi/qapi-schema.json +++ b/qapi/qapi-schema.json @@ -86,3 +86,4 @@ { 'include': 'misc-target.json' } { 'include': 'audio.json' } { 'include': 'acpi.json' } +{ 'include': 'pci.json' } diff --git a/hw/pci/pci-stub.c b/hw/pci/pci-stub.c index cc2a2e1f735..3a027c42e43 100644 --- a/hw/pci/pci-stub.c +++ b/hw/pci/pci-stub.c @@ -22,7 +22,7 @@ #include "sysemu/sysemu.h" #include "monitor/monitor.h" #include "qapi/error.h" -#include "qapi/qapi-commands-misc.h" +#include "qapi/qapi-commands-pci.h" #include "qapi/qmp/qerror.h" #include "hw/pci/pci.h" #include "hw/pci/msi.h" diff --git a/hw/pci/pci.c b/hw/pci/pci.c index de0fae10ab9..e950e72d848 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -46,7 +46,7 @@ #include "hw/hotplug.h" #include "hw/boards.h" #include "qapi/error.h" -#include "qapi/qapi-commands-misc.h" +#include "qapi/qapi-commands-pci.h" #include "qemu/cutils.h" =20 //#define DEBUG_PCI diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index de01ba20845..dc0de392196 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -36,6 +36,7 @@ #include "qapi/qapi-commands-migration.h" #include "qapi/qapi-commands-misc.h" #include "qapi/qapi-commands-net.h" +#include "qapi/qapi-commands-pci.h" #include "qapi/qapi-commands-rocker.h" #include "qapi/qapi-commands-run-state.h" #include "qapi/qapi-commands-tpm.h" diff --git a/MAINTAINERS b/MAINTAINERS index 5ce0ccad49b..4d912cf0e98 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1598,6 +1598,7 @@ F: include/hw/pci/* F: hw/misc/pci-testdev.c F: hw/pci/* F: hw/pci-bridge/* +F: qapi/pci.json F: docs/pci* F: docs/specs/*pci* F: default-configs/pci.mak diff --git a/qapi/meson.build b/qapi/meson.build index f57acc24026..298b510492b 100644 --- a/qapi/meson.build +++ b/qapi/meson.build @@ -35,6 +35,7 @@ qapi_all_modules =3D [ 'net', 'pragma', 'qdev', + 'pci', 'qom', 'rdma', 'rocker', --=20 2.26.2