From: Paolo Bonzini <pbonzini@redhat.com>
To: Haozhong Zhang <haozhong.zhang@intel.com>, qemu-devel@nongnu.org
Cc: Richard Henderson <rth@twiddle.net>,
Eduardo Habkost <ehabkost@redhat.com>,
mst@redhat.com
Subject: Re: [Qemu-devel] [PATCH] pc: fail memory hot-plug/unplug with -no-acpi and Q35 machine type
Date: Fri, 22 Dec 2017 17:12:07 +0100 [thread overview]
Message-ID: <97d0c165-31e4-4f59-b977-99f82a8dc37b@redhat.com> (raw)
In-Reply-To: <20171222015120.31730-1-haozhong.zhang@intel.com>
On 22/12/2017 02:51, Haozhong Zhang wrote:
> When -no-acpi option is used with Q35 machine type, no guest ACPI is
> built, but the ACPI device is still created, so only checking the
> presence of ACPI device before memory plug/unplug is not enough in
> such cases. Check whether ACPI is disabled globally in addition and
> fail memory plug/unplug if it's disabled.
>
> Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
> ---
> hw/i386/pc.c | 18 ++++++++++++++----
> 1 file changed, 14 insertions(+), 4 deletions(-)
>
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index 3fcf318a95..55686bf5d8 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -1695,9 +1695,14 @@ static void pc_dimm_plug(HotplugHandler *hotplug_dev,
> align = memory_region_get_alignment(mr);
> }
>
> - if (!pcms->acpi_dev) {
> + /*
> + * When -no-acpi is used with Q35 machine type, no ACPI is built,
> + * but pcms->acpi_dev is still created. Check !acpi_enabled in
> + * addition to cover this case.
> + */
> + if (!pcms->acpi_dev || !acpi_enabled) {
> error_setg(&local_err,
> - "memory hotplug is not enabled: missing acpi device");
> + "memory hotplug is not enabled: missing acpi device or acpi disabled");
> goto out;
> }
>
> @@ -1729,9 +1734,14 @@ static void pc_dimm_unplug_request(HotplugHandler *hotplug_dev,
> Error *local_err = NULL;
> PCMachineState *pcms = PC_MACHINE(hotplug_dev);
>
> - if (!pcms->acpi_dev) {
> + /*
> + * When -no-acpi is used with Q35 machine type, no ACPI is built,
> + * but pcms->acpi_dev is still created. Check !acpi_enabled in
> + * addition to cover this case.
> + */
> + if (!pcms->acpi_dev || !acpi_enabled) {
> error_setg(&local_err,
> - "memory hotplug is not enabled: missing acpi device");
> + "memory hotplug is not enabled: missing acpi device or acpi disabled");
> goto out;
> }
>
>
Queued, thanks.
Paolo
prev parent reply other threads:[~2017-12-22 16:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-22 1:51 [Qemu-devel] [PATCH] pc: fail memory hot-plug/unplug with -no-acpi and Q35 machine type Haozhong Zhang
2017-12-22 15:17 ` Igor Mammedov
2017-12-22 16:12 ` Paolo Bonzini [this message]
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=97d0c165-31e4-4f59-b977-99f82a8dc37b@redhat.com \
--to=pbonzini@redhat.com \
--cc=ehabkost@redhat.com \
--cc=haozhong.zhang@intel.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/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).