[PATCH 1/8] lifecycle: add flag VIR_DOMAIN_MEM_GUEST for viDomainSetMemoryFlags

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



just add the flag and description for function virDomainSetMemoryFlags().

Signed-off-by: Zhang Bo <oscar.zhangbo@xxxxxxxxxx>
Signed-off-by: Li Bin <binlibin.li@xxxxxxxxxx>
---
 include/libvirt/libvirt-domain.h | 1 +
 src/libvirt-domain.c             | 4 ++++
 src/qemu/qemu_driver.c           | 3 ++-
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
index d851225..103266a 100644
--- a/include/libvirt/libvirt-domain.h
+++ b/include/libvirt/libvirt-domain.h
@@ -1163,6 +1163,7 @@ typedef enum {
 
     /* Additionally, these flags may be bitwise-OR'd in.  */
     VIR_DOMAIN_MEM_MAXIMUM = (1 << 2), /* affect Max rather than current */
+    VIR_DOMAIN_MEM_GUEST   = (1 << 3), /* logically change memory size in the guest */
 } virDomainMemoryModFlags;
 
 
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index 7e6d749..155fb92 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -1945,6 +1945,10 @@ virDomainSetMemory(virDomainPtr domain, unsigned long memory)
  * on whether just live or both live and persistent state is changed.
  * If VIR_DOMAIN_MEM_MAXIMUM is set, the change affects domain's maximum memory
  * size rather than current memory size.
+ * If VIR_DOMAIN_MEM_GUEST is set, it changes the domain's memory size inside
+ * the guest instead of the hypervisor. This flag can only be used with live guests.
+ * The usage of this flag may require a guest agent configured.
+ *
  * Not all hypervisors can support all flag combinations.
  *
  * Returns 0 in case of success, -1 in case of failure.
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 34e5581..580cd60 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -2310,7 +2310,8 @@ static int qemuDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
 
     virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
                   VIR_DOMAIN_AFFECT_CONFIG |
-                  VIR_DOMAIN_MEM_MAXIMUM, -1);
+                  VIR_DOMAIN_MEM_MAXIMUM |
+                  VIR_DOMAIN_MEM_GUEST, -1);
 
     if (!(vm = qemuDomObjFromDomain(dom)))
         goto cleanup;
-- 
1.7.12.4


--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]