Logically memory hotplug via guest agent, by enabling/disabling memory blocks.
The corresponding qga commands are: 'guest-get-memory-blocks',
'guest-set-memory-blocks' and 'guest-get-memory-block-info'.
detailed flow:
1 get memory block list, each member has 'phy-index', 'online' and
'can-offline' parameters
2 get memory block size, normally 128MB or 256MB for most OSes
3 convert the target memory size to memory block number, and see if there's enough
memory
blocks to be set online/offline.
4 update the memory block list info, and let guest agent to set memory blocks
online/offline.
Note that because we hotplug memory logically by online/offline MEMORY BLOCKS,
and each memory block has a size much bigger than KiB, there's a deviation
with the range of (0, block_size). block_size may be 128MB or 256MB or etc.,
it differs on different OSes.
Zhang Bo (8):
lifecycle: add flag VIR_DOMAIN_MEM_GUEST for viDomainSetMemoryFlags
qemu: agent: define structure of qemuAgentMemblockInfo
qemu: agent: implement qemuAgentGetMemblocks
qemu: agent: implement qemuAgentGetMemblockGeneralInfo
qemu: agent: implement qemuAgentUpdateMemblocks
qemu: agent: implement function qemuAgetSetMemblocks
qemu: memory: logically hotplug memory with guest agent
virsh: support memory hotplug with guest agent in virsh
include/libvirt/libvirt-domain.h | 1 +
src/libvirt-domain.c | 7 +
src/qemu/qemu_agent.c | 307 +++++++++++++++++++++++++++++++++++++++
src/qemu/qemu_agent.h | 22 +++
src/qemu/qemu_driver.c | 46 +++++-
tools/virsh-domain.c | 10 +-
tools/virsh.pod | 7 +-
7 files changed, 396 insertions(+), 4 deletions(-)
--
1.7.12.4