From nobody Thu May 2 10:06:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1584125008; cv=none; d=zohomail.com; s=zohoarc; b=jqoDdIL74OJ5eFBPkj6JssMJXKiFaMBL5AhkT2KHHZtUBwLeENhGW/hX+36qHF1s3TeUg36BjlNJidy1viu+XOX6jl9/0/fCAj/rpg8rNr66wMSD31EGyTdksVNr3PUdly2J2Hh0W1vaOoiC5eNbd1tvFeO4yYNrHy+FQQByLFk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584125008; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=MMbU/diGS00g0pvlpe3jSpRPWqFNO+dtHJ/d6bVgPlQ=; b=N1gRAVVr8bGGJqWM9IjXk/xFqI2k9m5OPPZpf4bBeNzIpIBrzJW0pheYrjW/pj8YaNT3qOBESoGAgcuR/URXsc0IfQaSLtMsnllXalvXUswsSQYExCa0No5BGvI/aqJuJnktzvMGizVUK+aw1wFHNLNIJTeDrjmn+U5dhrZWafw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1584125008225744.3477038184251; Fri, 13 Mar 2020 11:43:28 -0700 (PDT) Received: from localhost ([::1]:35288 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCpHL-00034P-65 for importer@patchew.org; Fri, 13 Mar 2020 14:43:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58974) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCpG3-0000zG-9r for qemu-devel@nongnu.org; Fri, 13 Mar 2020 14:42:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jCpG0-00058v-Rq for qemu-devel@nongnu.org; Fri, 13 Mar 2020 14:42:06 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:56524 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 1jCpG0-00058T-OF for qemu-devel@nongnu.org; Fri, 13 Mar 2020 14:42:04 -0400 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-442-iWtQSEAQNCGwtL-dSBCN-Q-1; Fri, 13 Mar 2020 14:42:02 -0400 Received: by mail-wm1-f70.google.com with SMTP id x7so3305890wmi.4 for ; Fri, 13 Mar 2020 11:42:01 -0700 (PDT) Received: from x1w.redhat.com (47.red-88-21-205.staticip.rima-tde.net. [88.21.205.47]) by smtp.gmail.com with ESMTPSA id o5sm19073133wmb.8.2020.03.13.11.41.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2020 11:41:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584124924; 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=MMbU/diGS00g0pvlpe3jSpRPWqFNO+dtHJ/d6bVgPlQ=; b=G46ggMs8XSW2i//5MqrrsLSH9mZZb8oL2XvPnQL/p9rudW4EC6ckl2cPFr0ixVPeu5CmWj aQxpxjcWxKnkiHXOEz3H2VCDZlaZ0CmU67AicQYswxTHzMJI0xT8KKlUpNQDu4onZsTcRS w8XA16sS2e4LdUQwyGWcUTPY0tHdOAc= X-MC-Unique: iWtQSEAQNCGwtL-dSBCN-Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=egEt2W36eZavUAEYv8kmj5EFYJaBOLSeei+z/jwYPss=; b=Xq2j1aOleR0u0JU0Igq4u+CeDr0niVqLB/P/EXOfA4FaDWpTONqyy/VNBdpDKMpTDc PJFGcdtX0aUYwzRlsCvfXSl6Z1DOKt45s6rckbEfMwbpckzBmlMaIFjxjQDl2+/eZD2v tKE1D2ulhBvzRMQR4fMjtGccM3n1OoKJHmh4L28jVqa3+1AvJMozMavUxJrMfkVmFa9/ 5DdVvS0VGrj8844OkeZu3RyZLlSico1GRvGf0KvBTOlmylc0EKWokxvVIebDiHL8OK0W ZTt37fdXuW+lB4dWPrZO3WFaE0EUKkYwo8HYznnRXHGRQwJ6iMRZk7IBJNsitHtUcqYP 1RtQ== X-Gm-Message-State: ANhLgQ2oPgXu4l3cemFTWCURdUoQEhJ1jMcElzom3H3yeN3XKzlpUrRC MTSBmXnitTegmsWuUa2tDdd7yg50xNYD5xTYHpB1R/xKk0/GoZUzOBZKotRkEClOaetilkklF3E Dfwyd+ha01/WL5WQ= X-Received: by 2002:adf:ee86:: with SMTP id b6mr18621995wro.282.1584124920291; Fri, 13 Mar 2020 11:42:00 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuLrTORgqCfLm8OnZDa2oFWk8qqCpbXRbSvQucYUkye5joO8VbjQT87mi7dwP+py7FOqeYIqg== X-Received: by 2002:adf:ee86:: with SMTP id b6mr18621971wro.282.1584124920037; Fri, 13 Mar 2020 11:42:00 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 1/9] target/i386: Restrict X86CPUFeatureWord to X86 targets Date: Fri, 13 Mar 2020 19:41:45 +0100 Message-Id: <20200313184153.11275-2-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200313184153.11275-1-philmd@redhat.com> References: <20200313184153.11275-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , qemu-block@nongnu.org, "Michael S. Tsirkin" , Markus Armbruster , Ben Warren , Peter Lieven , "Dr. David Alan Gilbert" , Laurent Vivier , Igor Mammedov , Ronnie Sahlberg , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Reitz , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Move out x86-specific structures from generic machine code. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Richard Henderson --- 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. =20 +## +# @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' }} =20 -## -# @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=C3=A9 + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * 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) +=3D hax-all.o hax-mem.o hax-posix.o endif obj-$(CONFIG_HVF) +=3D hvf/ obj-$(CONFIG_WHPX) +=3D whpx-all.o -endif +endif # CONFIG_SOFTMMU obj-$(CONFIG_SEV) +=3D sev.o obj-$(call lnot,$(CONFIG_SEV)) +=3D sev-stub.o +obj-$(call lnot,$(CONFIG_SOFTMMU)) +=3D machine-stub.o --=20 2.21.1 From nobody Thu May 2 10:06:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1584125606; cv=none; d=zohomail.com; s=zohoarc; b=iN9K7huDzi9jgfDlNKUugk6xGO8y9Io88SqjE03aI5hQKfhgxyE8JMvu2T6eJhKkz41MUhblLjqMRyQ52K/2du6jV9G7GBhEbR5xI3CK0RsEdDNqdusMNonTJlTSK+JVzj5DD8Lk6E5IDzDEav+hBhPnhBJoov5aIZR0DDGyRGA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584125606; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=gB6GZqgn898T5lEn2dO+WgYcEg7ajywrV26pIieifgY=; b=AjRrAVtEVOGKF7R8jXMUGjrfLKQybMfZpL+3lcCaBgJZ5diVmS45ukVQsZaHCAtzx+EaLVPqPnAXRpIK1EL8nU0auVNhmq7rZ2DTPblZuGcp8rg4/k8UGtFsHDAUaGlyP8oZN5oyal21mhu6aHcTbWlKbnhfeDSMN5INP6mdCgY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 158412560632454.9121799055024; Fri, 13 Mar 2020 11:53:26 -0700 (PDT) Received: from localhost ([::1]:35574 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCpQz-0002t0-CT for importer@patchew.org; Fri, 13 Mar 2020 14:53:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59034) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCpG8-00015Z-DR for qemu-devel@nongnu.org; Fri, 13 Mar 2020 14:42:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jCpG7-0005DD-7W for qemu-devel@nongnu.org; Fri, 13 Mar 2020 14:42:12 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:43245 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 1jCpG7-0005Bq-32 for qemu-devel@nongnu.org; Fri, 13 Mar 2020 14:42:11 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-355-RPQNmPpNMYiBRpXSDIxj2w-1; Fri, 13 Mar 2020 14:42:07 -0400 Received: by mail-wm1-f71.google.com with SMTP id f9so1729508wme.7 for ; Fri, 13 Mar 2020 11:42:06 -0700 (PDT) Received: from x1w.redhat.com (47.red-88-21-205.staticip.rima-tde.net. [88.21.205.47]) by smtp.gmail.com with ESMTPSA id k18sm30787429wru.94.2020.03.13.11.42.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2020 11:42:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584124930; 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=gB6GZqgn898T5lEn2dO+WgYcEg7ajywrV26pIieifgY=; b=PTVXv2SsdQj8yI2wJ4EvG6UqAnFEdhmjjD68UK6dFE1rTSeAdyFsiIHi+X8XHySLg48cb2 FjdZERQfWAU3i7AhfyArgstI6AU+Ejz2N8M9lEqNU33pNmxtEr657nZEjT3wbF0np0uS1u YW5ClfFSvKN0RulDclkO0Jg+znIwOZs= X-MC-Unique: RPQNmPpNMYiBRpXSDIxj2w-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=o8NYWim6/Yd9aExraYkJVT9nhkAtGbxd6mTZNaLxBUc=; b=UNM+cvT9KmFgaInwNoJHO2e3/lAZfonj99QcHS5yA+WhQrcfX5JjtXGoJ142u84UYL Co4OZqFm6ZSCOGSbFcAM1a7gXYzMrYB3kNcNWVUG0yh4QbrEkDWfV7orPnSXe2otzunC K5bX558rINwc2ChLPYZ3kWVXAO52O/yRjaG1WgFyYMgn+nCJJxJGsS4b0EVEPsCrQfOE TPGD4DbyPiG/j1QXGrjRsjEkJNbPHijpVvkB3Um4f8/YadXMN94A5s/cbz7P86KN7X6+ DJAnenlvZURKh1JzFfEPPr+ggFXuGE6f/Lzcl74Kxq0sUChi5CdvtJQIS+/v9rQyZX5J KIoQ== X-Gm-Message-State: ANhLgQ3CsP9na/NjQmyPZLKpSzkgDX7xanRkupz/Fw/wm6Mj6GPPhRvw pTkraNWW42vfOtQh2j5149eRjEZtKvvmDf4heui0uUA9b55S2Z5dOj3G7zuY4yDOZH+RrEW96q7 pPtLBRpLhm3FkxnE= X-Received: by 2002:a05:600c:2c4a:: with SMTP id r10mr12491412wmg.32.1584124925415; Fri, 13 Mar 2020 11:42:05 -0700 (PDT) X-Google-Smtp-Source: ADFU+vschwfV0QpBwrB08rFODD3V2lE2SuNkAUoFXtgXuLIe7krN99M3zz/hJayDJL70d0loTZ2dQA== X-Received: by 2002:a05:600c:2c4a:: with SMTP id r10mr12491370wmg.32.1584124925123; Fri, 13 Mar 2020 11:42:05 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 2/9] qapi/misc: Move add_client command with chardev code Date: Fri, 13 Mar 2020 19:41:46 +0100 Message-Id: <20200313184153.11275-3-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200313184153.11275-1-philmd@redhat.com> References: <20200313184153.11275-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , qemu-block@nongnu.org, "Michael S. Tsirkin" , Markus Armbruster , Ben Warren , Peter Lieven , "Dr. David Alan Gilbert" , Laurent Vivier , Igor Mammedov , Ronnie Sahlberg , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Reitz , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- qapi/char.json | 32 ++++++++++++++++++++++++++++++++ qapi/misc.json | 32 -------------------------------- monitor/qmp-cmds.c | 1 + 3 files changed, 33 insertions(+), 32 deletions(-) diff --git a/qapi/char.json b/qapi/char.json index 6907b2bfdb..8b7baf11eb 100644 --- a/qapi/char.json +++ b/qapi/char.json @@ -572,3 +572,35 @@ { 'event': 'VSERPORT_CHANGE', 'data': { 'id': 'str', 'open': 'bool' } } + +## +# @add_client: +# +# Allow client connections for VNC, Spice and socket based +# character devices to be passed in to QEMU via SCM_RIGHTS. +# +# @protocol: protocol name. Valid names are "vnc", "spice" or the +# name of a character device (eg. from -chardev id=3DXXXX) +# +# @fdname: file descriptor name previously passed via 'getfd' command +# +# @skipauth: whether to skip authentication. Only applies +# to "vnc" and "spice" protocols +# +# @tls: whether to perform TLS. Only applies to the "spice" +# protocol +# +# Returns: nothing on success. +# +# Since: 0.14.0 +# +# Example: +# +# -> { "execute": "add_client", "arguments": { "protocol": "vnc", +# "fdname": "myclient" } } +# <- { "return": {} } +# +## +{ 'command': 'add_client', + 'data': { 'protocol': 'str', 'fdname': 'str', '*skipauth': 'bool', + '*tls': 'bool' } } diff --git a/qapi/misc.json b/qapi/misc.json index c18fe681fb..e84e6823e9 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -39,38 +39,6 @@ { 'enum': 'LostTickPolicy', 'data': ['discard', 'delay', 'slew' ] } =20 -## -# @add_client: -# -# Allow client connections for VNC, Spice and socket based -# character devices to be passed in to QEMU via SCM_RIGHTS. -# -# @protocol: protocol name. Valid names are "vnc", "spice" or the -# name of a character device (eg. from -chardev id=3DXXXX) -# -# @fdname: file descriptor name previously passed via 'getfd' command -# -# @skipauth: whether to skip authentication. Only applies -# to "vnc" and "spice" protocols -# -# @tls: whether to perform TLS. Only applies to the "spice" -# protocol -# -# Returns: nothing on success. -# -# Since: 0.14.0 -# -# Example: -# -# -> { "execute": "add_client", "arguments": { "protocol": "vnc", -# "fdname": "myclient" } } -# <- { "return": {} } -# -## -{ 'command': 'add_client', - 'data': { 'protocol': 'str', 'fdname': 'str', '*skipauth': 'bool', - '*tls': 'bool' } } - ## # @NameInfo: # diff --git a/monitor/qmp-cmds.c b/monitor/qmp-cmds.c index 864cbfa32e..67d95b4af7 100644 --- a/monitor/qmp-cmds.c +++ b/monitor/qmp-cmds.c @@ -31,6 +31,7 @@ #include "sysemu/block-backend.h" #include "qapi/error.h" #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-misc.h" --=20 2.21.1 From nobody Thu May 2 10:06:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1584125558; cv=none; d=zohomail.com; s=zohoarc; b=h3N7zCP6/cJOugTeKpwjr3TcRwjKo1geMW4T68bEY9CyTKiUGBliv8N6sgb2/nrKxTPjQ/3saIYVJRKdhdPdJ6sRr42Jx7KkdcNp24CzIq0wlaHu0eIwmmRjzGlDc7y90cFLwECzG8ey2NLgmLfX0VH8pr4yn2xudr4lKDD3VO0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584125558; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vTQj/CuraqaEI9qDf4IXecW3ZSVpPZJ56FMzGpZyIT0=; b=APAm6Lxj8tsiuzfbTtDWlTJFaMJXJmBzxEbwh6MSdoii7t8a6soi62Lw1MF1Ct/0gMloBNyo5oF/eOMl/0oXVcVUve7O8QI9iWOgOgRPZU6Y4UppE6577kyF7EPRT4C5Sj6CRRdKDE1UmMDw/XbuMAprWIA+ks2YsMSQ1F6NWus= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1584125558362614.4828165870302; Fri, 13 Mar 2020 11:52:38 -0700 (PDT) Received: from localhost ([::1]:35562 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCpQD-0001WW-9K for importer@patchew.org; Fri, 13 Mar 2020 14:52:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59132) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCpGC-0001FI-TP for qemu-devel@nongnu.org; Fri, 13 Mar 2020 14:42:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jCpGB-0005NV-FC for qemu-devel@nongnu.org; Fri, 13 Mar 2020 14:42:16 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:56964 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 1jCpGB-0005Kq-AA for qemu-devel@nongnu.org; Fri, 13 Mar 2020 14:42:15 -0400 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-404-ppCwk4ZMMdSK-DiKQiX2Jg-1; Fri, 13 Mar 2020 14:42:12 -0400 Received: by mail-wr1-f71.google.com with SMTP id j17so4728530wru.19 for ; Fri, 13 Mar 2020 11:42:11 -0700 (PDT) Received: from x1w.redhat.com (47.red-88-21-205.staticip.rima-tde.net. [88.21.205.47]) by smtp.gmail.com with ESMTPSA id f207sm19637801wme.9.2020.03.13.11.42.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2020 11:42:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584124933; 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=vTQj/CuraqaEI9qDf4IXecW3ZSVpPZJ56FMzGpZyIT0=; b=B6pBjyLyTEUwJqZQVmOh/3FmoxSD1QxZXx1UXGEPTrvYtk4G5khBGFQsM6gn5+g4L38cLV 9/EJnkRZRKpAQcHQb/Jm+YRdbd2xeEYWQJtMK3E05R2ZEUyrryHYHkTo6Y0rw3k3xOJg5A 0mdtIw1AS45OVW6ne5elf5DhXwyF4+Y= X-MC-Unique: ppCwk4ZMMdSK-DiKQiX2Jg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6BA/ayS7bx6RNJ1ANrutCVjpBouFGlBaWUedscA9deQ=; b=GlxSeA3g6vTF2W7jJ+FgZxc+LEYX5ruknH8ba7ku0NmgYu9iSEcWHLSrEO3D1ZyvmV IaqISXHa07pUXF5kQYD6PrbXgDAd8UfgVu+qawQBQrAz0SPJcjd5VZ+kW4s93Wzch7n6 QBKR4L4Ig4HBwAaq/p+N0pATRZ36yqYLTn1wghKjbfBk4LkVVrACi6cg3fdxCjhcWIDZ 7TgGGofTkx2mM63kei3KK4xyZx+pWJftdMkNGEugp7h2phHDNMvn8o7rCVs8Vk3PQZHT cOcdEanymsPWVmmS8PUyHkvtQP3RhkOgYZfgqZhnEtI9OiUV0dFzwd2gvFPuRaPZp7NM F97Q== X-Gm-Message-State: ANhLgQ0PoLE7WXXRP5cKIu8s0k2YH0WiZ04+pFxHRz4dAbx7ee/S6T6e dvIUEiReDB1o3AukVBD3dXVQRVazr8Dqb3FTfeaIx/OYfeDzcB18G3TQjnLfxJfGLTZOyOVt5hy 3YLEyRBSap/7etts= X-Received: by 2002:a5d:4d51:: with SMTP id a17mr1885088wru.285.1584124930482; Fri, 13 Mar 2020 11:42:10 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsPSfJJWGlZeTRLMSIZDbub+F3/I7ELWsUxQYHzbN1CTOauijAugkpIvd3Dl5CCINUMPWZllw== X-Received: by 2002:a5d:4d51:: with SMTP id a17mr1885052wru.285.1584124930178; Fri, 13 Mar 2020 11:42:10 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 3/9] qapi/misc: Restrict LostTickPolicy enum to machine code Date: Fri, 13 Mar 2020 19:41:47 +0100 Message-Id: <20200313184153.11275-4-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200313184153.11275-1-philmd@redhat.com> References: <20200313184153.11275-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , qemu-block@nongnu.org, "Michael S. Tsirkin" , Markus Armbruster , Ben Warren , Peter Lieven , "Dr. David Alan Gilbert" , Laurent Vivier , Igor Mammedov , Ronnie Sahlberg , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Reitz , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- qapi/machine.json | 32 ++++++++++++++++++++++++++++++++ qapi/misc.json | 32 -------------------------------- include/hw/rtc/mc146818rtc.h | 2 +- hw/core/qdev-properties.c | 1 + hw/i386/kvm/i8254.c | 2 +- 5 files changed, 35 insertions(+), 34 deletions(-) diff --git a/qapi/machine.json b/qapi/machine.json index de05730704..07ffc07ba2 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -415,6 +415,38 @@ ## { 'command': 'query-target', 'returns': 'TargetInfo' } =20 +## +# @LostTickPolicy: +# +# Policy for handling lost ticks in timer devices. Ticks end up getting +# lost when, for example, the guest is paused. +# +# @discard: throw away the missed ticks and continue with future injection +# normally. The guest OS will see the timer jump ahead by a +# potentially quite significant amount all at once, as if the +# intervening chunk of time had simply not existed; needless to +# say, such a sudden jump can easily confuse a guest OS which is +# not specifically prepared to deal with it. Assuming the guest +# OS can deal correctly with the time jump, the time in the guest +# and in the host should now match. +# +# @delay: continue to deliver ticks at the normal rate. The guest OS will +# not notice anything is amiss, as from its point of view time will +# have continued to flow normally. The time in the guest should n= ow +# be behind the time in the host by exactly the amount of time dur= ing +# which ticks have been missed. +# +# @slew: deliver ticks at a higher rate to catch up with the missed ticks. +# The guest OS will not notice anything is amiss, as from its point +# of view time will have continued to flow normally. Once the timer +# has managed to catch up with all the missing ticks, the time in +# the guest and in the host should match. +# +# Since: 2.0 +## +{ 'enum': 'LostTickPolicy', + 'data': ['discard', 'delay', 'slew' ] } + ## # @NumaOptionsType: # diff --git a/qapi/misc.json b/qapi/misc.json index e84e6823e9..f827bdc8f6 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -7,38 +7,6 @@ =20 { 'include': 'common.json' } =20 -## -# @LostTickPolicy: -# -# Policy for handling lost ticks in timer devices. Ticks end up getting -# lost when, for example, the guest is paused. -# -# @discard: throw away the missed ticks and continue with future injection -# normally. The guest OS will see the timer jump ahead by a -# potentially quite significant amount all at once, as if the -# intervening chunk of time had simply not existed; needless to -# say, such a sudden jump can easily confuse a guest OS which is -# not specifically prepared to deal with it. Assuming the guest -# OS can deal correctly with the time jump, the time in the guest -# and in the host should now match. -# -# @delay: continue to deliver ticks at the normal rate. The guest OS will -# not notice anything is amiss, as from its point of view time will -# have continued to flow normally. The time in the guest should n= ow -# be behind the time in the host by exactly the amount of time dur= ing -# which ticks have been missed. -# -# @slew: deliver ticks at a higher rate to catch up with the missed ticks. -# The guest OS will not notice anything is amiss, as from its point -# of view time will have continued to flow normally. Once the timer -# has managed to catch up with all the missing ticks, the time in -# the guest and in the host should match. -# -# Since: 2.0 -## -{ 'enum': 'LostTickPolicy', - 'data': ['discard', 'delay', 'slew' ] } - ## # @NameInfo: # 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 =20 -#include "qapi/qapi-types-misc.h" +#include "qapi/qapi-types-machine.h" #include "qemu/queue.h" #include "qemu/timer.h" #include "hw/isa/isa.h" diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 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 @@ =20 #include "qemu/osdep.h" #include -#include "qapi/qapi-types-misc.h" +#include "qapi/qapi-types-machine.h" #include "qapi/error.h" #include "qemu/module.h" #include "qemu/timer.h" --=20 2.21.1 From nobody Thu May 2 10:06:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1584125660; cv=none; d=zohomail.com; s=zohoarc; b=dy7tiPBc1CaXO/DOxtCS7MTcZIWQ9bebG6WNhw+AhCSUrhCrXaCkL6PoNc1mtrqt9UV4oeUYMjAhuMZc0jROJ0M0MGezsof+Woa9qesgY+Yr5W9yJzAshKBXLZpEljsHFmsKX5JokLettX/eD+IVgHV86LoczlbuSXa2lmO/x7A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584125660; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=JokUaNXemH+e02pjR2cVsAOreQCfGYVkBInLDbeWKU0=; b=ACf7IgiEeGh6mKVlPhNS0tGcF8TlS8gMJ8VpBl4aAz/KgjV/riXTGG2J1KUv54YibPRkBD9LJXdRn5VtGGx9SWLRHRtDBtWAT6b15U6VEtG+wvzqxFa6OT6xrhLtNT9LzoXCpqONB6d4bPdOf2Uwq+jWW+vOFgmoBgnPnbGjw1Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1584125660586148.2384697486874; Fri, 13 Mar 2020 11:54:20 -0700 (PDT) Received: from localhost ([::1]:35584 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCpRq-00046X-4z for importer@patchew.org; Fri, 13 Mar 2020 14:54:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59241) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCpGH-0001Ua-KD for qemu-devel@nongnu.org; Fri, 13 Mar 2020 14:42:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jCpGG-0005Wp-1G for qemu-devel@nongnu.org; Fri, 13 Mar 2020 14:42:21 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:37921 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 1jCpGF-0005VE-TY for qemu-devel@nongnu.org; Fri, 13 Mar 2020 14:42:19 -0400 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-144-n0FRUUjWPtuRBQ_c4BYHvg-1; Fri, 13 Mar 2020 14:42:17 -0400 Received: by mail-wr1-f72.google.com with SMTP id x14so4689701wrv.23 for ; Fri, 13 Mar 2020 11:42:16 -0700 (PDT) Received: from x1w.redhat.com (47.red-88-21-205.staticip.rima-tde.net. [88.21.205.47]) by smtp.gmail.com with ESMTPSA id c23sm18325188wme.39.2020.03.13.11.42.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2020 11:42:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584124939; 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=JokUaNXemH+e02pjR2cVsAOreQCfGYVkBInLDbeWKU0=; b=QdbvHBpSRBWmaQTo6uxmOpKGPLcWvcrbVYw6zT3ZV+KBpYbszMKTuzAEbK/0bhfeHLPu3T NLiMEQq3ZYdOd+NtbKfVZwKKzMIEZMUmZr2tH6xA/7WNLRLZQbuunNLXEQ73LwHX67YQAv l59++35d8OcaGzQw4ks2/1cDfQnMkg0= X-MC-Unique: n0FRUUjWPtuRBQ_c4BYHvg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+EZUdVixSOyONgm7Ekn0bMyU5n+tkPuu1vAqJOdo3vQ=; b=oYR8tlbOtZUO3PQA2afE4FpIJpVDFur2n2B3l3WYgS53cLO8mvSuodq875SAq8XtHj AMvjfGu+h19sSiDK4kjvuEiu5PbVBOLxLVSjOXAtygWARz6ssDtyyNRRmFoy3pXxoF+Z HFNCc9oHTV43w6d1cvSVG81k0vURuwvuY8OPc1Ufu+HIKWNRzn6g98ziLQq5/kfV4gQG bU77gqQIrb026pfKOKcYSA61AqlN37nHSNZyshLZz4oJMD+0OOGTWXEeBudi6MLbr5E4 3Flhjmd132RPwQJV1gXxLNh9O9rlWFdXTg07UNTrWwFv65/Y9QwUzCUJuAA5nD+FzDqo RcRA== X-Gm-Message-State: ANhLgQ22FJs9wJxdWbSUVF7y9NGFF+FHq+E1GYm4oVuSMw/Y89VDe+oy nbQumldR/Yk4/hDCluN2ZDhVVm7jZkqVVhyY1c93n1chdjrUpASCeDXPRNIxHSXCe/3vORribVm TyQPDkaKjhskailM= X-Received: by 2002:a1c:ab54:: with SMTP id u81mr7062909wme.166.1584124935482; Fri, 13 Mar 2020 11:42:15 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtz2W40y1WSruy3nOsBZAcb5SulySG1WXeknfOgkzQLCNic0qE4KdC64TLw+MpYiFKDbtU3zw== X-Received: by 2002:a1c:ab54:: with SMTP id u81mr7062880wme.166.1584124935132; Fri, 13 Mar 2020 11:42:15 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 4/9] qapi/misc: Restrict balloon-related commands to machine code Date: Fri, 13 Mar 2020 19:41:48 +0100 Message-Id: <20200313184153.11275-5-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200313184153.11275-1-philmd@redhat.com> References: <20200313184153.11275-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , qemu-block@nongnu.org, "Michael S. Tsirkin" , Markus Armbruster , Ben Warren , Peter Lieven , "Dr. David Alan Gilbert" , Laurent Vivier , Igor Mammedov , Ronnie Sahlberg , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Reitz , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- 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 t= he KVM +# kernel module cannot support it, KvmMissingCap +# - If no balloon device is present, DeviceNotActive +# +# Notes: This command just issues a request to the guest. When it returns, +# the balloon size may not have changed. A guest can change the ba= lloon +# size independent of this command. +# +# Since: 0.14.0 +# +# Example: +# +# -> { "execute": "balloon", "arguments": { "value": 536870912 } } +# <- { "return": {} } +# +## +{ '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 t= he KVM +# kernel module cannot support it, KvmMissingCap +# - If no balloon device is present, DeviceNotActive +# +# Since: 0.14.0 +# +# Example: +# +# -> { "execute": "query-balloon" } +# <- { "return": { +# "actual": 1073741824, +# } +# } +# +## +{ 'command': 'query-balloon', 'returns': 'BalloonInfo' } + +## +# @BALLOON_CHANGE: +# +# Emitted when the guest changes the actual BALLOON level. This value is +# equivalent to the @actual field return by the 'query-balloon' command +# +# @actual: 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 f827bdc8f6..74cbe253f2 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -154,63 +154,6 @@ { 'command': 'query-iothreads', 'returns': ['IOThreadInfo'], 'allow-preconfig': true } =20 -## -# @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 t= he KVM -# kernel module cannot support it, KvmMissingCap -# - If no balloon device is present, DeviceNotActive -# -# Since: 0.14.0 -# -# Example: -# -# -> { "execute": "query-balloon" } -# <- { "return": { -# "actual": 1073741824, -# } -# } -# -## -{ 'command': 'query-balloon', 'returns': 'BalloonInfo' } - -## -# @BALLOON_CHANGE: -# -# Emitted when the guest changes the actual BALLOON level. This value is -# equivalent to the @actual field return by the 'query-balloon' command -# -# @actual: 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: # @@ -719,32 +662,6 @@ ## { 'command': 'inject-nmi' } =20 -## -# @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 t= he KVM -# kernel module cannot support it, KvmMissingCap -# - If no balloon device is present, DeviceNotActive -# -# Notes: This command just issues a request to the guest. When it returns, -# the balloon size may not have changed. A guest can change the ba= lloon -# size independent of this command. -# -# Since: 0.14.0 -# -# Example: -# -# -> { "execute": "balloon", "arguments": { "value": 536870912 } } -# <- { "return": {} } -# -## -{ '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 =20 #include "exec/cpu-common.h" -#include "qapi/qapi-types-misc.h" +#include "qapi/qapi-types-machine.h" =20 typedef void (QEMUBalloonEvent)(void *opaque, ram_addr_t target); typedef void (QEMUBalloonStatus)(void *opaque, BalloonInfo *info); diff --git a/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" =20 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" --=20 2.21.1 From nobody Thu May 2 10:06:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1584125150; cv=none; d=zohomail.com; s=zohoarc; b=Ffl79FJfa11HWR1U3cY9rm2v1gsKXzwnlayeBtOTOOOwXrPEEpn2dnJSdJ5vbVSlgTnt1ki+9qgAsXaKy/C800gVyMLAqn/sQXaifQqP0hBuydWC4jccE+/u0R99OLFBxb6HaK2DTtZ0JgkL1Bq0BsFovuk2SPldME8Evi2XubE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584125150; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=icvsAljHCvMOvrCYpqizBXKfThlHp6MVycf3qobY6O0=; b=hyrzERRwqPkT6Glig8B+NqtdMUXtNNJez/RKf7SfH6AkzSQouQyoH6B7eRsbF1dTXUDL8VYU8hc4CZ94O6lRb8pHjnGO2c2aKNriwCfBOtbhEBi006YrgtAShFxF9xlgAJix5388ggRHyYkN/TGrAqYf0hH1sV9bXzaMcsI3HdE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1584125150757715.996312331466; Fri, 13 Mar 2020 11:45:50 -0700 (PDT) Received: from localhost ([::1]:35362 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCpJd-0007Hz-N3 for importer@patchew.org; Fri, 13 Mar 2020 14:45:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59337) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCpGO-0001i2-Tx for qemu-devel@nongnu.org; Fri, 13 Mar 2020 14:42:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jCpGK-0005jT-9X for qemu-devel@nongnu.org; Fri, 13 Mar 2020 14:42:28 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:50973 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 1jCpGK-0005iX-5D for qemu-devel@nongnu.org; Fri, 13 Mar 2020 14:42:24 -0400 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-377-oFgS-J4_M9uE2arrU2rRFw-1; Fri, 13 Mar 2020 14:42:21 -0400 Received: by mail-wr1-f71.google.com with SMTP id c6so4685936wrm.18 for ; Fri, 13 Mar 2020 11:42:21 -0700 (PDT) Received: from x1w.redhat.com (47.red-88-21-205.staticip.rima-tde.net. [88.21.205.47]) by smtp.gmail.com with ESMTPSA id f15sm17861272wmj.25.2020.03.13.11.42.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2020 11:42:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584124943; 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=icvsAljHCvMOvrCYpqizBXKfThlHp6MVycf3qobY6O0=; b=ZGShbtDvIXZBGM9kSuPYsiwpYYVhnSxv8Bf3Zozx6NHk8LoalaKcr+WLfUTs291A6UWp3/ nLCuCbc9W3w7nrtP6HhRavFawGmucJmrwwVWlxbjZputdLkeye0Z/nHKZk0q2UrRPqtTg9 cauVttPNGKuxUra1vc77t1OHrQJh0po= X-MC-Unique: oFgS-J4_M9uE2arrU2rRFw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tWYpPXM4ob5O9NHPJVJk5pAHGrKHnH0gc4Gbe7NXkpg=; b=ZLyYAJusKGdUKGg0qHoNlpeXaNUAg/YAda8xs7hDa/5HVjnn2bX1mDCzhOo4ftBrps hYE/S11CX3Q9UDQanOYoaAFFDM7p94tJr7p32EvCRNXIAwmUg9luaaC4xilYI600/VgD 1jHUoz4ZqnbhIba5iFh8jsa4jckUM0xuWIq5nGGMl6PR8TdW6gOnEktnObUJMxNhqpE9 50Afnwv7xO+reXhAMCITleeW64qw0cMKf2ljhXvghFh5HkhIfydMfjZ72BoZYGOwJ0G0 5qTjcA6xWwu35BWJywgFaVzBlNICkM8s5r6jC3213TMx+HpGnjSRNn0TeJiyoWxXnEv0 1Nyg== X-Gm-Message-State: ANhLgQ0bIK0ZQGKwjii+hyAB8yhN8ciAjOlYZgh7PSy572hJfg6zuuN0 PqB284Tpr34/VWULItrmEUAQ3L9IL0K4Zk0TWQ4uX7/7z5lCu4qqRUJCZMQxdKe/+LA1nPu+Vri epKaYAicQJWCxopg= X-Received: by 2002:a5d:5512:: with SMTP id b18mr18771695wrv.215.1584124940660; Fri, 13 Mar 2020 11:42:20 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs0VUlU5DssYZDnreWuJZwLltrmFuSNqz/2k0gHNsivWnegCyHm4fcmYUDpkxcEbESKsDvhrw== X-Received: by 2002:a5d:5512:: with SMTP id b18mr18771675wrv.215.1584124940326; Fri, 13 Mar 2020 11:42:20 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 5/9] qapi/misc: Move query-uuid command with block code Date: Fri, 13 Mar 2020 19:41:49 +0100 Message-Id: <20200313184153.11275-6-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200313184153.11275-1-philmd@redhat.com> References: <20200313184153.11275-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , qemu-block@nongnu.org, "Michael S. Tsirkin" , Markus Armbruster , Ben Warren , Peter Lieven , "Dr. David Alan Gilbert" , Laurent Vivier , Igor Mammedov , Ronnie Sahlberg , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Reitz , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- 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 74cbe253f2..18cd0719f3 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -65,36 +65,6 @@ ## { 'command': 'query-kvm', 'returns': 'KvmInfo' } =20 -## -# @UuidInfo: -# -# Guest UUID information (Universally Unique Identifier). -# -# @UUID: the UUID of the guest -# -# Since: 0.14.0 -# -# Notes: If no UUID was specified for the guest, a null UUID is returned. -## -{ 'struct': 'UuidInfo', 'data': {'UUID': 'str'} } - -## -# @query-uuid: -# -# Query the guest UUID information. -# -# Returns: The @UuidInfo for the guest -# -# Since: 0.14.0 -# -# Example: -# -# -> { "execute": "query-uuid" } -# <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } } -# -## -{ 'command': 'query-uuid', 'returns': 'UuidInfo', 'allow-preconfig': true } - ## # @IOThreadInfo: # diff --git a/block/iscsi.c b/block/iscsi.c index 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" =20 UuidInfo *qmp_query_uuid(Error **errp) --=20 2.21.1 From nobody Thu May 2 10:06:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1584131170; cv=none; d=zohomail.com; s=zohoarc; b=k0BpX1y1nb32JqMvZGEd2rj8pvi9Bjo/BqM1Q+UFEq9QBBDd+fbAIXC520V7cSwTgtx1mcppaucVWTA+bkJPuZ2rBFqVxoLx5leF2yUqEBiT/Of40M05Sip76o+xDHhReik2O58I0tJTICIyVpNepCYqoHSMsR4YCQbhmDzagPM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584131170; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vo3+ii3JGks+EREaSuL0QZJtIf7IDcvFuLgdh6GeUCY=; b=mtkALPmR1tJKUnJZAD4DIB1seQymJN4CIaA5CJ7u149LFFeg5VS4Qt4+/je8LM/GXVLAw4kF/RpJ00Rk35NPufyul6Yw7Z+xXnJAuy5gtQLumosmh2CSadTS0+29z0ZEL+oyUUncuYjL/8/DMGSx4DYmQ+QEzjzhoMdkeKKucdY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1584131170561324.6205574103085; Fri, 13 Mar 2020 13:26:10 -0700 (PDT) Received: from localhost ([::1]:36512 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCqsi-0001Km-Nj for importer@patchew.org; Fri, 13 Mar 2020 16:26:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34200) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCqrm-0000jC-6F for qemu-devel@nongnu.org; Fri, 13 Mar 2020 16:25:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jCqrk-0002Vf-0V for qemu-devel@nongnu.org; Fri, 13 Mar 2020 16:25:09 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:29674 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 1jCqrj-0002QH-LC for qemu-devel@nongnu.org; Fri, 13 Mar 2020 16:25:07 -0400 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-7-d9n7Kzs7PRiCuNEndPOyMQ-1; Fri, 13 Mar 2020 14:42:40 -0400 Received: by mail-wr1-f71.google.com with SMTP id n11so4230144wrs.13 for ; Fri, 13 Mar 2020 11:42:39 -0700 (PDT) Received: from x1w.redhat.com (47.red-88-21-205.staticip.rima-tde.net. [88.21.205.47]) by smtp.gmail.com with ESMTPSA id e1sm70015939wrx.90.2020.03.13.11.42.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2020 11:42:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584131105; 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=vo3+ii3JGks+EREaSuL0QZJtIf7IDcvFuLgdh6GeUCY=; b=MhJ7kFSiqSmhhIzWmmqRTZe7KuPtgW8Z2uKRXjcQKyJ+XcMg6U297zLgXPbn1LDV9haFH2 q0bB77zfAL0MyLSK72NkscnIXCP5lrE/vsnR+woO2vNIAoxrwLnoaqnFdAT6hXwCxOHHIL A3PdZHCKlaSxADB+qoG36F/LXB4/iJk= X-MC-Unique: d9n7Kzs7PRiCuNEndPOyMQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Vd+1ataaoa8axdg0o2XU+CePXzHrmwk/HaCKtdgaSRE=; b=Jx2T3iZrQuyHzoDw8AFreP4V5HdYP01WeYd0OReHBqoC3MPQwIFRGyOGhVZamNkfh7 Muw9ZEwZI5KqwAOAGq3qzK1vSxISc52DUJyih6M4tQCiGHG4qpSiGwkRvWeqw3vLFHSx y/SIRC7xqpfu2jTiRKYdMpkIh4bXoglQLiL4O5MVOU/y/fuufkwgFTTaiG2lY5dqfi5C gZ0aLVe33iyNpRUK7DvcI+BPhIW6woI1l5LOqUhWg3YbhdyagC4mlo71se2YUodVz0Xo FV8ByXLlfryp8hrnDPK2IZxA+I6qMnra1hnandIf4BYw9K3p2Bc6sn6yGVin01PPz1IX 7/aQ== X-Gm-Message-State: ANhLgQ3wgj1vceeZbYhrmFRnxSJnLD6gR33FJIaeeYehWY7+g32w/1BP jHIvc4MOiyoUiUbLNid7p8r0BsLmYd1bGSBwS1FO4mGbws6+iMmHM57ax7wFgD4M9ppiIwlftvj 2xO4HTDbqdgc6NzU= X-Received: by 2002:a1c:4d13:: with SMTP id o19mr12143245wmh.186.1584124945481; Fri, 13 Mar 2020 11:42:25 -0700 (PDT) X-Google-Smtp-Source: ADFU+vv3STGOfMaDr6dWOTdSGIngDWsSE4G8BpfwXSJXFtNpvajRbbCC1M/j4/nvrw7oPhnIjU6CTQ== X-Received: by 2002:a1c:4d13:: with SMTP id o19mr12143225wmh.186.1584124945261; Fri, 13 Mar 2020 11:42:25 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 6/9] qapi/misc: Restrict query-vm-generation-id command to machine code Date: Fri, 13 Mar 2020 19:41:50 +0100 Message-Id: <20200313184153.11275-7-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200313184153.11275-1-philmd@redhat.com> References: <20200313184153.11275-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , qemu-block@nongnu.org, "Michael S. Tsirkin" , Markus Armbruster , Ben Warren , Peter Lieven , "Dr. David Alan Gilbert" , Laurent Vivier , Igor Mammedov , Ronnie Sahlberg , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Reitz , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- qapi/machine.json | 20 ++++++++++++++++++++ qapi/misc.json | 21 --------------------- hw/acpi/vmgenid.c | 2 +- stubs/vmgenid.c | 2 +- 4 files changed, 22 insertions(+), 23 deletions(-) diff --git a/qapi/machine.json b/qapi/machine.json index c096efbea3..1a2a4b0d48 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -415,6 +415,26 @@ ## { 'command': 'query-target', 'returns': 'TargetInfo' } =20 +## +# @GuidInfo: +# +# GUID information. +# +# @guid: the globally unique identifier +# +# Since: 2.9 +## +{ 'struct': 'GuidInfo', 'data': {'guid': 'str'} } + +## +# @query-vm-generation-id: +# +# Show Virtual Machine Generation ID +# +# Since: 2.9 +## +{ 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' } + ## # @LostTickPolicy: # diff --git a/qapi/misc.json b/qapi/misc.json index 18cd0719f3..8e0902caf4 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -1351,24 +1351,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 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" -#include "qapi/qapi-commands-misc.h" +#include "qapi/qapi-commands-machine.h" #include "qemu/module.h" #include "hw/acpi/acpi.h" #include "hw/acpi/aml-build.h" diff --git a/stubs/vmgenid.c b/stubs/vmgenid.c index 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" =20 GuidInfo *qmp_query_vm_generation_id(Error **errp) --=20 2.21.1 From nobody Thu May 2 10:06:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1584125763; cv=none; d=zohomail.com; s=zohoarc; b=cwSRGvMak2KOZ3hOQ/09Fb23TjjRN0W221PK1QSNd4sLf5VHxjW/lxabwlsvFGtGF8Dm7qhpq/OKI4a2flzLE8NWXaBvoEYkdLTJMOJKqKwpV+UnaH52pLrwPUhkF9jPG3r9xDOBqf5xZNlot9RgJfO2m9OqKKaWkOexXkDGL1k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584125763; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=cuibnCyptTt570AcQ64/Hz4qkUF6SgRO+rjbCnZL5M0=; b=A9NWB+LeFOfXTDf8pz604Mnkxy6oVllpLOG3sE/t2cLXttNij4D9yfagTCVZENwWpa9UO5qq/oDyG7DbSkCEg9E2F4R8nFabfayP4PRtXDVgx7Qx7Yz82gWU6zniGeIOZl3ccn9oSCOzsRAuVUn44bcEPJXjCD7u3lRWgj4F8NU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1584125763590393.6250085149783; Fri, 13 Mar 2020 11:56:03 -0700 (PDT) Received: from localhost ([::1]:35628 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCpTW-00076T-DL for importer@patchew.org; Fri, 13 Mar 2020 14:56:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59668) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCpGb-0002Gp-Mh for qemu-devel@nongnu.org; Fri, 13 Mar 2020 14:42:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jCpGZ-00067U-H4 for qemu-devel@nongnu.org; Fri, 13 Mar 2020 14:42:41 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:56769 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 1jCpGZ-0005xG-Cz for qemu-devel@nongnu.org; Fri, 13 Mar 2020 14:42:39 -0400 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-345-2CElxcxpPkGqFUpx-8XLpA-1; Fri, 13 Mar 2020 14:42:32 -0400 Received: by mail-wr1-f69.google.com with SMTP id 31so4766616wrq.0 for ; Fri, 13 Mar 2020 11:42:32 -0700 (PDT) Received: from x1w.redhat.com (47.red-88-21-205.staticip.rima-tde.net. [88.21.205.47]) by smtp.gmail.com with ESMTPSA id q16sm66877412wrj.73.2020.03.13.11.42.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2020 11:42:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584124954; 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=cuibnCyptTt570AcQ64/Hz4qkUF6SgRO+rjbCnZL5M0=; b=ejyMC4SddeEtHNcl9mG9oMGl6x2BDExH/dTOmtzVXNF7A3T1BY+wvo1LS9jJMiWPnq3vRL N/OB1rs27ESV9UL0vZ7kMFPHkFRr4LPPKThPqriCejTheMmHp9aGVNLA4Dw8FjNMUY0Pq2 Gxke4wFnlpxf5eCl4zyg62aR9KHGcbw= X-MC-Unique: 2CElxcxpPkGqFUpx-8XLpA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bfSLqOIFvFz0IUHfM29Y5Jn1zGfnatz+TgLryVfYMxo=; b=AttFKB9IsyN2/1uyDUpvjKoAhHmq9PXp2U1uEDwL7h9xJJAiGofp2ZByIHOiF8DO16 EU17US1w5F95V/NMppH9ba6cUexX9oE9N8mAHOAGWwDxuGXUF67l0DRZkr0EWjiB5GyB OazyHHdyLgNyA2NXkgfdL9M82DqRPRGj+nn4Gm0+BRYm55X+uYTXPNyqpBXEA7GiNy5t 9emaRqEB8433uU0TaBysLpJpFzxLovob0q1SUhnFoc3EOMCtucPliqtPvFmytN2eD7cK RbmgBz2sCw6MfSg8YdghgMkd5uNWztGsNOFfVN7GqruPUhhvdewXYQsEf48dMl7L0XnX J54g== X-Gm-Message-State: ANhLgQ20Loq0qmaWINn0OTZL15bWdG+ZDNjGmCEYtaCirotv4xQnbznD r4W8JnZnB2xxwfW930cvZcRpIwsOF37dTUCB032i/NGeYIL0VHuUXYM7KAM8Myk7otD9MIBNimw 5wPcR7IESCEsJbZo= X-Received: by 2002:a1c:ed17:: with SMTP id l23mr11658077wmh.163.1584124951004; Fri, 13 Mar 2020 11:42:31 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtin7uFMIO752g8cnDhsl8ZiWKei/beg5lsi1iRTWsOpXsj212WBMTHzOUmZSbhhCmHXvSM5g== X-Received: by 2002:a1c:ed17:: with SMTP id l23mr11658029wmh.163.1584124950424; Fri, 13 Mar 2020 11:42:30 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 7/9] qapi/misc: Restrict ACPI commands to machine code Date: Fri, 13 Mar 2020 19:41:51 +0100 Message-Id: <20200313184153.11275-8-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200313184153.11275-1-philmd@redhat.com> References: <20200313184153.11275-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , qemu-block@nongnu.org, "Michael S. Tsirkin" , Markus Armbruster , Ben Warren , Peter Lieven , "Dr. David Alan Gilbert" , Laurent Vivier , Igor Mammedov , Ronnie Sahlberg , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Reitz , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- 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 speci= fied +# by any one of them is loaded and concatenated in order. If both are omit= ted, +# @data is implied. +# +# Other fields / optargs can be used to override fields of the generic ACPI +# table header; refer to the ACPI specification 5.0, section 5.2.6 System +# Description Table Header. If a header field is not overridden, then the +# corresponding value from the concatenated blob is used (in case of @file= ), or +# it is filled in with a hard-coded value (in case of @data). +# +# String fields are copied into the matching ACPI member from lowest addre= ss +# upwards, and silently truncated / NUL-padded to length. +# +# @sig: table signature / identifier (4 bytes) +# +# @rev: table revision number (dependent on signature, 1 byte) +# +# @oem_id: OEM identifier (6 bytes) +# +# @oem_table_id: OEM table identifier (8 bytes) +# +# @oem_rev: OEM-supplied revision number (4 bytes) +# +# @asl_compiler_id: identifier of the utility that created the table +# (4 bytes) +# +# @asl_compiler_rev: revision number of the utility that created the +# table (4 bytes) +# +# @file: colon (:) separated list of pathnames to load and +# concatenate as table data. The resultant binary blob is expected = to +# have an ACPI table header. At least one file is required. This fi= eld +# excludes @data. +# +# @data: colon (:) separated list of pathnames to load and +# concatenate as table data. The resultant binary blob must not hav= e an +# ACPI table header. At least one file is required. This field excl= udes +# @file. +# +# Since: 1.5 +## +{ 'struct': 'AcpiTableOptions', + 'data': { + '*sig': 'str', + '*rev': 'uint8', + '*oem_id': 'str', + '*oem_table_id': 'str', + '*oem_rev': 'uint32', + '*asl_compiler_id': 'str', + '*asl_compiler_rev': 'uint32', + '*file': 'str', + '*data': 'str' }} + +## +# @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", "so= urce": 1, "status": 0}, +# { "slot": "1", "slot-type": "DIMM", "source": 0, "statu= s": 0}, +# { "slot": "2", "slot-type": "DIMM", "source": 0, "statu= s": 0}, +# { "slot": "3", "slot-type": "DIMM", "source": 0, "statu= s": 0} +# ]} +# +## +{ 'command': 'query-acpi-ospm-status', 'returns': ['ACPIOSTInfo'] } + +## +# @ACPI_DEVICE_OST: +# +# Emitted when guest executes ACPI _OST method. +# +# @info: OSPM Status Indication +# +# Since: 2.1 +# +# Example: +# +# <- { "event": "ACPI_DEVICE_OST", +# "data": { "device": "d1", "slot": "0", +# "slot-type": "DIMM", "source": 1, "status": 0 } } +# +## +{ 'event': 'ACPI_DEVICE_OST', + 'data': { 'info': 'ACPIOSTInfo' } } diff --git a/qapi/misc.json b/qapi/misc.json index 8e0902caf4..0cfefef017 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -967,64 +967,6 @@ ## { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] } =20 -## -# @AcpiTableOptions: -# -# Specify an ACPI table on the command line to load. -# -# At most one of @file and @data can be specified. The list of files speci= fied -# by any one of them is loaded and concatenated in order. If both are omit= ted, -# @data is implied. -# -# Other fields / optargs can be used to override fields of the generic ACPI -# table header; refer to the ACPI specification 5.0, section 5.2.6 System -# Description Table Header. If a header field is not overridden, then the -# corresponding value from the concatenated blob is used (in case of @file= ), or -# it is filled in with a hard-coded value (in case of @data). -# -# String fields are copied into the matching ACPI member from lowest addre= ss -# upwards, and silently truncated / NUL-padded to length. -# -# @sig: table signature / identifier (4 bytes) -# -# @rev: table revision number (dependent on signature, 1 byte) -# -# @oem_id: OEM identifier (6 bytes) -# -# @oem_table_id: OEM table identifier (8 bytes) -# -# @oem_rev: OEM-supplied revision number (4 bytes) -# -# @asl_compiler_id: identifier of the utility that created the table -# (4 bytes) -# -# @asl_compiler_rev: revision number of the utility that created the -# table (4 bytes) -# -# @file: colon (:) separated list of pathnames to load and -# concatenate as table data. The resultant binary blob is expected = to -# have an ACPI table header. At least one file is required. This fi= eld -# excludes @data. -# -# @data: colon (:) separated list of pathnames to load and -# concatenate as table data. The resultant binary blob must not hav= e an -# ACPI table header. At least one file is required. This field excl= udes -# @file. -# -# Since: 1.5 -## -{ 'struct': 'AcpiTableOptions', - 'data': { - '*sig': 'str', - '*rev': 'uint8', - '*oem_id': 'str', - '*oem_table_id': 'str', - '*oem_rev': 'uint32', - '*asl_compiler_id': 'str', - '*asl_compiler_rev': 'uint32', - '*file': 'str', - '*data': 'str' }} - ## # @CommandLineParameterType: # @@ -1217,102 +1159,6 @@ ## { 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] } =20 -## -# @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", "so= urce": 1, "status": 0}, -# { "slot": "1", "slot-type": "DIMM", "source": 0, "statu= s": 0}, -# { "slot": "2", "slot-type": "DIMM", "source": 0, "statu= s": 0}, -# { "slot": "3", "slot-type": "DIMM", "source": 0, "statu= s": 0} -# ]} -# -## -{ 'command': 'query-acpi-ospm-status', 'returns': ['ACPIOSTInfo'] } - -## -# @ACPI_DEVICE_OST: -# -# Emitted when guest executes ACPI _OST method. -# -# @info: OSPM Status Indication -# -# Since: 2.1 -# -# Example: -# -# <- { "event": "ACPI_DEVICE_OST", -# "data": { "device": "d1", "slot": "0", -# "slot-type": "DIMM", "source": 1, "status": 0 } } -# -## -{ 'event': 'ACPI_DEVICE_OST', - 'data': { 'info': 'ACPIOSTInfo' } } - ## # @ReplayMode: # diff --git a/include/hw/acpi/acpi_dev_interface.h b/include/hw/acpi/acpi_de= v_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 =20 -#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" =20 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" =20 #define MEMORY_SLOTS_NUMBER "MDNR" #define MEMORY_HOTPLUG_IO_REGION "HPMR" --=20 2.21.1 From nobody Thu May 2 10:06:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1584125810; cv=none; d=zohomail.com; s=zohoarc; b=HPH0GFpsq+ILweEZvETT2Yfn2DNtY+Tpv2PdaIAbxE+WRLW1zqZlITKR0I8GEACVtJT6Vl6H/WsmS9gqCe8JW7dFLRyZmzgXtb+HoY5g3QCPfR2Jhgv2quLMcehq+RRsvWP8ahhpJwom7//pD/hrK1rd3OxOaHbEwbevz1HB0cQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584125810; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=8zSwxlmr2wPfyeIRR4RQsnt89CbzAttVCTp/kZ1725M=; b=ZZPFCwBCB60fON1YCUZBOA+kb+DpwP2xkgrP+0je+r83VJVsLm6/2N1swwh/8YiC+bSYgCvdqdCYpxs/n8rX/dP3B6JcGUXb42RsQ8cyRoe2aHxiSILbp8Ev68iJtfjC8UkQRgzbVKzI7Sb5ZFH0S0as3qj8rfNztTH5jAOnrxY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1584125810160730.1287494820054; Fri, 13 Mar 2020 11:56:50 -0700 (PDT) Received: from localhost ([::1]:35637 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCpUH-0008S7-2Q for importer@patchew.org; Fri, 13 Mar 2020 14:56:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59919) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCpGo-0002g5-KN for qemu-devel@nongnu.org; Fri, 13 Mar 2020 14:42:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jCpGm-0006bP-B1 for qemu-devel@nongnu.org; Fri, 13 Mar 2020 14:42:54 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:21104 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 1jCpGm-0006aw-6V for qemu-devel@nongnu.org; Fri, 13 Mar 2020 14:42:52 -0400 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-30-aZNlXubwPN68Cu71s4G7Cw-1; Fri, 13 Mar 2020 14:42:39 -0400 Received: by mail-wm1-f70.google.com with SMTP id x7so3306608wmi.4 for ; Fri, 13 Mar 2020 11:42:39 -0700 (PDT) Received: from x1w.redhat.com (47.red-88-21-205.staticip.rima-tde.net. [88.21.205.47]) by smtp.gmail.com with ESMTPSA id o5sm19075067wmb.8.2020.03.13.11.42.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2020 11:42:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584124971; 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=8zSwxlmr2wPfyeIRR4RQsnt89CbzAttVCTp/kZ1725M=; b=fwgvONBMfhaDYt/5PR63C3Y+9q8/nuMCD0gj1GYHAJMQN/AFtmV5waQ8rGQy/YWvsiSlcz QMyWvL2npkpcHZeDnOGa/l8hHi3NmYWsfLdsfgKB1bPJcNg2ZdhkyELnsjuhDA3ZsT4SWs IDZOKL8FsnWMsty2qw9rrUk6+wrfFeY= X-MC-Unique: aZNlXubwPN68Cu71s4G7Cw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Q5EvLViKHIAiPNDw9slWpthe+gCfBn00bhTYG8gq+7s=; b=bnvZU9ussN0tr+cmGWrIsgvPK209TEN6E0nPOho/cGYDvbZHOBoRP0gamFW6KMRqmX CDG385nMUdSUo6XyvhTngV0o8pIHRFFfKccJ6ON/SDC/oL71SyShOHfYQEkqJdxy1QCE qFSwmokaFIb7X79aG5Ba2D8l6SYkusIOSKe3z8XMtHK5jI+Mz+T4odquJpXUpPBkbMWN AXfniVcsnzwL1mD796A3E5gSioGaNn/VvsKuGOYSUFTg7QkcsYjgeUjpwqpl+xd++MJ+ gcd71vTwOy8S3qwRK6XLlLjtRtieTqbavGj7FF+pEpuudqzzS67HK7dq/uowhSkSN6w+ BqGA== X-Gm-Message-State: ANhLgQ0G6XEF4UzzJ+ukV6dNJq4Ox85f1kWgB9oQEfogP53c9O7ter7L 9ybIxnZXHi5aw2XX9oiuye377nstNE0iknvKVEi09WoRI6udBGbCl0zgzQ1IG1INJHc3+VmM9Xq bcYw5iw2Vljl6lHY= X-Received: by 2002:adf:a3d3:: with SMTP id m19mr18415776wrb.377.1584124955865; Fri, 13 Mar 2020 11:42:35 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuYVKYbUp1dOFNTBu7i59wk2vn1seAUsjrRTfeorztzqE/Vc5YTABjqsH1iFJDw6h8J/Yw11Q== X-Received: by 2002:adf:a3d3:: with SMTP id m19mr18415737wrb.377.1584124955422; Fri, 13 Mar 2020 11:42:35 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 8/9] qapi/misc: Restrict PCI commands to machine code Date: Fri, 13 Mar 2020 19:41:52 +0100 Message-Id: <20200313184153.11275-9-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200313184153.11275-1-philmd@redhat.com> References: <20200313184153.11275-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , qemu-block@nongnu.org, "Michael S. Tsirkin" , Markus Armbruster , Ben Warren , Peter Lieven , "Dr. David Alan Gilbert" , Laurent Vivier , Igor Mammedov , Ronnie Sahlberg , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Reitz , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- 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 0cfefef017..699a533e6c 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -124,310 +124,6 @@ { 'command': 'query-iothreads', 'returns': ['IOThreadInfo'], 'allow-preconfig': true } =20 -## -# @PciMemoryRange: -# -# A PCI device memory region -# -# @base: the starting address (guest physical) -# -# @limit: the ending address (guest physical) -# -# Since: 0.14.0 -## -{ 'struct': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} } - -## -# @PciMemoryRegion: -# -# Information about a PCI device I/O region. -# -# @bar: the index of the Base Address Register for this region -# -# @type: - 'io' if the region is a PIO region -# - 'memory' if the region is a MMIO region -# -# @size: memory size -# -# @prefetch: if @type is 'memory', true if the memory is prefetchable -# -# @mem_type_64: if @type is 'memory', true if the BAR is 64-bit -# -# Since: 0.14.0 -## -{ 'struct': 'PciMemoryRegion', - 'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int', - '*prefetch': 'bool', '*mem_type_64': 'bool' } } - -## -# @PciBusInfo: -# -# Information about a bus of a PCI Bridge device -# -# @number: primary bus interface number. This should be the number of the -# bus the device resides on. -# -# @secondary: secondary bus interface number. This is the number of the -# main bus for the bridge -# -# @subordinate: This is the highest number bus that resides below the -# bridge. -# -# @io_range: The PIO range for all devices on this bridge -# -# @memory_range: The MMIO range for all devices on this bridge -# -# @prefetchable_range: The range of prefetchable MMIO for all devices on -# this bridge -# -# Since: 2.4 -## -{ 'struct': 'PciBusInfo', - 'data': {'number': 'int', 'secondary': 'int', 'subordinate': 'int', - 'io_range': 'PciMemoryRange', - 'memory_range': 'PciMemoryRange', - 'prefetchable_range': 'PciMemoryRange' } } - -## -# @PciBridgeInfo: -# -# Information about a PCI Bridge device -# -# @bus: information about the bus the device resides on -# -# @devices: a list of @PciDeviceInfo for each device on this bridge -# -# Since: 0.14.0 -## -{ 'struct': 'PciBridgeInfo', - 'data': {'bus': 'PciBusInfo', '*devices': ['PciDeviceInfo']} } - -## -# @PciDeviceClass: -# -# Information about the Class of a PCI device -# -# @desc: a string description of the device's class -# -# @class: the class code of the device -# -# Since: 2.4 -## -{ 'struct': 'PciDeviceClass', - 'data': {'*desc': 'str', 'class': 'int'} } - -## -# @PciDeviceId: -# -# Information about the Id of a PCI device -# -# @device: the PCI device id -# -# @vendor: the PCI vendor id -# -# @subsystem: the PCI subsystem id (since 3.1) -# -# @subsystem-vendor: the PCI subsystem vendor id (since 3.1) -# -# Since: 2.4 -## -{ 'struct': 'PciDeviceId', - 'data': {'device': 'int', 'vendor': 'int', '*subsystem': 'int', - '*subsystem-vendor': 'int'} } - -## -# @PciDeviceInfo: -# -# Information about a PCI device -# -# @bus: the bus number of the device -# -# @slot: the slot the device is located in -# -# @function: the function of the slot used by the device -# -# @class_info: the class of the device -# -# @id: the PCI device id -# -# @irq: if an IRQ is assigned to the device, the IRQ number -# -# @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" =20 //#define DEBUG_PCI --=20 2.21.1 From nobody Thu May 2 10:06:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1584125707; cv=none; d=zohomail.com; s=zohoarc; b=cZZwMw/TnPgRouJM66uyCQ5ZzbqyzAH14+s1+nZE/l0CrAWNCPgSi9EA9HFbOHVrna+1WC5kvQDMS3siLrPzlhOQPnVhhytdg7w93a0Onv78kKKn68tcIXuOdn2nvvpyjKVCHqE2MYRdJUOpoqUs2EhISoPBgpMC7qYOuUcSKHo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584125707; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=RRyDWw95dJommAqN2W7J/+LU6ZDRn1YTu8tBofHJOHo=; b=Vg8I3ZT91QMxhYhoP9hYU+r1wCG3VTTWDqEnIl3B8Jzt7JhV28BKVnj5LzcjKYg9aRRuXr8lTgcLdybfRwMCph8u/r33vUt1uEJTIXP2va6AxDjXYga8WN9JhhMYsFW2SgN+MKA4zYNn4l1Rx4VVng0n4Jw+mRZ8S41rvzb1z6c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1584125707207552.2753300171389; Fri, 13 Mar 2020 11:55:07 -0700 (PDT) Received: from localhost ([::1]:35602 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCpSc-0005eV-2Z for importer@patchew.org; Fri, 13 Mar 2020 14:55:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59864) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCpGm-0002ZM-2U for qemu-devel@nongnu.org; Fri, 13 Mar 2020 14:42:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jCpGk-0006Vf-Cq for qemu-devel@nongnu.org; Fri, 13 Mar 2020 14:42:51 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:27288 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 1jCpGk-0006Uo-9H for qemu-devel@nongnu.org; Fri, 13 Mar 2020 14:42:50 -0400 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-207-kvX61bR3PWq0WGsfPJaw1Q-1; Fri, 13 Mar 2020 14:42:44 -0400 Received: by mail-wr1-f71.google.com with SMTP id b12so4764411wro.4 for ; Fri, 13 Mar 2020 11:42:44 -0700 (PDT) Received: from x1w.redhat.com (47.red-88-21-205.staticip.rima-tde.net. [88.21.205.47]) by smtp.gmail.com with ESMTPSA id x13sm18382962wmj.5.2020.03.13.11.42.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2020 11:42:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584124969; 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=RRyDWw95dJommAqN2W7J/+LU6ZDRn1YTu8tBofHJOHo=; b=Y2hTDwQR5/J0WM4VNmM6XZjdUq/g2z2WS4kl6G8OUiPRgoDHX03psoGiKXui5g1rIy0zpi 6G4ynb24z/XfbKvDRn6htqakkiY7F2xeqrjZ0VpmjLgNQtLlYKrBKSJ8VxPeLzRKKSeXpA ZHrbgNt8h4w3nYQJ+Rlhg8/e5jd6n7o= X-MC-Unique: kvX61bR3PWq0WGsfPJaw1Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BJAcmokJWBLuNcr+8yfIvUvFzq5Jj9wL/tRzXK130E4=; b=kMIIORmJoTGQiN1BAn9JqapbS9cM2y2u+fI9ZkoUh7L3vio6pRKqhZ9eKfSykYRLCo U/8hmKl0e5kironIkpHuG0Mag8B1G2kBCrH9ol91MHhUy9JN9LDPbujw1IYkz+ApUKu0 aOx6w87IkxrrvwWWG5jCy0UVG1AUVhHNptUXiwRVsFaa6mTneOBk2AqORyEYofEXXCZB yXpW/C3ZwX4bymWmxwbMKGevx3LFd2yIGRi0ojeU6RzLlZrys4I5zR5MoXiTPv206LLn EEridtcdOmA95C978SUfPfSB1behyG0fRTYcwMYXWEk0WmYvU+kuIESuMtS66FsqrYqv yDCw== X-Gm-Message-State: ANhLgQ36VhAiQPxLX0ibVyTNeqxAQR6XnI6zvUi4myKScuPDrgikMRUt fkHfkF1vQX1ihS87aGfaDj5bX986L6g7HaXpNHx1W+B6u9dtWjD7jn2pxYfdfc0EqDEZ5ZJ30G2 s6AgbIUmKl5WQTuU= X-Received: by 2002:a5d:5342:: with SMTP id t2mr137003wrv.104.1584124960648; Fri, 13 Mar 2020 11:42:40 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvFHIGrf5NUxUUGAYLRTrdbtx/VL7qA6r/G/YjypCpBOF/S/kh4nKAMekiQ4HFAzFX8h9bvOA== X-Received: by 2002:a5d:5342:: with SMTP id t2mr136967wrv.104.1584124960320; Fri, 13 Mar 2020 11:42:40 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 9/9] qapi/misc: Restrict device memory commands to machine code Date: Fri, 13 Mar 2020 19:41:53 +0100 Message-Id: <20200313184153.11275-10-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200313184153.11275-1-philmd@redhat.com> References: <20200313184153.11275-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , qemu-block@nongnu.org, "Michael S. Tsirkin" , Markus Armbruster , Ben Warren , Peter Lieven , "Dr. David Alan Gilbert" , Laurent Vivier , Igor Mammedov , Ronnie Sahlberg , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Reitz , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- 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 699a533e6c..48a0c5410b 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -486,39 +486,6 @@ ## { 'command': 'closefd', 'data': {'fdname': 'str'} } =20 -## -# @MemoryInfo: -# -# Actual memory information in bytes. -# -# @base-memory: size of "base" memory specified with command line -# option -m. -# -# @plugged-memory: size of memory that can be hot-unplugged. This field -# is omitted if target doesn't support memory hotplug -# (i.e. CONFIG_MEM_DEVICE not defined at build time). -# -# Since: 2.11.0 -## -{ 'struct': 'MemoryInfo', - 'data' : { 'base-memory': 'size', '*plugged-memory': 'size' } } - -## -# @query-memory-size-summary: -# -# Return the amount of initially allocated and present hotpluggable (if -# enabled) memory in bytes. -# -# Example: -# -# -> { "execute": "query-memory-size-summary" } -# <- { "return": { "base-memory": 4294967296, "plugged-memory": 0 } } -# -# Since: 2.11.0 -## -{ 'command': 'query-memory-size-summary', 'returns': 'MemoryInfo' } - - ## # @AddfdInfo: # @@ -756,105 +723,6 @@ 'returns': ['CommandLineOptionInfo'], 'allow-preconfig': true } =20 -## -# @PCDIMMDeviceInfo: -# -# PCDIMMDevice state information -# -# @id: device's ID -# -# @addr: physical address, where device is mapped -# -# @size: size of memory that the device provides -# -# @slot: slot number at which device is plugged in -# -# @node: NUMA node number where device is plugged in -# -# @memdev: memory backend linked with device -# -# @hotplugged: true if device was hotplugged -# -# @hotpluggable: true if device if could be added/removed while machine is= running -# -# Since: 2.1 -## -{ 'struct': 'PCDIMMDeviceInfo', - 'data': { '*id': 'str', - 'addr': 'int', - 'size': 'int', - 'slot': 'int', - 'node': 'int', - 'memdev': 'str', - 'hotplugged': 'bool', - 'hotpluggable': 'bool' - } -} - -## -# @VirtioPMEMDeviceInfo: -# -# VirtioPMEM state information -# -# @id: device's ID -# -# @memaddr: physical address in memory, where device is mapped -# -# @size: size of memory that the device provides -# -# @memdev: memory backend linked with device -# -# Since: 4.1 -## -{ 'struct': 'VirtioPMEMDeviceInfo', - 'data': { '*id': 'str', - 'memaddr': 'size', - 'size': 'size', - 'memdev': 'str' - } -} - -## -# @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 =20 #include "hw/qdev-core.h" +#include "qapi/qapi-types-machine.h" #include "qapi/qapi-types-misc.h" #include "qom/object.h" =20 diff --git a/include/hw/virtio/virtio-pmem.h b/include/hw/virtio/virtio-pme= m.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 =20 #include "hw/virtio/virtio.h" -#include "qapi/qapi-types-misc.h" +#include "qapi/qapi-types-machine.h" =20 #define TYPE_VIRTIO_PMEM "virtio-pmem" =20 --=20 2.21.1