From patchwork Mon Mar 16 00:03:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 11439507 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B9AA192A for ; Mon, 16 Mar 2020 00:20:27 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 83F34205ED for ; Mon, 16 Mar 2020 00:20:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="CGVv5x5Z" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 83F34205ED Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:60650 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDdUY-0002Wj-CP for patchwork-qemu-devel@patchwork.kernel.org; Sun, 15 Mar 2020 20:20:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50020) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDdEh-0005Uw-Mk for qemu-devel@nongnu.org; Sun, 15 Mar 2020 20:04:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jDdEg-0000fe-93 for qemu-devel@nongnu.org; Sun, 15 Mar 2020 20:04:03 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:57012 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jDdEg-0000d2-59 for qemu-devel@nongnu.org; Sun, 15 Mar 2020 20:04:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584317041; 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=AYi+AQJNRazdsNeUR0yPxUEV7hTHsjPmGgUWtXU2qgA=; b=CGVv5x5ZgSQrJNJtyQN3Y9LWhPUJo4aj3SKOuvsfw7FwmPfD1GHONF+WGAFy/MRDWP+2BA Yj7C8cNkLec+isV/P3q3uPx+3e1yS3KiLvyWNPDLLO/iGLoWopIYaCj7MAW16y6mejD93I ZTWXK2FywzudSW4aad+4HdmeuVQ+Ehs= 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-407-RpqUfw6_NpOerphFR4Xajg-1; Sun, 15 Mar 2020 20:03:59 -0400 X-MC-Unique: RpqUfw6_NpOerphFR4Xajg-1 Received: by mail-wr1-f71.google.com with SMTP id s4so2723362wrb.19 for ; Sun, 15 Mar 2020 17:03:59 -0700 (PDT) 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=3gQwWJ04PppyimNpXPOyqaqOtjbzf9sfLB9iKaREjik=; b=cip3LCjaX5P6+bJokdcLJR+0k8Klk3oxuH80Tv1cfc0dh//0dxyDKkUlmArDAoEPe6 bc4Nz+otgYFVW7DNITapJHavcHFHw1Hdl9wXoVjaPIDLc55mKCiq1oPSuAhuuOOvXQcP UxCeqXWW+TjwDbTCU83kL1fI+x/pdC5pMOlvAfIkvYrmnyx30JDsxh5q0mLFqOZ5o1fv QXC175jKoi1F+zBCu+SwjtWQo/8ZuRDuWtVZfe7PpfdFqUXMlMPgz8swMeqWNaEqQOeO 46bbJZF1jrgbQOWb9bJmCK5hd0kLVDtr3AWz2A+FSWbf2WS5KYLBUZCINDSxTptLmHPB pyzA== X-Gm-Message-State: ANhLgQ2457NcBVrIyegmtjg0TgoH+KmRoRrGEVHSicJAW8yI3zkvyg8K /0jhLyONBje+oHojCvIPz//0LPh6da6UKKojNjpsA/IUT+YS8OeUO9oSzh6OeY3aTjbsGSy3UGp 6wD2KRlYddPRN2sA= X-Received: by 2002:adf:b1d2:: with SMTP id r18mr30594146wra.86.1584317038278; Sun, 15 Mar 2020 17:03:58 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs57CIc4cfIwRdodJub2JqPW2Nfc9eopczHBFdj1k/5QBswdShbdLFHQ+cT1aZu/UDlxDpSow== X-Received: by 2002:adf:b1d2:: with SMTP id r18mr30594126wra.86.1584317037982; Sun, 15 Mar 2020 17:03:57 -0700 (PDT) Received: from localhost.localdomain (191.red-83-42-66.dynamicip.rima-tde.net. [83.42.66.191]) by smtp.gmail.com with ESMTPSA id c26sm26931384wmb.8.2020.03.15.17.03.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Mar 2020 17:03:57 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 1/8] target/i386: Restrict X86CPUFeatureWord to X86 targets Date: Mon, 16 Mar 2020 01:03:41 +0100 Message-Id: <20200316000348.29692-2-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200316000348.29692-1-philmd@redhat.com> References: <20200316000348.29692-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Ben Warren , "Michael S. Tsirkin" , Ronnie Sahlberg , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Peter Lieven , "Dr. David Alan Gilbert" , Max Reitz , Richard Henderson , Paolo Bonzini , Igor Mammedov , qemu-block@nongnu.org, Markus Armbruster , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Move out x86-specific structures from generic machine code. Acked-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- qapi/machine-target.json | 45 ++++++++++++++++++++++++++++++++++++++ qapi/machine.json | 42 ----------------------------------- target/i386/cpu.c | 2 +- target/i386/machine-stub.c | 22 +++++++++++++++++++ target/i386/Makefile.objs | 3 ++- 5 files changed, 70 insertions(+), 44 deletions(-) create mode 100644 target/i386/machine-stub.c diff --git a/qapi/machine-target.json b/qapi/machine-target.json index f2c82949d8..fb7a4b7850 100644 --- a/qapi/machine-target.json +++ b/qapi/machine-target.json @@ -3,6 +3,51 @@ # This work is licensed under the terms of the GNU GPL, version 2 or later. # See the COPYING file in the top-level directory. +## +# @X86CPURegister32: +# +# A X86 32-bit register +# +# Since: 1.5 +## +{ 'enum': 'X86CPURegister32', + 'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ], + 'if': 'defined(TARGET_I386)' } + +## +# @X86CPUFeatureWordInfo: +# +# Information about a X86 CPU feature word +# +# @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word +# +# @cpuid-input-ecx: Input ECX value for CPUID instruction for that +# feature word +# +# @cpuid-register: Output register containing the feature bits +# +# @features: value of output register, containing the feature bits +# +# Since: 1.5 +## +{ 'struct': 'X86CPUFeatureWordInfo', + 'data': { 'cpuid-input-eax': 'int', + '*cpuid-input-ecx': 'int', + 'cpuid-register': 'X86CPURegister32', + 'features': 'int' }, + 'if': 'defined(TARGET_I386)' } + +## +# @DummyForceArrays: +# +# Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally +# +# Since: 2.5 +## +{ 'struct': 'DummyForceArrays', + 'data': { 'unused': ['X86CPUFeatureWordInfo'] }, + 'if': 'defined(TARGET_I386)' } + ## # @CpuModelInfo: # diff --git a/qapi/machine.json b/qapi/machine.json index 6c11e3cf3a..de05730704 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -505,48 +505,6 @@ 'dst': 'uint16', 'val': 'uint8' }} -## -# @X86CPURegister32: -# -# A X86 32-bit register -# -# Since: 1.5 -## -{ 'enum': 'X86CPURegister32', - 'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] } - -## -# @X86CPUFeatureWordInfo: -# -# Information about a X86 CPU feature word -# -# @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word -# -# @cpuid-input-ecx: Input ECX value for CPUID instruction for that -# feature word -# -# @cpuid-register: Output register containing the feature bits -# -# @features: value of output register, containing the feature bits -# -# Since: 1.5 -## -{ 'struct': 'X86CPUFeatureWordInfo', - 'data': { 'cpuid-input-eax': 'int', - '*cpuid-input-ecx': 'int', - 'cpuid-register': 'X86CPURegister32', - 'features': 'int' } } - -## -# @DummyForceArrays: -# -# Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally -# -# Since: 2.5 -## -{ 'struct': 'DummyForceArrays', - 'data': { 'unused': ['X86CPUFeatureWordInfo'] } } - ## # @NumaCpuOptions: # diff --git a/target/i386/cpu.c b/target/i386/cpu.c index a84553e50c..0753fe4935 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -37,7 +37,7 @@ #include "qemu/option.h" #include "qemu/config-file.h" #include "qapi/error.h" -#include "qapi/qapi-visit-machine.h" +#include "qapi/qapi-visit-machine-target.h" #include "qapi/qapi-visit-run-state.h" #include "qapi/qmp/qdict.h" #include "qapi/qmp/qerror.h" diff --git a/target/i386/machine-stub.c b/target/i386/machine-stub.c new file mode 100644 index 0000000000..cb301af057 --- /dev/null +++ b/target/i386/machine-stub.c @@ -0,0 +1,22 @@ +/* + * QAPI x86 CPU features stub + * + * Copyright (c) 2020 Red Hat, Inc. + * + * Author: + * Philippe Mathieu-Daudé + * + * 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 + */ + +#include "qemu/osdep.h" +#include "qapi/error.h" +#include "qapi/qapi-visit-machine-target.h" + +void visit_type_X86CPUFeatureWordInfoList(Visitor *v, const char *name, + X86CPUFeatureWordInfoList **obj, + Error **errp) +{ +} diff --git a/target/i386/Makefile.objs b/target/i386/Makefile.objs index 48e0c28434..1cdfc9f50c 100644 --- a/target/i386/Makefile.objs +++ b/target/i386/Makefile.objs @@ -17,6 +17,7 @@ obj-$(CONFIG_HAX) += hax-all.o hax-mem.o hax-posix.o endif obj-$(CONFIG_HVF) += hvf/ obj-$(CONFIG_WHPX) += whpx-all.o -endif +endif # CONFIG_SOFTMMU obj-$(CONFIG_SEV) += sev.o obj-$(call lnot,$(CONFIG_SEV)) += sev-stub.o +obj-$(call lnot,$(CONFIG_SOFTMMU)) += machine-stub.o From patchwork Mon Mar 16 00:03:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 11439549 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9FBC7921 for ; Mon, 16 Mar 2020 00:53:41 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 75FED20663 for ; Mon, 16 Mar 2020 00:53:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="DxMH+o87" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 75FED20663 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:60904 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDe0i-0008Q8-AM for patchwork-qemu-devel@patchwork.kernel.org; Sun, 15 Mar 2020 20:53:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50132) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDdEr-0005Y9-Ex for qemu-devel@nongnu.org; Sun, 15 Mar 2020 20:04:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jDdEp-0001Et-2X for qemu-devel@nongnu.org; Sun, 15 Mar 2020 20:04:12 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:27394 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jDdEo-00018M-TJ for qemu-devel@nongnu.org; Sun, 15 Mar 2020 20:04:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584317047; 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=JhEb4Fw98Hx85uciQ4N5nkgUEmDVM0SFls1vrHfkKXw=; b=DxMH+o87xsJJW09LVIosbNUb6/hWlOx9toPg6dEyuqbIVaD6YecptkSjPii76vhgrYeg6L ruWHqXW3c1wti5uZiqhdY6QDSPYX8rlTptA9nqIesDj7SlLIlEONpvZkBzBTBIdXZmRZA0 CcDrR2E543dQ9grh3IqOgVVSlWWRM6g= 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-4--HfcXVt8PRWe6Ut2AXIEGg-1; Sun, 15 Mar 2020 20:04:05 -0400 X-MC-Unique: -HfcXVt8PRWe6Ut2AXIEGg-1 Received: by mail-wr1-f71.google.com with SMTP id 94so3452794wrr.3 for ; Sun, 15 Mar 2020 17:04:05 -0700 (PDT) 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=/2Hixt+DAyk9U4012uc1/q9PdUELc/grv+MCT0aAnGc=; b=EDeVIGRzKIdJgSKB6u6+1XkeTt8ULlIox+INbHILCMeHe47VGkEb/6K/6SLHk6OUnU hBBIFv/IyQflr/Chf0pI5xSohYdg1753asmTaXYuslfveCV0ipkImRPA9jfImgYdWJFr vMIVk/JSVhtf7GB7insjwIyOfkakMRHexI9nPGcCmNB8PeRj2+dlJVR70shjwnUsAtuX oeLtDEQ8pPTjQ1hvgCxKr9/WtiIHhnjBQeZWTo90WTAY9VtbpMs4XeP8mwVbU/QTNmha XfpElAqB/ryAy4xuxFlazhOsIncNAS2Lymij0L4QHRLOK5yMle1pl4OIooAvegWi9k3f +6qw== X-Gm-Message-State: ANhLgQ2tcGXAPYzBcKGHazwCT4FVi0Y6UF0cB4RaxIzx6gUDdazIhsoo atlVzON9nbPJfd1WttAouZNB6UJiCNUo+NOkyhdhrqDDtcQJ+7LL7o/MrHd5pG7Ma9oQwMS9ok3 pgfgz276iu4AtILM= X-Received: by 2002:a7b:c3cb:: with SMTP id t11mr25535069wmj.154.1584317044284; Sun, 15 Mar 2020 17:04:04 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuOAHaRJoRQHYm0owc0Ej2+MNRAQ3gm/TG9MCh7hR4HAEyCwJVpvNADjk83wAdsJO0cCG7Ubg== X-Received: by 2002:a7b:c3cb:: with SMTP id t11mr25535033wmj.154.1584317044034; Sun, 15 Mar 2020 17:04:04 -0700 (PDT) Received: from localhost.localdomain (191.red-83-42-66.dynamicip.rima-tde.net. [83.42.66.191]) by smtp.gmail.com with ESMTPSA id f15sm27533041wmj.25.2020.03.15.17.04.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Mar 2020 17:04:03 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 2/8] qapi/misc: Restrict LostTickPolicy enum to machine code Date: Mon, 16 Mar 2020 01:03:42 +0100 Message-Id: <20200316000348.29692-3-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200316000348.29692-1-philmd@redhat.com> References: <20200316000348.29692-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.61 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Ben Warren , "Michael S. Tsirkin" , Ronnie Sahlberg , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Peter Lieven , "Dr. David Alan Gilbert" , Max Reitz , Paolo Bonzini , Igor Mammedov , qemu-block@nongnu.org, Markus Armbruster , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Igor Mammedov --- 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 de05730704..07ffc07ba2 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -415,6 +415,38 @@ ## { 'command': 'query-target', 'returns': 'TargetInfo' } +## +# @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 now +# be behind the time in the host by exactly the amount of time during +# 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 c18fe681fb..2725d835ad 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -7,38 +7,6 @@ { 'include': 'common.json' } -## -# @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 now -# be behind the time in the host by exactly the amount of time during -# 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 10c93a096a..58a7748c66 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 -#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 2047114fca..59380ed761 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 876f5aa6fa..22ba6149b5 100644 --- a/hw/i386/kvm/i8254.c +++ b/hw/i386/kvm/i8254.c @@ -25,7 +25,7 @@ #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" From patchwork Mon Mar 16 00:03:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 11439527 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DE052921 for ; Mon, 16 Mar 2020 00:47:26 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B3BBA205C9 for ; Mon, 16 Mar 2020 00:47:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="LMgCKsd9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B3BBA205C9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:60870 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDduf-0005Sb-Jr for patchwork-qemu-devel@patchwork.kernel.org; Sun, 15 Mar 2020 20:47:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50201) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDdF0-0005ZS-81 for qemu-devel@nongnu.org; Sun, 15 Mar 2020 20:04:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jDdEt-0001Rn-WC for qemu-devel@nongnu.org; Sun, 15 Mar 2020 20:04:22 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:46703 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jDdEt-0001Oi-Qs for qemu-devel@nongnu.org; Sun, 15 Mar 2020 20:04:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584317053; 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=ddEZPCXoZ/JJwclVnylPamC5y16AdeWmnXaUuY275K4=; b=LMgCKsd9Pati0OtPKdPKq/EZhKSElZDbjpFVurYiRbfELnzArdAY/+9KNOU1PJK8iRdcef 4Fy+gWVTUvaf58fpdOjzQH+oliSMxWxNlIevotkX3+ahx1d6GiRRAjT5/PrgVtg4/XvbYK SCwc4QutszXE6KOOtWBkTJWd7jHwZaw= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-139-bUplY67hOcWQtT9cZA6ruQ-1; Sun, 15 Mar 2020 20:04:12 -0400 X-MC-Unique: bUplY67hOcWQtT9cZA6ruQ-1 Received: by mail-wm1-f69.google.com with SMTP id y7so5030297wmd.4 for ; Sun, 15 Mar 2020 17:04:11 -0700 (PDT) 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=u3sG3DGW9hNabk2FFKm+3ce53WBbirexmD/101s1zcw=; b=q52oVSdUv4f9mFIIh8xUTjbmz+kZym1PcdJ2hvnFcAh3DVz6amrDmY5CZ5m3awsjgT wCgNA+F9j/GcDSLw9KUoaoPmtbyi06P6qLaP632wR3cLBYu6dd7FfUV12FUGoPEG/yCq Mvc/kTfOmo5Hply+JWztio30h620SbQ7CSbJo0YBsTSLaghnlesbHjvBFEmRQDBrhTbA u4OMIXUABOxLBTpP35ZAdq14w137MD9UYygL4ZRJjyD9++EPlZCPiJ1oa1qjCyx1MypE 1j6pTfqVLvZvzaZ/w5ACK/VZyuAWJ9NfqiYXo5eazq/sNNYdvvlYcxdjF2WnW5l9270i GZJw== X-Gm-Message-State: ANhLgQ36uUyNabEj1TFZUdU6LPlOCr/fUueTMx3zHXjwEn4yGmUpNgv1 wCUa8rCsI418Z6YbtlDtpuHdFYoYxcsVtF6AGxV/CMzQAcOySkLLOBLvXQQYaJCZqNDhpLNgpqf BT1X8nsNUpquVnJE= X-Received: by 2002:a1c:f21a:: with SMTP id s26mr24064644wmc.39.1584317050608; Sun, 15 Mar 2020 17:04:10 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtQZLB6MP+S7/5gnyZNa3D57/+K7FrKQ9lMWEQIEr+7YBs6WQo2VJi5RL2DNqPAYbxqe0LEoQ== X-Received: by 2002:a1c:f21a:: with SMTP id s26mr24064596wmc.39.1584317050293; Sun, 15 Mar 2020 17:04:10 -0700 (PDT) Received: from localhost.localdomain (191.red-83-42-66.dynamicip.rima-tde.net. [83.42.66.191]) by smtp.gmail.com with ESMTPSA id c85sm28373383wmd.48.2020.03.15.17.04.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Mar 2020 17:04:09 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 3/8] qapi/misc: Restrict balloon-related commands to machine code Date: Mon, 16 Mar 2020 01:03:43 +0100 Message-Id: <20200316000348.29692-4-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200316000348.29692-1-philmd@redhat.com> References: <20200316000348.29692-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Ben Warren , "Michael S. Tsirkin" , Ronnie Sahlberg , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Peter Lieven , "Dr. David Alan Gilbert" , Max Reitz , Paolo Bonzini , Igor Mammedov , qemu-block@nongnu.org, Markus Armbruster , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- qapi/machine.json | 83 ++++++++++++++++++++++++++++++++++++++ qapi/misc.json | 83 -------------------------------------- include/sysemu/balloon.h | 2 +- balloon.c | 2 +- hw/virtio/virtio-balloon.c | 2 +- monitor/hmp-cmds.c | 1 + 6 files changed, 87 insertions(+), 86 deletions(-) diff --git a/qapi/machine.json b/qapi/machine.json index 07ffc07ba2..c096efbea3 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -915,3 +915,86 @@ 'data': 'NumaOptions', 'allow-preconfig': true } + +## +# @balloon: +# +# Request the balloon driver to change its balloon size. +# +# @value: the target size of the balloon in bytes +# +# Returns: - Nothing on success +# - If the balloon driver is enabled but not functional because the 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 balloon +# size independent of this command. +# +# Since: 0.14.0 +# +# Example: +# +# -> { "execute": "balloon", "arguments": { "value": 536870912 } } +# <- { "return": {} } +# +## +{ 'command': 'balloon', 'data': {'value': 'int'} } + +## +# @BalloonInfo: +# +# Information about the guest balloon device. +# +# @actual: the number of bytes the balloon currently contains +# +# 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 the 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: actual level of the guest memory balloon in bytes +# +# 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 2725d835ad..ed28e41229 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -186,63 +186,6 @@ { 'command': 'query-iothreads', 'returns': ['IOThreadInfo'], 'allow-preconfig': true } -## -# @BalloonInfo: -# -# Information about the guest balloon device. -# -# @actual: the number of bytes the balloon currently contains -# -# 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 the 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: actual level of the guest memory balloon in bytes -# -# 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: # @@ -751,32 +694,6 @@ ## { 'command': 'inject-nmi' } -## -# @balloon: -# -# Request the balloon driver to change its balloon size. -# -# @value: the target size of the balloon in bytes -# -# Returns: - Nothing on success -# - If the balloon driver is enabled but not functional because the 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 balloon -# size independent of this command. -# -# Since: 0.14.0 -# -# Example: -# -# -> { "execute": "balloon", "arguments": { "value": 536870912 } } -# <- { "return": {} } -# -## -{ 'command': 'balloon', 'data': {'value': 'int'} } - ## # @human-monitor-command: # diff --git a/include/sysemu/balloon.h b/include/sysemu/balloon.h index aea0c44985..b3de4b92b9 100644 --- a/include/sysemu/balloon.h +++ b/include/sysemu/balloon.h @@ -15,7 +15,7 @@ #define QEMU_BALLOON_H #include "exec/cpu-common.h" -#include "qapi/qapi-types-misc.h" +#include "qapi/qapi-types-machine.h" typedef void (QEMUBalloonEvent)(void *opaque, ram_addr_t target); typedef void (QEMUBalloonStatus)(void *opaque, BalloonInfo *info); diff --git a/balloon.c b/balloon.c index f104b42961..ee9c59252d 100644 --- a/balloon.c +++ b/balloon.c @@ -30,7 +30,7 @@ #include "sysemu/balloon.h" #include "trace-root.h" #include "qapi/error.h" -#include "qapi/qapi-commands-misc.h" +#include "qapi/qapi-commands-machine.h" #include "qapi/qmp/qerror.h" static QEMUBalloonEvent *balloon_event_fn; diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index a4729f7fc9..07ad36b143 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 58724031ea..97cd340b2e 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" From patchwork Mon Mar 16 00:03:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 11439557 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9FFFF913 for ; Mon, 16 Mar 2020 01:03:11 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 714A820674 for ; Mon, 16 Mar 2020 01:03:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="HYkUF8PO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 714A820674 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:60986 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDe9u-0004EC-7Y for patchwork-qemu-devel@patchwork.kernel.org; Sun, 15 Mar 2020 21:03:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50254) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDdF1-0005aP-Lj for qemu-devel@nongnu.org; Sun, 15 Mar 2020 20:04:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jDdF0-0001eh-FY for qemu-devel@nongnu.org; Sun, 15 Mar 2020 20:04:23 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:34866 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jDdF0-0001Yu-7k for qemu-devel@nongnu.org; Sun, 15 Mar 2020 20:04:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584317059; 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=0EBS/JGM5sdypwmOBkqVZGaFaD89p2CN4vt6aH7d1PA=; b=HYkUF8POkf4q6e+Ob425IrJsNW7nK0DTkGJ3kyEEeDDqQwBig/3QvEta3wz5pqSv5hbRJh hHq7sPB177ojCinBKqzJtacm5mR0qnoQMgLpWllZosHszEhQC514k88X+Ma7hk4bkIgM3D 5nGqutoxLscJVqadIQU00t2oK+5K0rg= 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-426-WL07sWO3NtGxl3gx28tsnA-1; Sun, 15 Mar 2020 20:04:18 -0400 X-MC-Unique: WL07sWO3NtGxl3gx28tsnA-1 Received: by mail-wr1-f69.google.com with SMTP id g4so481493wrv.12 for ; Sun, 15 Mar 2020 17:04:17 -0700 (PDT) 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=sZKHWj2M/9wdQufG5pPSxGofUinM5PxKM5oyG6rDjBQ=; b=HRuy51KreoUYE5YDRDLc5tc2+6GDcq5rPQizZga6G4kVvSpHGx6uR8v3G4RjLJ0uAF a1vgBrrlrmtq75USm4SNrpY8fdfz7vyjHTCACywIB1/IUfgN9OU4uufbDgFvRlc+92gT KyejGQjkk/tqAovZEyX6LOcTrFC+pegomN6hEnuQMfdQYBu/jYdm+DNHmoKRtqtzUnuI YC7Ul0kj2l4MPFfWzOMUFcq3ymN+iSvVz2V5z0eaBpgkBQ4Lnm6FBIMEURHhtvVsOxaN Iipif6o7YoVPgaEfTk6t0BFAGfRBLPqy9M4y8P5/LOgZ6zAjGsuL6b9MmpQI8CrtcYdI R1NQ== X-Gm-Message-State: ANhLgQ2lJ0q1DDYUCAkVwVTxdDF8q6rRwMvn6BB4jhKe6OO80k3zp6Gj P+6EReNu3Vpp2bzyg1FzS3NBFdZJWqXD7hC5jZWBjLp1FblSmqX6TJujkat591P3iCugfsm/+Mw 12YWljim7rC4PiME= X-Received: by 2002:adf:f14a:: with SMTP id y10mr31395212wro.325.1584317056472; Sun, 15 Mar 2020 17:04:16 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtKqvx1pofLFsHgi5e88usg+4x+zLxOwr4aI+pcqFQa++Zv752HeSdlfFwcnF913ImMvHJEHw== X-Received: by 2002:adf:f14a:: with SMTP id y10mr31395185wro.325.1584317056249; Sun, 15 Mar 2020 17:04:16 -0700 (PDT) Received: from localhost.localdomain (191.red-83-42-66.dynamicip.rima-tde.net. [83.42.66.191]) by smtp.gmail.com with ESMTPSA id n1sm46775573wrj.77.2020.03.15.17.04.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Mar 2020 17:04:15 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 4/8] qapi/misc: Move query-uuid command with block code Date: Mon, 16 Mar 2020 01:03:44 +0100 Message-Id: <20200316000348.29692-5-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200316000348.29692-1-philmd@redhat.com> References: <20200316000348.29692-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.61 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Ben Warren , "Michael S. Tsirkin" , Ronnie Sahlberg , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Peter Lieven , "Dr. David Alan Gilbert" , Max Reitz , Paolo Bonzini , Igor Mammedov , qemu-block@nongnu.org, Markus Armbruster , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- qapi/block-core.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/block-core.json b/qapi/block-core.json index 91586fb1fb..5c3fa6c5d0 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -5415,3 +5415,33 @@ { 'command': 'blockdev-snapshot-delete-internal-sync', 'data': { 'device': 'str', '*id': 'str', '*name': 'str'}, 'returns': 'SnapshotInfo' } + +## +# @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 } diff --git a/qapi/misc.json b/qapi/misc.json index ed28e41229..f70025f34c 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -97,36 +97,6 @@ ## { 'command': 'query-kvm', 'returns': 'KvmInfo' } -## -# @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 682abd8e09..68ed5cf3f8 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-block-core.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 67f182fa3a..9ef75fdae4 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-block-core.h" #include "qemu/uuid.h" UuidInfo *qmp_query_uuid(Error **errp) From patchwork Mon Mar 16 00:03:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 11439553 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E75131667 for ; Mon, 16 Mar 2020 00:56:14 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BDD5C205C9 for ; Mon, 16 Mar 2020 00:56:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ddvGLv8d" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BDD5C205C9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:60924 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDe3B-00018i-MV for patchwork-qemu-devel@patchwork.kernel.org; Sun, 15 Mar 2020 20:56:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50398) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDdF9-0005em-1a for qemu-devel@nongnu.org; Sun, 15 Mar 2020 20:04:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jDdF5-0002F0-TI for qemu-devel@nongnu.org; Sun, 15 Mar 2020 20:04:30 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:42326 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jDdF5-0002Du-Oi for qemu-devel@nongnu.org; Sun, 15 Mar 2020 20:04:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584317067; 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=5c3AP4dCqr/JYmuW7VACTlM9zAn3OSBe4Qe02woopcU=; b=ddvGLv8d5g7gUHE5i0U+y7+9nzWwgmOhP6sOyoPNIDgYjJYg0WzoPIvao//5RZHAM3mEm7 HNpeQFE2QF6rIYp2sTXYPJdOdmeHlt4sZh0A5szagjUDHS+eo+IS7T6Kf936REbSU0tabf rTRKjltxHnQcnQermL42UJN0PGrvBzs= 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-28-T1XuSAnXM3KCIwejvaVLGw-1; Sun, 15 Mar 2020 20:04:25 -0400 X-MC-Unique: T1XuSAnXM3KCIwejvaVLGw-1 Received: by mail-wr1-f71.google.com with SMTP id b11so8114713wru.21 for ; Sun, 15 Mar 2020 17:04:25 -0700 (PDT) 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=As7NmJnDnIsu20eII7dWc1UjdLn2Uy7aENYZvKmI5xw=; b=D2YCO2wc/aeAZ2wJB43m3XDXSZK6ZYvTN2z5z6mb1FMKlgbp70ii9deMIJvF83YqMm D7ZKmnkGNRFdL+4u2DN4lAVkRdiRyujFROMEoJflBaB9wlpKnxROId864N1E0huCgTLl eogGtJ5FYBRt1TeoDWTp0fDw6ZXPPPFcRGDahec5bzeH7h2zr8PTiK9PB0R0PlAIRFsF HvcPPBf3a+UKOKUDmUPLVhQ7aU++z4/p6gIVXoqbQmRNe3zuMUqiuiMvFQQSPQ8n2h6I ZtRa84dN2TqhI+za/ObhdL4LuQi2s7xbYSkhQ6ilEYUtWWyG6MirCsA8Su2DreLNCF8+ udmQ== X-Gm-Message-State: ANhLgQ3csy/5n/XCtlLOhJB2If6bqJ3VtEmFSrzzOqu+GTX/pZG7IKk3 Vekqh0wT+kXRKpC8xHMYP1U6eDmgH6Z8XT3Yc7RBLQ39TTneXAHTP7x3Bc262zVk9DP7bbI0XcT iPVemlDfDgYSp2Bw= X-Received: by 2002:a7b:c62a:: with SMTP id p10mr22230589wmk.46.1584317062935; Sun, 15 Mar 2020 17:04:22 -0700 (PDT) X-Google-Smtp-Source: ADFU+vttvp5kRhN9QfKl14vBeBOqKErrdHavGr80+m6zOl/+lfkEiMTtgrSQO19sW/NdCLzx3/kFTQ== X-Received: by 2002:a7b:c62a:: with SMTP id p10mr22230559wmk.46.1584317062758; Sun, 15 Mar 2020 17:04:22 -0700 (PDT) Received: from localhost.localdomain (191.red-83-42-66.dynamicip.rima-tde.net. [83.42.66.191]) by smtp.gmail.com with ESMTPSA id j15sm52742816wrp.85.2020.03.15.17.04.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Mar 2020 17:04:21 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 5/8] qapi/misc: Restrict query-vm-generation-id command to machine code Date: Mon, 16 Mar 2020 01:03:45 +0100 Message-Id: <20200316000348.29692-6-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200316000348.29692-1-philmd@redhat.com> References: <20200316000348.29692-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Ben Warren , "Michael S. Tsirkin" , Ronnie Sahlberg , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Peter Lieven , "Dr. David Alan Gilbert" , Max Reitz , Paolo Bonzini , Igor Mammedov , qemu-block@nongnu.org, Markus Armbruster , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé Acked-by: Igor Mammedov --- 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 c096efbea3..1a2a4b0d48 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -415,6 +415,26 @@ ## { 'command': 'query-target', 'returns': 'TargetInfo' } +## +# @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 f70025f34c..8c02870227 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -1383,24 +1383,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 2df7623d74..2b26bacaf8 100644 --- a/hw/acpi/vmgenid.c +++ b/hw/acpi/vmgenid.c @@ -12,7 +12,7 @@ #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 568e42b064..bfad656c6c 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" GuidInfo *qmp_query_vm_generation_id(Error **errp) From patchwork Mon Mar 16 00:03:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 11439551 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F277C1667 for ; Mon, 16 Mar 2020 00:53:55 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B7FE9205C9 for ; Mon, 16 Mar 2020 00:53:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="gp60lUOF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B7FE9205C9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:60906 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDe0w-000076-Je for patchwork-qemu-devel@patchwork.kernel.org; Sun, 15 Mar 2020 20:53:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50449) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDdFH-0005gP-TJ for qemu-devel@nongnu.org; Sun, 15 Mar 2020 20:04:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jDdFC-0002iY-QM for qemu-devel@nongnu.org; Sun, 15 Mar 2020 20:04:38 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:56840 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jDdFC-0002a1-LN for qemu-devel@nongnu.org; Sun, 15 Mar 2020 20:04:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584317073; 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=aUztEG8VJUK8KWRteiatLwJDnt0GxjjutgLn6qrxOy8=; b=gp60lUOFm1XeUlBLIhXlMynO24EzB0ODlcT09Qk+IQerbIMikiQ9jUozboaskqqg0ScY1b AkFg5xx1ps13Thq8htJoFuPmTCTeTkFYNNd4gmNFc/aUzYYGnpbRirxM+7winc/AOtGEdm DYjQknmzoKNL0vBrXtWAbNVAzoEAUsw= 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-7-eHmG2mCRNpqC61gyVFkbng-1; Sun, 15 Mar 2020 20:04:30 -0400 X-MC-Unique: eHmG2mCRNpqC61gyVFkbng-1 Received: by mail-wr1-f69.google.com with SMTP id l16so7416812wrr.6 for ; Sun, 15 Mar 2020 17:04:30 -0700 (PDT) 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=wzIoCKZqybQh2QBuwEmmWMnz4Gia6mWJaIuM3SrKfJk=; b=S9/QdPd1gVSz1Pd0KBI5lnypURMHzOXyYCXv9+LPCwoSlrfeIbniGTVOtUH8PXm+vy 6qGlcyz03XSWJFmOuTmdwAgPpETnel037JXnWZLbOB80ihA8DmH4L74gnTBYR9/EFEVh voxQX93j47pYXANX0Dj8K0/jrU6dirwyHRCwv9tPcsRwN0VsTVpj+panSQghvjykMUig cHLFN+PsWeZscJiywCgX3PSmXDfGLIbJT8iE1Av59vy4AaI917BL9hYT21Odnsc2wW2q tE+YnG56vzw3jEoJUDavZ12v91CbBCRqtPUcIs97db7rCJa62I8Lk6oQ/mXLgWRczD/5 aSZw== X-Gm-Message-State: ANhLgQ2t6uNHzcdW+WbNgdJjqLmXgj/5Ktn1aEVbs83DxKZBIuCVxRWr 3uRhTGsHHwC9XMbbKIYUYu698CmSAxsG8+WIiu6NXUvHZJM/xZhkRlIMyPdofsf7BWRPzJufHtE UV/uzzsQOmt8wILc= X-Received: by 2002:a5d:698c:: with SMTP id g12mr24837168wru.382.1584317069365; Sun, 15 Mar 2020 17:04:29 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuwwoy4MA2ji05p6h7mlXLGYYea5kdEt5m2lDqqCkvHW/L3Dj7lqqZs/YB962cYN1C7R2fgew== X-Received: by 2002:a5d:698c:: with SMTP id g12mr24837133wru.382.1584317068967; Sun, 15 Mar 2020 17:04:28 -0700 (PDT) Received: from localhost.localdomain (191.red-83-42-66.dynamicip.rima-tde.net. [83.42.66.191]) by smtp.gmail.com with ESMTPSA id w16sm58132908wrp.8.2020.03.15.17.04.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Mar 2020 17:04:28 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 6/8] qapi/misc: Restrict ACPI commands to machine code Date: Mon, 16 Mar 2020 01:03:46 +0100 Message-Id: <20200316000348.29692-7-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200316000348.29692-1-philmd@redhat.com> References: <20200316000348.29692-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Ben Warren , "Michael S. Tsirkin" , Ronnie Sahlberg , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Peter Lieven , "Dr. David Alan Gilbert" , Max Reitz , Paolo Bonzini , Igor Mammedov , qemu-block@nongnu.org, Markus Armbruster , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé Acked-by: Igor Mammedov --- qapi/machine.json | 154 +++++++++++++++++++++++++++ qapi/misc.json | 154 --------------------------- include/hw/acpi/acpi_dev_interface.h | 2 +- hw/acpi/core.c | 2 +- hw/acpi/cpu.c | 2 +- hw/acpi/memory_hotplug.c | 2 +- 6 files changed, 158 insertions(+), 158 deletions(-) diff --git a/qapi/machine.json b/qapi/machine.json index 1a2a4b0d48..f77ee63730 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -1018,3 +1018,157 @@ ## { 'event': 'BALLOON_CHANGE', 'data': { 'actual': 'int' } } + +## +# @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 specified +# by any one of them is loaded and concatenated in order. If both are omitted, +# @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 address +# 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 field +# excludes @data. +# +# @data: colon (:) separated list of pathnames to load and +# concatenate as table data. The resultant binary blob must not have an +# ACPI table header. At least one file is required. This field excludes +# @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' }} + +## +# @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: +# +# @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", "source": 1, "status": 0}, +# { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0}, +# { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0}, +# { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 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 8c02870227..3d9d7327fe 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -999,64 +999,6 @@ ## { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] } -## -# @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 specified -# by any one of them is loaded and concatenated in order. If both are omitted, -# @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 address -# 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 field -# excludes @data. -# -# @data: colon (:) separated list of pathnames to load and -# concatenate as table data. The resultant binary blob must not have an -# ACPI table header. At least one file is required. This field excludes -# @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: # @@ -1249,102 +1191,6 @@ ## { 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] } -## -# @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: -# -# @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", "source": 1, "status": 0}, -# { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0}, -# { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0}, -# { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 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/include/hw/acpi/acpi_dev_interface.h b/include/hw/acpi/acpi_dev_interface.h index a2a12af9b9..a1b63d51db 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 -#include "qapi/qapi-types-misc.h" +#include "qapi/qapi-types-machine.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 45cbed49ab..4f8d90f50b 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-machine.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 e2c957ce00..8be15db96d 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-machine.h" #include "trace.h" #include "sysemu/numa.h" diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c index 8d2e82240f..aa454f5cb2 100644 --- a/hw/acpi/memory_hotplug.c +++ b/hw/acpi/memory_hotplug.c @@ -7,7 +7,7 @@ #include "migration/vmstate.h" #include "trace.h" #include "qapi/error.h" -#include "qapi/qapi-events-misc.h" +#include "qapi/qapi-events-machine.h" #define MEMORY_SLOTS_NUMBER "MDNR" #define MEMORY_HOTPLUG_IO_REGION "HPMR" From patchwork Mon Mar 16 00:03:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 11439555 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AD299913 for ; Mon, 16 Mar 2020 01:02:42 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2872E20674 for ; Mon, 16 Mar 2020 01:02:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="KI1UzsM0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2872E20674 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:60980 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDe9Q-0003yG-KN for patchwork-qemu-devel@patchwork.kernel.org; Sun, 15 Mar 2020 21:02:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50559) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDdFN-0005k5-K4 for qemu-devel@nongnu.org; Sun, 15 Mar 2020 20:04:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jDdFK-000350-7B for qemu-devel@nongnu.org; Sun, 15 Mar 2020 20:04:45 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:31319 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jDdFK-0002mO-1f for qemu-devel@nongnu.org; Sun, 15 Mar 2020 20:04:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584317079; 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=y/VEFYl0RQvHfKy+Dn7WzLe0iVpID960N2BQ0clYIfg=; b=KI1UzsM0+rCxBaHf6IeszpOEjMf3K40iTxdwqzRlErF8iST5g4iymjEcQXXcCmxhH7x+zA dmpXcvPxfueKqbGFv65u3wGBkXXFdCqxZz0jhvfi5P/COH72BGM7LECdvvGM6mfYe8SFdC 0WsYGtzHyp9FboT9CL3L+oHgHK17MfU= 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-484--8a40VDHMt2Hy76qFyCNNw-1; Sun, 15 Mar 2020 20:04:38 -0400 X-MC-Unique: -8a40VDHMt2Hy76qFyCNNw-1 Received: by mail-wr1-f71.google.com with SMTP id w11so8131433wrp.20 for ; Sun, 15 Mar 2020 17:04:37 -0700 (PDT) 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=1xADMr4RCx+48JMEC9UDVoGo17TcDnWAZGnWNHLeRHM=; b=QwONGCEgn4FwfhbF6LhxD3uD0cI3LBSc2ns7uiFkMO7se38HTnZfaxmCc9Z8iF4aNS 2YKE/xkAzXcLcpuZIWBUN0MOIbXic2Cnyt/m/4jp+CFZ/i9/h4Ug8H9F7TwOy68sm3D9 MgshuQNnfI4G10By1qHdaW6zNu8MlFqTjyDoG+1opTXJhQ8Ei2CGm36e101XPGzP0N6z ELwrTPl6EEJXReld+TA7C8mttXOxYi34/khh1Jx9v0B4woUUNj25gtYDkia7mRGI9LkP 4WSm06xxeTcz4cNu2ob+N3Js9k8dQeSU5AfYFLL+w+GgOEH7HVRElhbWiLnmiVC/Y9jS cwBA== X-Gm-Message-State: ANhLgQ18USTqUaUGpac3v5XZZ8mCqoSVvBCPRw6JRAUDSQ2oiajt3ubf skBLLv5xY8EXwxEsi4spXdRPSuPs7KGF2dkWUMBGn2h6VqwwC/4QOVywZutd7kpp2xPbgrmS5Hz TiSNC09IiWN6y3ck= X-Received: by 2002:a5d:4a0c:: with SMTP id m12mr7662834wrq.246.1584317075390; Sun, 15 Mar 2020 17:04:35 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuuibXYvtuVX4VCT/HPTRhvOccWP3qZoYWYDd6TJ0VakuZI2QXZ0bn/Gg/Tc+iX+1NDeKGzdw== X-Received: by 2002:a5d:4a0c:: with SMTP id m12mr7662797wrq.246.1584317074960; Sun, 15 Mar 2020 17:04:34 -0700 (PDT) Received: from localhost.localdomain (191.red-83-42-66.dynamicip.rima-tde.net. [83.42.66.191]) by smtp.gmail.com with ESMTPSA id h16sm4392017wrr.48.2020.03.15.17.04.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Mar 2020 17:04:34 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 7/8] qapi/misc: Restrict PCI commands to machine code Date: Mon, 16 Mar 2020 01:03:47 +0100 Message-Id: <20200316000348.29692-8-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200316000348.29692-1-philmd@redhat.com> References: <20200316000348.29692-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Ben Warren , "Michael S. Tsirkin" , Ronnie Sahlberg , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Peter Lieven , "Dr. David Alan Gilbert" , Max Reitz , Paolo Bonzini , Igor Mammedov , qemu-block@nongnu.org, Markus Armbruster , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- qapi/machine.json | 304 ++++++++++++++++++++++++++++++++++++++++++++++ qapi/misc.json | 304 ---------------------------------------------- hw/pci/pci-stub.c | 2 +- hw/pci/pci.c | 2 +- 4 files changed, 306 insertions(+), 306 deletions(-) diff --git a/qapi/machine.json b/qapi/machine.json index f77ee63730..33b259dbd0 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -1172,3 +1172,307 @@ ## { 'event': 'ACPI_DEVICE_OST', 'data': { 'info': 'ACPIOSTInfo' } } + +## +# @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 +# +# @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', '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/misc.json b/qapi/misc.json index 3d9d7327fe..92b3926c6b 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -156,310 +156,6 @@ { 'command': 'query-iothreads', 'returns': ['IOThreadInfo'], 'allow-preconfig': true } -## -# @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 -# -# @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', '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/hw/pci/pci-stub.c b/hw/pci/pci-stub.c index cc2a2e1f73..b50c7ca590 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-machine.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 e1ed6677e1..5ebc783d57 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-machine.h" #include "qemu/cutils.h" //#define DEBUG_PCI From patchwork Mon Mar 16 00:03:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 11439567 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CC6976CA for ; Mon, 16 Mar 2020 01:12:21 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A102A205ED for ; Mon, 16 Mar 2020 01:12:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="JyHHeVCf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A102A205ED Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:32812 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDeIm-0007XK-6T for patchwork-qemu-devel@patchwork.kernel.org; Sun, 15 Mar 2020 21:12:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50599) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDdFT-0005ks-1k for qemu-devel@nongnu.org; Sun, 15 Mar 2020 20:04:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jDdFN-0003IB-G5 for qemu-devel@nongnu.org; Sun, 15 Mar 2020 20:04:50 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:45324 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jDdFN-0003Bq-8K for qemu-devel@nongnu.org; Sun, 15 Mar 2020 20:04:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584317084; 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=kSh5HoQ2HP/bpMvJmKuLd5vzLqwxyfd2+5uuLQ6RMk4=; b=JyHHeVCfRQkGYbjBQjQwcgu8lT3zZzifj6N6a1rpp4lj1t17zw7aMecvJ8OsyzJwPFB00q tjxZ9zxoQpH9b6yeUcwAhmIDA+hzVXekXN4J4eqkjuzOGVWhLuDkRxg2cxSUre53sOpYhp 4+KLpd3vBN/34yhHF919thvSAzk2otc= 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-423-NMSmERmHM-GSJxy905f0Wg-1; Sun, 15 Mar 2020 20:04:43 -0400 X-MC-Unique: NMSmERmHM-GSJxy905f0Wg-1 Received: by mail-wr1-f70.google.com with SMTP id 94so3453482wrr.3 for ; Sun, 15 Mar 2020 17:04:42 -0700 (PDT) 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=MrODmaUPfAfPyvIBCVZWlg54XWWY0gwd21509zmLD2c=; b=MC/PXoPt/npF6flY69AnhgqT3d8MZQ5lF06r9Sdu1x+p1AJGKe+Jwfplmp9Z5QPuc8 KaD0l5DVZKJkTDkPfKgRDs3AiOb/Wja205+abEuoUY2okqw05P0ecGZuL+7nPQ4Ra31M QDESMujWQIsi0r173pJQsWfendPFc5FsPBBmFJJHiBngyE5eNGMXqCGYw+YKVjk1aB2L qzoPE1XTDXEkhYHxF47v6pQZqzC0zqE+EhgC+LTXXqZFAQom9fxjnZrgZjVFUxdDLuqt KNyN8dukT5Igv5ANNlhkO0EnUpitDVBdJSOhr4QTWqIhuIFH+USQpOEs2UZJEZ+UUn9Z GG9A== X-Gm-Message-State: ANhLgQ3QRyPg+RFHMHl77n0kt+csqQHB+eH3BFRW790aviTSphkvW48+ afQtDg9Gwyk8fkiWyd8gLVnwEKtK2qp0IbMWvHfKAe4f+nIbNCFI56e+ivoOOmYcFAnkt3BuMAo 700FTtSfP0ArOEgo= X-Received: by 2002:a5d:68c1:: with SMTP id p1mr18834139wrw.198.1584317081485; Sun, 15 Mar 2020 17:04:41 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtgoYq5wFlDY0FTx/2yvK+DFV/jqMLigcu32uqZ0F70xcb72i3Ba1JBEe+Vt6ddebR0yuZyQg== X-Received: by 2002:a5d:68c1:: with SMTP id p1mr18834097wrw.198.1584317081153; Sun, 15 Mar 2020 17:04:41 -0700 (PDT) Received: from localhost.localdomain (191.red-83-42-66.dynamicip.rima-tde.net. [83.42.66.191]) by smtp.gmail.com with ESMTPSA id s15sm73335029wrr.45.2020.03.15.17.04.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Mar 2020 17:04:40 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 8/8] qapi/misc: Restrict device memory commands to machine code Date: Mon, 16 Mar 2020 01:03:48 +0100 Message-Id: <20200316000348.29692-9-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200316000348.29692-1-philmd@redhat.com> References: <20200316000348.29692-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Ben Warren , "Michael S. Tsirkin" , Ronnie Sahlberg , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Peter Lieven , "Dr. David Alan Gilbert" , Max Reitz , Paolo Bonzini , Igor Mammedov , qemu-block@nongnu.org, Markus Armbruster , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé Acked-by: Igor Mammedov --- qapi/machine.json | 131 +++++++++++++++++++++++++++++++ qapi/misc.json | 132 -------------------------------- include/hw/mem/memory-device.h | 1 + include/hw/virtio/virtio-pmem.h | 2 +- 4 files changed, 133 insertions(+), 133 deletions(-) diff --git a/qapi/machine.json b/qapi/machine.json index 33b259dbd0..17ccebda14 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -1476,3 +1476,134 @@ # ## { 'command': 'query-pci', 'returns': ['PciInfo'] } + +## +# @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' + } +} + +## +# @MemoryDeviceInfo: +# +# Union containing information about a memory device +# +# nvdimm is included since 2.12. virtio-pmem is included since 4.1. +# +# Since: 2.1 +## +{ 'union': 'MemoryDeviceInfo', + 'data': { 'dimm': 'PCDIMMDeviceInfo', + 'nvdimm': 'PCDIMMDeviceInfo', + 'virtio-pmem': 'VirtioPMEMDeviceInfo' + } +} + +## +# @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'] } diff --git a/qapi/misc.json b/qapi/misc.json index 92b3926c6b..670b902999 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -518,39 +518,6 @@ ## { 'command': 'closefd', 'data': {'fdname': 'str'} } -## -# @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: # @@ -788,105 +755,6 @@ 'returns': ['CommandLineOptionInfo'], 'allow-preconfig': true } -## -# @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' - } -} - -## -# @MemoryDeviceInfo: -# -# Union containing information about a memory device -# -# nvdimm is included since 2.12. virtio-pmem is included since 4.1. -# -# Since: 2.1 -## -{ 'union': 'MemoryDeviceInfo', - 'data': { 'dimm': 'PCDIMMDeviceInfo', - 'nvdimm': 'PCDIMMDeviceInfo', - 'virtio-pmem': 'VirtioPMEMDeviceInfo' - } -} - -## -# @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'] } - ## # @ReplayMode: # diff --git a/include/hw/mem/memory-device.h b/include/hw/mem/memory-device.h index 04476acb8f..76f3de0f7e 100644 --- a/include/hw/mem/memory-device.h +++ b/include/hw/mem/memory-device.h @@ -14,6 +14,7 @@ #define MEMORY_DEVICE_H #include "hw/qdev-core.h" +#include "qapi/qapi-types-machine.h" #include "qapi/qapi-types-misc.h" #include "qom/object.h" diff --git a/include/hw/virtio/virtio-pmem.h b/include/hw/virtio/virtio-pmem.h index 33f1999320..72863412b2 100644 --- a/include/hw/virtio/virtio-pmem.h +++ b/include/hw/virtio/virtio-pmem.h @@ -15,7 +15,7 @@ #define HW_VIRTIO_PMEM_H #include "hw/virtio/virtio.h" -#include "qapi/qapi-types-misc.h" +#include "qapi/qapi-types-machine.h" #define TYPE_VIRTIO_PMEM "virtio-pmem"