qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Haozhong Zhang <haozhong.zhang@intel.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Xiao Guangrong <guangrong.xiao@linux.intel.com>,
	Eduardo Habkost <ehabkost@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Richard Henderson <rth@twiddle.net>
Subject: [Qemu-devel] [PULL 10/16] hw/i386: check if nvdimm is enabled before plugging
Date: Wed, 25 Jan 2017 00:36:47 +0200	[thread overview]
Message-ID: <1485297322-10595-11-git-send-email-mst@redhat.com> (raw)
In-Reply-To: <1485297322-10595-1-git-send-email-mst@redhat.com>

From: Haozhong Zhang <haozhong.zhang@intel.com>

The missing of 'nvdimm' in the machine type option '-M' means NVDIMM
is disabled. QEMU should refuse to plug any NVDIMM device in this case
and report the misconfiguration.

The behavior of NVDIMM on unsupported platform (HW/FW) is vendor
specific. For some vendors, it's undefined and the platform may do
anything. Thus, I think QEMU is free to choose the implementation.
Aborting QEMU (i.e. refusing to boot) is the easiest one.

Reported-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
Message-Id: 20170112110928.GF4621@stefanha-x1.localdomain
Message-Id: 20170111093630.2088-1-stefanha@redhat.com
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 hw/i386/pc.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index c949cf0..47984c8 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1708,6 +1708,11 @@ static void pc_dimm_plug(HotplugHandler *hotplug_dev,
     }
 
     if (object_dynamic_cast(OBJECT(dev), TYPE_NVDIMM)) {
+        if (!pcms->acpi_nvdimm_state.is_enabled) {
+            error_setg(&local_err,
+                       "nvdimm is not enabled: missing 'nvdimm' in '-M'");
+            goto out;
+        }
         nvdimm_plug(&pcms->acpi_nvdimm_state);
     }
 
-- 
MST

  parent reply	other threads:[~2017-01-24 22:36 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-24 22:36 [Qemu-devel] [PULL 00/16] virtio, vhost, pci: fixes, features Michael S. Tsirkin
2017-01-24 22:36 ` [Qemu-devel] [PULL 01/16] compiler: drop ; after BUILD_BUG_ON Michael S. Tsirkin
2017-01-24 22:36 ` [Qemu-devel] [PULL 02/16] compiler: rework BUG_ON using a struct Michael S. Tsirkin
2017-01-24 22:36 ` [Qemu-devel] [PULL 03/16] compiler: expression version of QEMU_BUILD_BUG_ON Michael S. Tsirkin
2017-01-24 22:36 ` [Qemu-devel] [PULL 04/16] ARRAY_SIZE: check that argument is an array Michael S. Tsirkin
2017-01-24 22:36 ` [Qemu-devel] [PULL 05/16] pci: mark ROMs read-only Michael S. Tsirkin
2017-01-24 22:36 ` [Qemu-devel] [PULL 06/16] intel_iommu: fix and simplify size calculation in process_device_iotlb_desc() Michael S. Tsirkin
2017-01-24 22:36 ` [Qemu-devel] [PULL 07/16] hw/pcie: Introduce a base class for PCI Express Root Ports Michael S. Tsirkin
2017-01-24 22:36 ` [Qemu-devel] [PULL 08/16] hw/ioh3420: derive from PCI Express Root Port base class Michael S. Tsirkin
2017-01-24 22:36 ` [Qemu-devel] [PULL 09/16] hw/pcie: Introduce Generic PCI Express Root Port Michael S. Tsirkin
2017-01-24 22:36 ` Michael S. Tsirkin [this message]
2017-01-24 22:36 ` [Qemu-devel] [PULL 11/16] msix: Follow CODING_STYLE Michael S. Tsirkin
2017-01-24 22:36 ` [Qemu-devel] [PULL 12/16] hcd-xhci: check & correct param before using it Michael S. Tsirkin
2017-01-24 22:36 ` [Qemu-devel] [PULL 13/16] pci: Convert msix_init() to Error and fix callers Michael S. Tsirkin
2017-01-24 22:37 ` [Qemu-devel] [PULL 14/16] virtio: make virtio_should_notify static Michael S. Tsirkin
2017-01-24 22:37 ` [Qemu-devel] [PULL 15/16] vhost: skip ROM sections Michael S. Tsirkin
2017-01-24 22:37 ` [Qemu-devel] [PULL 16/16] vhost-user: delete chardev on cleanup Michael S. Tsirkin
2017-01-25 16:36 ` [Qemu-devel] [PULL 00/16] virtio, vhost, pci: fixes, features Peter Maydell
2017-01-25 18:02   ` Marcel Apfelbaum
2017-01-25 18:08     ` Peter Maydell
2017-01-25 18:45       ` Marcel Apfelbaum
2017-01-25 19:24       ` Peter Maydell
2017-01-25 21:57         ` Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1485297322-10595-11-git-send-email-mst@redhat.com \
    --to=mst@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=guangrong.xiao@linux.intel.com \
    --cc=haozhong.zhang@intel.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).