qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: "Maciej S. Szmigiero" <mail@maciej.szmigiero.name>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	Eduardo Habkost <eduardo@habkost.net>
Cc: "Michael S . Tsirkin" <mst@redhat.com>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Thomas Huth" <thuth@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Eric Blake" <eblake@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [PATCH v7 7/7] hw/i386/pc: Support hv-balloon
Date: Wed, 27 Sep 2023 12:49:53 +0200	[thread overview]
Message-ID: <fa0b04e5-33ff-6ba8-db17-4e46640ecc08@redhat.com> (raw)
In-Reply-To: <9f11c6afb4271a31b6fe276931ecdf6923bf2877.1693240836.git.maciej.szmigiero@oracle.com>

On 28.08.23 18:48, Maciej S. Szmigiero wrote:
> From: "Maciej S. Szmigiero" <maciej.szmigiero@oracle.com>
> 
> Add the necessary plumbing for the hv-balloon driver to the PC machine.
> 
> Co-developed-by: David Hildenbrand <david@redhat.com>
> Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
> ---
>   hw/i386/Kconfig |  1 +
>   hw/i386/pc.c    | 22 ++++++++++++++++++++++
>   2 files changed, 23 insertions(+)
> 
> diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig
> index 9051083c1e78..349cf0d32fad 100644
> --- a/hw/i386/Kconfig
> +++ b/hw/i386/Kconfig
> @@ -45,6 +45,7 @@ config PC
>       select ACPI_VMGENID
>       select VIRTIO_PMEM_SUPPORTED
>       select VIRTIO_MEM_SUPPORTED
> +    select HV_BALLOON_SUPPORTED
>   
>   config PC_PCI
>       bool
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index 54838c0c411d..d979479cab5e 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -28,6 +28,7 @@
>   #include "hw/i386/pc.h"
>   #include "hw/char/serial.h"
>   #include "hw/char/parallel.h"
> +#include "hw/hyperv/hv-balloon.h"
>   #include "hw/i386/topology.h"
>   #include "hw/i386/fw_cfg.h"
>   #include "hw/i386/vmport.h"
> @@ -93,6 +94,7 @@
>   #include "hw/i386/kvm/xen_evtchn.h"
>   #include "hw/i386/kvm/xen_gnttab.h"
>   #include "hw/i386/kvm/xen_xenstore.h"
> +#include "hw/mem/memory-device.h"
>   #include "sysemu/replay.h"
>   #include "target/i386/cpu.h"
>   #include "e820_memory_layout.h"
> @@ -1494,6 +1496,21 @@ static void pc_memory_unplug(HotplugHandler *hotplug_dev,
>       error_propagate(errp, local_err);
>   }
>   
> +static void pc_hv_balloon_pre_plug(HotplugHandler *hotplug_dev,
> +                                   DeviceState *dev, Error **errp)
> +{
> +    /* The vmbus handler has no hotplug handler; we should never end up here. */
> +    g_assert(!dev->hotplugged);
> +    memory_device_pre_plug(MEMORY_DEVICE(dev), MACHINE(hotplug_dev), NULL,
> +                           errp);
> +}
> +
> +static void pc_hv_balloon_plug(HotplugHandler *hotplug_dev,
> +                               DeviceState *dev, Error **errp)
> +{
> +    memory_device_plug(MEMORY_DEVICE(dev), MACHINE(hotplug_dev));
> +}
> +


Maybe we want to have hv_balloon_pre_plug() and hv_balloon_plug(), but 
this here should be good enough for now.

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Cheers,

David / dhildenb



  reply	other threads:[~2023-09-27 10:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-28 16:48 [PATCH v7 0/7] Hyper-V Dynamic Memory Protocol driver (hv-balloon 🎈️) Maciej S. Szmigiero
2023-08-28 16:48 ` [PATCH v7 1/7] memory-device: Support empty memory devices Maciej S. Szmigiero
2023-08-28 16:48 ` [PATCH v7 2/7] memory-device: Drop size alignment check Maciej S. Szmigiero
2023-08-28 16:48 ` [PATCH v7 3/7] Add Hyper-V Dynamic Memory Protocol definitions Maciej S. Szmigiero
2023-09-27 10:54   ` David Hildenbrand
2023-08-28 16:48 ` [PATCH v7 4/7] Add a Hyper-V Dynamic Memory Protocol driver (hv-balloon) Maciej S. Szmigiero
2023-08-28 16:48 ` [PATCH v7 5/7] qapi: Add query-memory-devices support to hv-balloon Maciej S. Szmigiero
2023-09-25 11:16   ` Markus Armbruster
2023-09-27 10:52   ` David Hildenbrand
2023-08-28 16:48 ` [PATCH v7 6/7] qapi: Add HV_BALLOON_STATUS_REPORT event and its QMP query command Maciej S. Szmigiero
2023-09-25 11:49   ` Markus Armbruster
2023-09-25 17:12     ` Maciej S. Szmigiero
2023-09-26  6:38       ` Markus Armbruster
2023-08-28 16:48 ` [PATCH v7 7/7] hw/i386/pc: Support hv-balloon Maciej S. Szmigiero
2023-09-27 10:49   ` David Hildenbrand [this message]
2023-10-18  8:00 ` [PATCH v7 0/7] Hyper-V Dynamic Memory Protocol driver (hv-balloon 🎈) David Hildenbrand
2023-10-18  8:45   ` Maciej S. Szmigiero
2023-10-18  9:28     ` David Hildenbrand

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=fa0b04e5-33ff-6ba8-db17-4e46640ecc08@redhat.com \
    --to=david@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=eblake@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=mail@maciej.szmigiero.name \
    --cc=marcandre.lureau@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@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).