]> xenbits.xensource.com Git - libvirt.git/commitdiff
* include/libvirt.h include/libvirt.h.in doc/*: added new entry point
authorDaniel Veillard <veillard@redhat.com>
Thu, 13 Apr 2006 17:18:49 +0000 (17:18 +0000)
committerDaniel Veillard <veillard@redhat.com>
Thu, 13 Apr 2006 17:18:49 +0000 (17:18 +0000)
  virDomainSetMemory to set up the target memory use for a domain
* src/driver.h src/libvirt.c src/xen_internal.c src/xend_internal.[ch]
  src/xs_internal.[ch]: added a new entry point in the drivers for this,
  also fixed the xen store entry, as changing
  /local/domain/$$/memory/target affects the target memory not the max,
  apparently max is not visible at the xenstore level (or I missed it)
Daniel

21 files changed:
ChangeLog
docs/APIchunk0.html
docs/APIchunk1.html
docs/APIchunk2.html
docs/APIfiles.html
docs/APIfunctions.html
docs/APIsymbols.html
docs/html/libvirt-libvirt.html
docs/libvirt-api.xml
docs/libvirt-refs.xml
include/libvirt.h
include/libvirt.h.in
include/libvirt/libvirt.h
include/libvirt/libvirt.h.in
src/driver.h
src/libvirt.c
src/xen_internal.c
src/xend_internal.c
src/xend_internal.h
src/xs_internal.c
src/xs_internal.h

index ee86491736d641e950b12dcb14b7c44bda2a7cb5..95dcb79595d2b1209e7d3ecaaaa3986172f67c1b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Thu Apr 13 17:19:25 EDT 2006 Daniel Veillard <veillard@redhat.com>
+
+       * include/libvirt.h include/libvirt.h.in doc/*: added new entry point
+         virDomainSetMemory to set up the target memory use for a domain
+       * src/driver.h src/libvirt.c src/xen_internal.c src/xend_internal.[ch]
+         src/xs_internal.[ch]: added a new entry point in the drivers for this,
+         also fixed the xen store entry, as changing
+         /local/domain/$$/memory/target affects the target memory not the max,
+         apparently max is not visible at the xenstore level (or I missed it)
+
 Mon Apr 10 15:15:13 CEST 2006 Daniel Veillard <veillard@redhat.com>
 
        * NEWS configure.in libvirt.spec.in docs/*: documented and
index 63587f9a4f5d18185394fd979151ca581204ad32..0f4367adf9d97a9451b1cba4f247ac7f24fa1dbf 100644 (file)
@@ -18,7 +18,9 @@
 </dd><dt>Destroy</dt><dd><a href="html/libvirt-libvirt.html#virDomainDestroy">virDomainDestroy</a><br />
 </dd><dt>Domain0</dt><dd><a href="html/libvirt-libvirt.html#virDomainGetMaxMemory">virDomainGetMaxMemory</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSetMaxMemory">virDomainSetMaxMemory</a><br />
+<a href="html/libvirt-libvirt.html#virDomainSetMemory">virDomainSetMemory</a><br />
 </dd><dt>Dynamically</dt><dd><a href="html/libvirt-libvirt.html#virDomainSetMaxMemory">virDomainSetMaxMemory</a><br />
+<a href="html/libvirt-libvirt.html#virDomainSetMemory">virDomainSetMemory</a><br />
 </dd></dl><h2>Letter E:</h2><dl><dt>Extract</dt><dd><a href="html/libvirt-libvirt.html#virDomainGetInfo">virDomainGetInfo</a><br />
 <a href="html/libvirt-libvirt.html#virNodeGetInfo">virNodeGetInfo</a><br />
 </dd></dl><h2>Letter F:</h2><dl><dt>Free</dt><dd><a href="html/libvirt-libvirt.html#virDomainFree">virDomainFree</a><br />
@@ -52,6 +54,7 @@
 <a href="html/libvirt-libvirt.html#virDomainLookupByName">virDomainLookupByName</a><br />
 <a href="html/libvirt-libvirt.html#virDomainLookupByUUID">virDomainLookupByUUID</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSetMaxMemory">virDomainSetMaxMemory</a><br />
+<a href="html/libvirt-libvirt.html#virDomainSetMemory">virDomainSetMemory</a><br />
 <a href="html/libvirt-virterror.html#virGetLastError">virGetLastError</a><br />
 <a href="html/libvirt-libvirt.html#virGetVersion">virGetVersion</a><br />
 <a href="html/libvirt-virterror.html#virSetErrorFunc">virSetErrorFunc</a><br />
@@ -93,6 +96,7 @@
 <a href="html/libvirt-libvirt.html#virDomainResume">virDomainResume</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSave">virDomainSave</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSetMaxMemory">virDomainSetMaxMemory</a><br />
+<a href="html/libvirt-libvirt.html#virDomainSetMemory">virDomainSetMemory</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSuspend">virDomainSuspend</a><br />
 </dd><dt>Try</dt><dd><a href="html/libvirt-libvirt.html#virDomainLookupByID">virDomainLookupByID</a><br />
 <a href="html/libvirt-libvirt.html#virDomainLookupByName">virDomainLookupByName</a><br />
 <a href="html/libvirt-libvirt.html#virDomainDestroy">virDomainDestroy</a><br />
 <a href="html/libvirt-libvirt.html#virDomainResume">virDomainResume</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSetMaxMemory">virDomainSetMaxMemory</a><br />
+<a href="html/libvirt-libvirt.html#virDomainSetMemory">virDomainSetMemory</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSuspend">virDomainSuspend</a><br />
 </dd><dt>accesses</dt><dd><a href="html/libvirt-virterror.html#virConnGetLastError">virConnGetLastError</a><br />
 <a href="html/libvirt-virterror.html#virGetLastError">virGetLastError</a><br />
 </dd><dt>allocated</dt><dd><a href="html/libvirt-libvirt.html#virDomainGetInfo">virDomainGetInfo</a><br />
 <a href="html/libvirt-libvirt.html#virDomainGetMaxMemory">virDomainGetMaxMemory</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSetMaxMemory">virDomainSetMaxMemory</a><br />
+<a href="html/libvirt-libvirt.html#virDomainSetMemory">virDomainSetMemory</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSuspend">virDomainSuspend</a><br />
 <a href="html/libvirt-libvirt.html#virNodeGetInfo">virNodeGetInfo</a><br />
 </dd><dt>allowed</dt><dd><a href="html/libvirt-libvirt.html#_virDomainInfo">_virDomainInfo</a><br />
 </dd><dt>already</dt><dd><a href="html/libvirt-libvirt.html#virDomainDestroy">virDomainDestroy</a><br />
 </dd><dt>amount</dt><dd><a href="html/libvirt-libvirt.html#virDomainGetMaxMemory">virDomainGetMaxMemory</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSetMaxMemory">virDomainSetMaxMemory</a><br />
+<a href="html/libvirt-libvirt.html#virDomainSetMemory">virDomainSetMemory</a><br />
 </dd><dt>anymore</dt><dd><a href="html/libvirt-libvirt.html#virDomainSave">virDomainSave</a><br />
 </dd><dt>application</dt><dd><a href="html/libvirt-libvirt.html#virConnectClose">virConnectClose</a><br />
 <a href="html/libvirt-libvirt.html#virDomainGetMaxMemory">virDomainGetMaxMemory</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSetMaxMemory">virDomainSetMaxMemory</a><br />
+<a href="html/libvirt-libvirt.html#virDomainSetMemory">virDomainSetMemory</a><br />
 </dd><dt>applications</dt><dd><a href="html/libvirt-libvirt.html#virInitialize">virInitialize</a><br />
 </dd><dt>are</dt><dd><a href="html/libvirt-libvirt.html#virConnectClose">virConnectClose</a><br />
 <a href="html/libvirt-libvirt.html#virConnectOpenReadOnly">virConnectOpenReadOnly</a><br />
 <a href="html/libvirt-virterror.html#virSetErrorFunc">virSetErrorFunc</a><br />
 </dd><dt>cell</dt><dd><a href="html/libvirt-libvirt.html#_virNodeInfo">_virNodeInfo</a><br />
 </dd><dt>change</dt><dd><a href="html/libvirt-libvirt.html#virDomainSetMaxMemory">virDomainSetMaxMemory</a><br />
+<a href="html/libvirt-libvirt.html#virDomainSetMemory">virDomainSetMemory</a><br />
 </dd><dt>clean</dt><dd><a href="html/libvirt-virterror.html#virResetError">virResetError</a><br />
 </dd><dt>closes</dt><dd><a href="html/libvirt-libvirt.html#virConnectClose">virConnectClose</a><br />
 </dd><dt>code</dt><dd><a href="html/libvirt-virterror.html#_virError">_virError</a><br />
index 47d9fed22469e34b3241b9b283130fc5f1778a85..dfdce2e51c84f8fe7add20ef70ff103ac52ee31e 100644 (file)
@@ -43,6 +43,7 @@
 <a href="html/libvirt-libvirt.html#virDomainResume">virDomainResume</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSave">virDomainSave</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSetMaxMemory">virDomainSetMaxMemory</a><br />
+<a href="html/libvirt-libvirt.html#virDomainSetMemory">virDomainSetMemory</a><br />
 <a href="html/libvirt-libvirt.html#virDomainShutdown">virDomainShutdown</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSuspend">virDomainSuspend</a><br />
 <a href="html/libvirt-libvirt.html#virGetVersion">virGetVersion</a><br />
@@ -93,6 +94,7 @@
 <a href="html/libvirt-libvirt.html#virDomainDestroy">virDomainDestroy</a><br />
 <a href="html/libvirt-libvirt.html#virDomainResume">virDomainResume</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSetMaxMemory">virDomainSetMaxMemory</a><br />
+<a href="html/libvirt-libvirt.html#virDomainSetMemory">virDomainSetMemory</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSuspend">virDomainSuspend</a><br />
 <a href="html/libvirt-virterror.html#virErrorFunc">virErrorFunc</a><br />
 <a href="html/libvirt-virterror.html#virSetErrorFunc">virSetErrorFunc</a><br />
 </dd><dt>kilobytes</dt><dd><a href="html/libvirt-libvirt.html#_virNodeInfo">_virNodeInfo</a><br />
 <a href="html/libvirt-libvirt.html#virDomainGetMaxMemory">virDomainGetMaxMemory</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSetMaxMemory">virDomainSetMaxMemory</a><br />
+<a href="html/libvirt-libvirt.html#virDomainSetMemory">virDomainSetMemory</a><br />
 </dd><dt>knowing</dt><dd><a href="html/libvirt-libvirt.html#virDomainShutdown">virDomainShutdown</a><br />
 </dd></dl><h2>Letter l:</h2><dl><dt>lack</dt><dd><a href="html/libvirt-libvirt.html#virConnectGetVersion">virConnectGetVersion</a><br />
 </dd><dt>last</dt><dd><a href="html/libvirt-virterror.html#virConnCopyLastError">virConnCopyLastError</a><br />
 <a href="html/libvirt-libvirt.html#virDomainReboot">virDomainReboot</a><br />
 <a href="html/libvirt-libvirt.html#virDomainResume">virDomainResume</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSave">virDomainSave</a><br />
+<a href="html/libvirt-libvirt.html#virDomainSetMemory">virDomainSetMemory</a><br />
 <a href="html/libvirt-libvirt.html#virDomainShutdown">virDomainShutdown</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSuspend">virDomainSuspend</a><br />
 <a href="html/libvirt-virterror.html#virGetLastError">virGetLastError</a><br />
 <a href="html/libvirt-libvirt.html#virDomainGetMaxMemory">virDomainGetMaxMemory</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSave">virDomainSave</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSetMaxMemory">virDomainSetMaxMemory</a><br />
+<a href="html/libvirt-libvirt.html#virDomainSetMemory">virDomainSetMemory</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSuspend">virDomainSuspend</a><br />
 </dd><dt>message</dt><dd><a href="html/libvirt-virterror.html#_virError">_virError</a><br />
 </dd><dt>method</dt><dd><a href="html/libvirt-libvirt.html#virDomainRestore">virDomainRestore</a><br />
index 72473307f543024b6d879e5602da4636d66c2c7c..3793d7f629ea3a6221913c32bf59a92e0c00c82c 100644 (file)
@@ -58,6 +58,7 @@
 <a href="html/libvirt-libvirt.html#virDomainResume">virDomainResume</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSave">virDomainSave</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSetMaxMemory">virDomainSetMaxMemory</a><br />
+<a href="html/libvirt-libvirt.html#virDomainSetMemory">virDomainSetMemory</a><br />
 <a href="html/libvirt-libvirt.html#virDomainShutdown">virDomainShutdown</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSuspend">virDomainSuspend</a><br />
 </dd><dt>occured</dt><dd><a href="html/libvirt-virterror.html#virConnGetLastError">virConnGetLastError</a><br />
@@ -92,6 +93,7 @@
 </dd><dt>per</dt><dd><a href="html/libvirt-libvirt.html#_virNodeInfo">_virNodeInfo</a><br />
 </dd><dt>physical</dt><dd><a href="html/libvirt-libvirt.html#virDomainGetMaxMemory">virDomainGetMaxMemory</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSetMaxMemory">virDomainSetMaxMemory</a><br />
+<a href="html/libvirt-libvirt.html#virDomainSetMemory">virDomainSetMemory</a><br />
 </dd><dt>pointed</dt><dd><a href="html/libvirt-virterror.html#virResetError">virResetError</a><br />
 </dd><dt>pointer</dt><dd><a href="html/libvirt-virterror.html#virConnCopyLastError">virConnCopyLastError</a><br />
 <a href="html/libvirt-virterror.html#virConnGetLastError">virConnGetLastError</a><br />
 <a href="html/libvirt-libvirt.html#virDomainDestroy">virDomainDestroy</a><br />
 <a href="html/libvirt-libvirt.html#virDomainResume">virDomainResume</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSetMaxMemory">virDomainSetMaxMemory</a><br />
+<a href="html/libvirt-libvirt.html#virDomainSetMemory">virDomainSetMemory</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSuspend">virDomainSuspend</a><br />
 </dd><dt>problem</dt><dd><a href="html/libvirt-libvirt.html#virDomainSave">virDomainSave</a><br />
 </dd><dt>process</dt><dd><a href="html/libvirt-libvirt.html#virDomainResume">virDomainResume</a><br />
 <a href="html/libvirt-libvirt.html#virDomainDestroy">virDomainDestroy</a><br />
 <a href="html/libvirt-libvirt.html#virDomainResume">virDomainResume</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSetMaxMemory">virDomainSetMaxMemory</a><br />
+<a href="html/libvirt-libvirt.html#virDomainSetMemory">virDomainSetMemory</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSuspend">virDomainSuspend</a><br />
 </dd><dt>reserved</dt><dd><a href="html/libvirt-libvirt.html#virDomainGetMaxMemory">virDomainGetMaxMemory</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSetMaxMemory">virDomainSetMaxMemory</a><br />
+<a href="html/libvirt-libvirt.html#virDomainSetMemory">virDomainSetMemory</a><br />
 </dd><dt>reset</dt><dd><a href="html/libvirt-virterror.html#virConnSetErrorFunc">virConnSetErrorFunc</a><br />
 <a href="html/libvirt-virterror.html#virSetErrorFunc">virSetErrorFunc</a><br />
 </dd><dt>resources</dt><dd><a href="html/libvirt-libvirt.html#virDomainDestroy">virDomainDestroy</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSave">virDomainSave</a><br />
 </dd><dt>runs</dt><dd><a href="html/libvirt-libvirt.html#virDomainGetMaxMemory">virDomainGetMaxMemory</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSetMaxMemory">virDomainSetMaxMemory</a><br />
+<a href="html/libvirt-libvirt.html#virDomainSetMemory">virDomainSetMemory</a><br />
 </dd></dl><h2>Letter s:</h2><dl><dt>same</dt><dd><a href="html/libvirt-libvirt.html#virDomainGetName">virDomainGetName</a><br />
 </dd><dt>save</dt><dd><a href="html/libvirt-libvirt.html#virDomainSave">virDomainSave</a><br />
 </dd><dt>saved</dt><dd><a href="html/libvirt-libvirt.html#virDomainRestore">virDomainRestore</a><br />
 <a href="html/libvirt-libvirt.html#virConnectListDomains">virConnectListDomains</a><br />
 <a href="html/libvirt-libvirt.html#virDomainGetMaxMemory">virDomainGetMaxMemory</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSetMaxMemory">virDomainSetMaxMemory</a><br />
+<a href="html/libvirt-libvirt.html#virDomainSetMemory">virDomainSetMemory</a><br />
 </dd><dt>socket</dt><dd><a href="html/libvirt-libvirt.html#_virNodeInfo">_virNodeInfo</a><br />
 </dd><dt>software</dt><dd><a href="html/libvirt-libvirt.html#virConnectGetType">virConnectGetType</a><br />
 </dd><dt>startup</dt><dd><a href="html/libvirt-libvirt.html#virInitialize">virInitialize</a><br />
 <a href="html/libvirt-libvirt.html#virDomainResume">virDomainResume</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSave">virDomainSave</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSetMaxMemory">virDomainSetMaxMemory</a><br />
+<a href="html/libvirt-libvirt.html#virDomainSetMemory">virDomainSetMemory</a><br />
 <a href="html/libvirt-libvirt.html#virDomainShutdown">virDomainShutdown</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSuspend">virDomainSuspend</a><br />
 <a href="html/libvirt-libvirt.html#virInitialize">virInitialize</a><br />
index dbf3b0e94c7fdbe7fe7cf39f4b6e3bc3f14fbc24..865e4bdea14f35781d9cbf17742f3d2e72e43224 100644 (file)
@@ -56,6 +56,7 @@
 <a href="html/libvirt-libvirt.html#virDomainResume">virDomainResume</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSave">virDomainSave</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSetMaxMemory">virDomainSetMaxMemory</a><br />
+<a href="html/libvirt-libvirt.html#virDomainSetMemory">virDomainSetMemory</a><br />
 <a href="html/libvirt-libvirt.html#virDomainShutdown">virDomainShutdown</a><br />
 <a href="html/libvirt-libvirt.html#virDomainState">virDomainState</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSuspend">virDomainSuspend</a><br />
index 27170a689eacf78d6fa4eefa8f1168ccc0a41076..fd6a23c09c788b49a038add7b222838f1036b726 100644 (file)
@@ -6,6 +6,7 @@
 </p><h2>Type unsigned int:</h2><p><a href="html/libvirt-libvirt.html#virDomainCreateLinux">virDomainCreateLinux</a><br />
 <a href="html/libvirt-libvirt.html#virDomainReboot">virDomainReboot</a><br />
 </p><h2>Type unsigned long:</h2><p><a href="html/libvirt-libvirt.html#virDomainSetMaxMemory">virDomainSetMaxMemory</a><br />
+<a href="html/libvirt-libvirt.html#virDomainSetMemory">virDomainSetMemory</a><br />
 </p><h2>Type unsigned long *:</h2><p><a href="html/libvirt-libvirt.html#virConnectGetVersion">virConnectGetVersion</a><br />
 <a href="html/libvirt-libvirt.html#virGetVersion">virGetVersion</a><br />
 </p><h2>Type virConnectPtr:</h2><p><a href="html/libvirt-virterror.html#virConnCopyLastError">virConnCopyLastError</a><br />
@@ -37,6 +38,7 @@
 <a href="html/libvirt-libvirt.html#virDomainResume">virDomainResume</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSave">virDomainSave</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSetMaxMemory">virDomainSetMaxMemory</a><br />
+<a href="html/libvirt-libvirt.html#virDomainSetMemory">virDomainSetMemory</a><br />
 <a href="html/libvirt-libvirt.html#virDomainShutdown">virDomainShutdown</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSuspend">virDomainSuspend</a><br />
 </p><h2>Type virErrorFunc:</h2><p><a href="html/libvirt-virterror.html#virConnSetErrorFunc">virConnSetErrorFunc</a><br />
index c44eb90909a10ac3ace73170ce608cdb019225ff..7269a2de50bd51bd1b7c539629e1ad44a1a893be 100644 (file)
 <a href="html/libvirt-libvirt.html#virDomainResume">virDomainResume</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSave">virDomainSave</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSetMaxMemory">virDomainSetMaxMemory</a><br />
+<a href="html/libvirt-libvirt.html#virDomainSetMemory">virDomainSetMemory</a><br />
 <a href="html/libvirt-libvirt.html#virDomainShutdown">virDomainShutdown</a><br />
 <a href="html/libvirt-libvirt.html#virDomainState">virDomainState</a><br />
 <a href="html/libvirt-libvirt.html#virDomainSuspend">virDomainSuspend</a><br />
index cb9be52be178f77e7c137012bdf3e82b0efad450..691ae37dfd7a4824b2b9ba800e8ba27465d9fd1f 100644 (file)
@@ -41,6 +41,7 @@ The content of this structure is not made public by the API.
 <pre class="programlisting">int        <a href="#virDomainResume">virDomainResume</a>                  (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)</pre>
 <pre class="programlisting">int        <a href="#virDomainSave">virDomainSave</a>                      (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     const char * to)</pre>
 <pre class="programlisting">int        <a href="#virDomainSetMaxMemory">virDomainSetMaxMemory</a>              (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned long memory)</pre>
+<pre class="programlisting">int        <a href="#virDomainSetMemory">virDomainSetMemory</a>            (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned long memory)</pre>
 <pre class="programlisting">int        <a href="#virDomainShutdown">virDomainShutdown</a>              (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)</pre>
 <pre class="programlisting">int        <a href="#virDomainSuspend">virDomainSuspend</a>                (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)</pre>
 <pre class="programlisting">int        <a href="#virGetVersion">virGetVersion</a>                      (unsigned long * libVer, <br />                                  const char * type, <br />                                       unsigned long * typeVer)</pre>
@@ -156,6 +157,8 @@ The content of this structure is not made public by the API.
 </pre><p>This method will suspend a domain and save its memory contents to a file on disk. After the call, if successful, the domain is not listed as running anymore (this may be a problem). Use virDomainRestore() to restore a domain after saving.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>to</tt></i>:</span></td><td>path for the output file</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainSetMaxMemory" id="virDomainSetMaxMemory"></a>Function: virDomainSetMaxMemory</h3><pre class="programlisting">int     virDomainSetMaxMemory           (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned long memory)<br />
 </pre><p>Dynamically change the maximum amount of physical memory allocated to a domain. If domain is NULL, then this change the amount of memory reserved to Domain0 i.e. the domain where the application runs. This function requires priviledged access to the hypervisor.</p>
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object or NULL</td></tr><tr><td><span class="term"><i><tt>memory</tt></i>:</span></td><td>the memory size in kilobytes</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainSetMemory" id="virDomainSetMemory"></a>Function: virDomainSetMemory</h3><pre class="programlisting">int      virDomainSetMemory              (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned long memory)<br />
+</pre><p>Dynamically change the target amount of physical memory allocated to a domain. If domain is NULL, then this change the amount of memory reserved to Domain0 i.e. the domain where the application runs. This function may requires priviledged access to the hypervisor.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object or NULL</td></tr><tr><td><span class="term"><i><tt>memory</tt></i>:</span></td><td>the memory size in kilobytes</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainShutdown" id="virDomainShutdown"></a>Function: virDomainShutdown</h3><pre class="programlisting">int virDomainShutdown               (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br />
 </pre><p>Shutdown a domain, the domain object is still usable there after but the domain OS is being stopped. Note that the guest OS may ignore the request. TODO: should we add an option for reboot, knowing it may not be doable in the general case ?</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainSuspend" id="virDomainSuspend"></a>Function: virDomainSuspend</h3><pre class="programlisting">int    virDomainSuspend                (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br />
index a69776bac740f11e416f3cfaa51e9dffcdfe10f0..348820374773eac37c8ed6488068d3bf748f4fe2 100644 (file)
@@ -65,6 +65,7 @@
      <exports symbol='virDomainGetID' type='function'/>
      <exports symbol='virDomainResume' type='function'/>
      <exports symbol='virDomainCreateLinux' type='function'/>
+     <exports symbol='virDomainSetMemory' type='function'/>
      <exports symbol='virDomainDestroy' type='function'/>
      <exports symbol='virDomainGetXMLDesc' type='function'/>
      <exports symbol='virDomainGetName' type='function'/>
       <arg name='domain' type='virDomainPtr' info='a domain object or NULL'/>
       <arg name='memory' type='unsigned long' info='the memory size in kilobytes'/>
     </function>
+    <function name='virDomainSetMemory' file='libvirt' module='libvirt'>
+      <info>Dynamically change the target amount of physical memory allocated to a domain. If domain is NULL, then this change the amount of memory reserved to Domain0 i.e. the domain where the application runs. This function may requires priviledged access to the hypervisor.</info>
+      <return type='int' info='0 in case of success and -1 in case of failure.'/>
+      <arg name='domain' type='virDomainPtr' info='a domain object or NULL'/>
+      <arg name='memory' type='unsigned long' info='the memory size in kilobytes'/>
+    </function>
     <function name='virDomainShutdown' file='libvirt' module='libvirt'>
       <info>Shutdown a domain, the domain object is still usable there after but the domain OS is being stopped. Note that the guest OS may ignore the request.  TODO: should we add an option for reboot, knowing it may not be doable in the general case ?</info>
       <return type='int' info='0 in case of success and -1 in case of failure.'/>
index e58a67f117ef3861417fd2531557095c576c6832..7c52d1808837440f4baddb055a454456beecbd1b 100644 (file)
     <reference name='virDomainResume' href='html/libvirt-libvirt.html#virDomainResume'/>
     <reference name='virDomainSave' href='html/libvirt-libvirt.html#virDomainSave'/>
     <reference name='virDomainSetMaxMemory' href='html/libvirt-libvirt.html#virDomainSetMaxMemory'/>
+    <reference name='virDomainSetMemory' href='html/libvirt-libvirt.html#virDomainSetMemory'/>
     <reference name='virDomainShutdown' href='html/libvirt-libvirt.html#virDomainShutdown'/>
     <reference name='virDomainState' href='html/libvirt-libvirt.html#virDomainState'/>
     <reference name='virDomainSuspend' href='html/libvirt-libvirt.html#virDomainSuspend'/>
       <ref name='virDomainResume'/>
       <ref name='virDomainSave'/>
       <ref name='virDomainSetMaxMemory'/>
+      <ref name='virDomainSetMemory'/>
       <ref name='virDomainShutdown'/>
       <ref name='virDomainState'/>
       <ref name='virDomainSuspend'/>
     </type>
     <type name='unsigned long'>
       <ref name='virDomainSetMaxMemory'/>
+      <ref name='virDomainSetMemory'/>
     </type>
     <type name='unsigned long *'>
       <ref name='virConnectGetVersion'/>
       <ref name='virDomainResume'/>
       <ref name='virDomainSave'/>
       <ref name='virDomainSetMaxMemory'/>
+      <ref name='virDomainSetMemory'/>
       <ref name='virDomainShutdown'/>
       <ref name='virDomainSuspend'/>
     </type>
       <ref name='virDomainResume'/>
       <ref name='virDomainSave'/>
       <ref name='virDomainSetMaxMemory'/>
+      <ref name='virDomainSetMemory'/>
       <ref name='virDomainShutdown'/>
       <ref name='virDomainState'/>
       <ref name='virDomainSuspend'/>
         <word name='Domain0'>
           <ref name='virDomainGetMaxMemory'/>
           <ref name='virDomainSetMaxMemory'/>
+          <ref name='virDomainSetMemory'/>
         </word>
         <word name='Dynamically'>
           <ref name='virDomainSetMaxMemory'/>
+          <ref name='virDomainSetMemory'/>
         </word>
       </letter>
       <letter name='E'>
           <ref name='virDomainLookupByName'/>
           <ref name='virDomainLookupByUUID'/>
           <ref name='virDomainSetMaxMemory'/>
+          <ref name='virDomainSetMemory'/>
           <ref name='virGetLastError'/>
           <ref name='virGetVersion'/>
           <ref name='virSetErrorFunc'/>
           <ref name='virDomainResume'/>
           <ref name='virDomainSave'/>
           <ref name='virDomainSetMaxMemory'/>
+          <ref name='virDomainSetMemory'/>
           <ref name='virDomainSuspend'/>
         </word>
         <word name='Try'>
           <ref name='virDomainDestroy'/>
           <ref name='virDomainResume'/>
           <ref name='virDomainSetMaxMemory'/>
+          <ref name='virDomainSetMemory'/>
           <ref name='virDomainSuspend'/>
         </word>
         <word name='accesses'>
           <ref name='virDomainGetInfo'/>
           <ref name='virDomainGetMaxMemory'/>
           <ref name='virDomainSetMaxMemory'/>
+          <ref name='virDomainSetMemory'/>
           <ref name='virDomainSuspend'/>
           <ref name='virNodeGetInfo'/>
         </word>
         <word name='amount'>
           <ref name='virDomainGetMaxMemory'/>
           <ref name='virDomainSetMaxMemory'/>
+          <ref name='virDomainSetMemory'/>
         </word>
         <word name='anymore'>
           <ref name='virDomainSave'/>
           <ref name='virConnectClose'/>
           <ref name='virDomainGetMaxMemory'/>
           <ref name='virDomainSetMaxMemory'/>
+          <ref name='virDomainSetMemory'/>
         </word>
         <word name='applications'>
           <ref name='virInitialize'/>
         </word>
         <word name='change'>
           <ref name='virDomainSetMaxMemory'/>
+          <ref name='virDomainSetMemory'/>
         </word>
         <word name='clean'>
           <ref name='virResetError'/>
           <ref name='virDomainResume'/>
           <ref name='virDomainSave'/>
           <ref name='virDomainSetMaxMemory'/>
+          <ref name='virDomainSetMemory'/>
           <ref name='virDomainShutdown'/>
           <ref name='virDomainSuspend'/>
           <ref name='virGetVersion'/>
           <ref name='virDomainDestroy'/>
           <ref name='virDomainResume'/>
           <ref name='virDomainSetMaxMemory'/>
+          <ref name='virDomainSetMemory'/>
           <ref name='virDomainSuspend'/>
           <ref name='virErrorFunc'/>
           <ref name='virSetErrorFunc'/>
           <ref name='_virNodeInfo'/>
           <ref name='virDomainGetMaxMemory'/>
           <ref name='virDomainSetMaxMemory'/>
+          <ref name='virDomainSetMemory'/>
         </word>
         <word name='knowing'>
           <ref name='virDomainShutdown'/>
           <ref name='virDomainReboot'/>
           <ref name='virDomainResume'/>
           <ref name='virDomainSave'/>
+          <ref name='virDomainSetMemory'/>
           <ref name='virDomainShutdown'/>
           <ref name='virDomainSuspend'/>
           <ref name='virGetLastError'/>
           <ref name='virDomainGetMaxMemory'/>
           <ref name='virDomainSave'/>
           <ref name='virDomainSetMaxMemory'/>
+          <ref name='virDomainSetMemory'/>
           <ref name='virDomainSuspend'/>
         </word>
         <word name='message'>
           <ref name='virDomainResume'/>
           <ref name='virDomainSave'/>
           <ref name='virDomainSetMaxMemory'/>
+          <ref name='virDomainSetMemory'/>
           <ref name='virDomainShutdown'/>
           <ref name='virDomainSuspend'/>
         </word>
         <word name='physical'>
           <ref name='virDomainGetMaxMemory'/>
           <ref name='virDomainSetMaxMemory'/>
+          <ref name='virDomainSetMemory'/>
         </word>
         <word name='pointed'>
           <ref name='virResetError'/>
           <ref name='virDomainDestroy'/>
           <ref name='virDomainResume'/>
           <ref name='virDomainSetMaxMemory'/>
+          <ref name='virDomainSetMemory'/>
           <ref name='virDomainSuspend'/>
         </word>
         <word name='problem'>
           <ref name='virDomainDestroy'/>
           <ref name='virDomainResume'/>
           <ref name='virDomainSetMaxMemory'/>
+          <ref name='virDomainSetMemory'/>
           <ref name='virDomainSuspend'/>
         </word>
         <word name='reserved'>
           <ref name='virDomainGetMaxMemory'/>
           <ref name='virDomainSetMaxMemory'/>
+          <ref name='virDomainSetMemory'/>
         </word>
         <word name='reset'>
           <ref name='virConnSetErrorFunc'/>
         <word name='runs'>
           <ref name='virDomainGetMaxMemory'/>
           <ref name='virDomainSetMaxMemory'/>
+          <ref name='virDomainSetMemory'/>
         </word>
       </letter>
       <letter name='s'>
           <ref name='virConnectListDomains'/>
           <ref name='virDomainGetMaxMemory'/>
           <ref name='virDomainSetMaxMemory'/>
+          <ref name='virDomainSetMemory'/>
         </word>
         <word name='socket'>
           <ref name='_virNodeInfo'/>
           <ref name='virDomainResume'/>
           <ref name='virDomainSave'/>
           <ref name='virDomainSetMaxMemory'/>
+          <ref name='virDomainSetMemory'/>
           <ref name='virDomainShutdown'/>
           <ref name='virDomainSuspend'/>
           <ref name='virInitialize'/>
         <word name='target'>
           <ref name='virConnCopyLastError'/>
           <ref name='virCopyLastError'/>
+          <ref name='virDomainSetMemory'/>
         </word>
         <word name='terminated'>
           <ref name='virConnectGetType'/>
           <ref name='virConnectOpenReadOnly'/>
           <ref name='virDomainGetMaxMemory'/>
           <ref name='virDomainSetMaxMemory'/>
+          <ref name='virDomainSetMemory'/>
         </word>
         <word name='there'>
           <ref name='virConnectClose'/>
           <ref name='virDomainGetMaxMemory'/>
           <ref name='virDomainSave'/>
           <ref name='virDomainSetMaxMemory'/>
+          <ref name='virDomainSetMemory'/>
           <ref name='virInitialize'/>
         </word>
         <word name='those'>
           <ref name='virDomainGetMaxMemory'/>
           <ref name='virDomainResume'/>
           <ref name='virDomainSetMaxMemory'/>
+          <ref name='virDomainSetMemory'/>
         </word>
         <word name='which'>
           <ref name='virConnGetLastError'/>
index fd5cf3ac80cc9d485a4152b0893a42ea26af1b23..f1848d06360749933cfd03eebcc4578aafc770ec 100644 (file)
@@ -266,6 +266,8 @@ char *                      virDomainGetOSType      (virDomainPtr domain);
 unsigned long          virDomainGetMaxMemory   (virDomainPtr domain);
 int                    virDomainSetMaxMemory   (virDomainPtr domain,
                                                 unsigned long memory);
+int                    virDomainSetMemory      (virDomainPtr domain,
+                                                unsigned long memory);
 /*
  * XML domain description
  */
index f90292f5ee643790b4a7ae8643c9a238f3083733..d4dc2a24bc91908d5914902de34b2787edbac542 100644 (file)
@@ -266,6 +266,8 @@ char *                      virDomainGetOSType      (virDomainPtr domain);
 unsigned long          virDomainGetMaxMemory   (virDomainPtr domain);
 int                    virDomainSetMaxMemory   (virDomainPtr domain,
                                                 unsigned long memory);
+int                    virDomainSetMemory      (virDomainPtr domain,
+                                                unsigned long memory);
 /*
  * XML domain description
  */
index fd5cf3ac80cc9d485a4152b0893a42ea26af1b23..f1848d06360749933cfd03eebcc4578aafc770ec 100644 (file)
@@ -266,6 +266,8 @@ char *                      virDomainGetOSType      (virDomainPtr domain);
 unsigned long          virDomainGetMaxMemory   (virDomainPtr domain);
 int                    virDomainSetMaxMemory   (virDomainPtr domain,
                                                 unsigned long memory);
+int                    virDomainSetMemory      (virDomainPtr domain,
+                                                unsigned long memory);
 /*
  * XML domain description
  */
index f90292f5ee643790b4a7ae8643c9a238f3083733..d4dc2a24bc91908d5914902de34b2787edbac542 100644 (file)
@@ -266,6 +266,8 @@ char *                      virDomainGetOSType      (virDomainPtr domain);
 unsigned long          virDomainGetMaxMemory   (virDomainPtr domain);
 int                    virDomainSetMaxMemory   (virDomainPtr domain,
                                                 unsigned long memory);
+int                    virDomainSetMemory      (virDomainPtr domain,
+                                                unsigned long memory);
 /*
  * XML domain description
  */
index 5489e7fcba094955871dff947aa9a784b47d6787..17c8cec318c37457009e0a1c887e9658b498b563 100644 (file)
@@ -80,6 +80,9 @@ typedef unsigned long
 typedef int
        (*virDrvDomainSetMaxMemory)     (virDomainPtr domain,
                                         unsigned long memory);
+typedef int
+       (*virDrvDomainSetMemory)        (virDomainPtr domain,
+                                        unsigned long memory);
 typedef int
        (*virDrvDomainGetInfo)          (virDomainPtr domain,
                                         virDomainInfoPtr info);
@@ -125,6 +128,7 @@ struct _virDriver {
        virDrvDomainGetOSType           domainGetOSType;
        virDrvDomainGetMaxMemory        domainGetMaxMemory;
        virDrvDomainSetMaxMemory        domainSetMaxMemory;
+       virDrvDomainSetMemory           domainSetMemory;
        virDrvDomainGetInfo             domainGetInfo;
        virDrvDomainSave                domainSave;
        virDrvDomainRestore             domainRestore;
index 5f5365cc51fd907cbe0360c0f3812587c96ca580..6692fb43473c2765a1737029e9687a0fdc330e5d 100644 (file)
@@ -610,7 +610,7 @@ virDomainLookupByID(virConnectPtr conn, int id)
     if (name == NULL)
         goto error;
 
-    ret = virGetDomain(conn, name, &uuid[0]);
+    ret = virGetDomain(conn, name, (const char *)&uuid[0]);
     if (ret == NULL) {
         virLibConnError(conn, VIR_ERR_NO_MEMORY, "Allocating domain");
         goto error;
@@ -678,7 +678,7 @@ virDomainLookupByUUID(virConnectPtr conn, const unsigned char *uuid)
     if (name == NULL)
         return (NULL);
 
-    ret = virGetDomain(conn, name, &uuid[0]);
+    ret = virGetDomain(conn, name, (const char *)&uuid[0]);
     if (ret == NULL) {
         if (name != NULL)
             free(name);
@@ -1188,8 +1188,8 @@ virDomainGetMaxMemory(virDomainPtr domain)
 int
 virDomainSetMaxMemory(virDomainPtr domain, unsigned long memory)
 {
-    int ret;
-    char s[256], v[30];
+    int ret = -1 , i;
+    virConnectPtr conn;
 
     if (memory < 4096) {
         virLibDomainError(domain, VIR_ERR_INVALID_ARG, __FUNCTION__);
@@ -1203,32 +1203,77 @@ virDomainSetMaxMemory(virDomainPtr domain, unsigned long memory)
         virLibDomainError(domain, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
         return (-1);
     }
+    conn = domain->conn;
     if (domain->conn->flags & VIR_CONNECT_RO)
         return (-1);
 
-    ret = xenDaemonDomainSetMaxMemory(domain, memory);
-    if (ret == 0)
-        return(0);
-
-    ret = xenHypervisorSetMaxMemory(domain, memory);
-    if (ret < 0)
+    /*
+     * in that case instead of trying only though one method try all availble.
+     * If needed that can be changed back if it's a performcance problem.
+     */
+    for (i = 0;i < conn->nb_drivers;i++) {
+       if ((conn->drivers[i] != NULL) &&
+           (conn->drivers[i]->domainSetMaxMemory != NULL)) {
+           if (conn->drivers[i]->domainSetMaxMemory(domain, memory) == 0)
+               ret = 0;
+       }
+    }
+    if (ret != 0) {
+        virLibConnError(conn, VIR_ERR_CALL_FAILED, __FUNCTION__);
         return (-1);
+    }
+    return (ret);
+}
 
-    if (domain->conn->xshandle != NULL) {
-       /*
-        * try to update at the Xenstore level too
-        * Failing to do so should not be considered fatal though as long
-        * as the hypervisor call succeeded
-        */
-       snprintf(s, 255, "/local/domain/%d/memory/target", domain->handle);
-       s[255] = 0;
-       snprintf(v, 29, "%lu", memory);
-       v[30] = 0;
+/**
+ * virDomainSetMemory:
+ * @domain: a domain object or NULL
+ * @memory: the memory size in kilobytes
+ * 
+ * Dynamically change the target amount of physical memory allocated to a
+ * domain. If domain is NULL, then this change the amount of memory reserved
+ * to Domain0 i.e. the domain where the application runs.
+ * This function may requires priviledged access to the hypervisor.
+ *
+ * Returns 0 in case of success and -1 in case of failure.
+ */
+int
+virDomainSetMemory(virDomainPtr domain, unsigned long memory)
+{
+    int ret = -1 , i;
+    virConnectPtr conn;
 
-       if (!xs_write(domain->conn->xshandle, 0, &s[0], &v[0], strlen(v)))
-           ret = -1;
+    if (memory < 4096) {
+        virLibDomainError(domain, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        return (-1);
+    }
+    if (domain == NULL) {
+        TODO
+       return (-1);
+    }
+    if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
+        virLibDomainError(domain, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+        return (-1);
     }
+    conn = domain->conn;
+    if (domain->conn->flags & VIR_CONNECT_RO)
+        return (-1);
 
+    /*
+     * in that case instead of trying only though one method try all availble.
+     * If needed that can be changed back if it's a performcance problem.
+     */
+    for (i = 0;i < conn->nb_drivers;i++) {
+       if ((conn->drivers[i] != NULL) &&
+           (conn->drivers[i]->domainSetMemory != NULL)) {
+           if (conn->drivers[i]->domainSetMemory(domain, memory) == 0)
+               ret = 0;
+       }
+    }
+    if (ret != 0) {
+        virLibConnError(conn, VIR_ERR_CALL_FAILED, __FUNCTION__);
+        return (-1);
+    }
     return (ret);
 }
 
index b579831367e8cc46f844d8ada9f293a3ff58f93e..8a99cf6204ff9334042e8c77c14f116d4cd1d318 100644 (file)
@@ -66,6 +66,7 @@ static virDriver xenHypervisorDriver = {
     NULL, /* domainGetOSType */
     NULL, /* domainGetMaxMemory */
     xenHypervisorSetMaxMemory, /* domainSetMaxMemory */
+    NULL, /* domainSetMemory */
     xenHypervisorGetDomainInfo, /* domainGetInfo */
     NULL, /* domainSave */
     NULL /* domainRestore */
index baa2ed397fc6ecab5146f681ff12c3209c2a01a9..cb0ef70db26e883f6c801ffae5a7c33c577de8f2 100644 (file)
@@ -64,6 +64,7 @@ static virDriver xenDaemonDriver = {
     NULL, /* domainGetOSType */
     NULL, /* domainGetMaxMemory */
     xenDaemonDomainSetMaxMemory, /* domainSetMaxMemory */
+    xenDaemonDomainSetMemory, /* domainMaxMemory */
     xenDaemonDomainGetInfo, /* domainGetInfo */
     xenDaemonDomainSave, /* domainSave */
     xenDaemonDomainRestore /* domainRestore */
@@ -1081,34 +1082,6 @@ xenDaemonDomainCreateLinux(virConnectPtr xend, const char *sexpr)
     return ret;
 }
 
-/**
- * xend_set_memory:
- * @xend: A xend instance
- * @name: The name of the domain
- * @value: The desired allocation in bytes
- *
- * This method will set a target memory allocation for a given domain and
- * request that the guest meet this target.  The guest may or may not actually
- * achieve this target.  When this function returns, it does not signify that
- * the domain has actually reached that target.
- *
- * Memory for a domain can only be allocated up to the maximum memory setting.
- * There is no safe guard for allocations that are too small so be careful
- * when using this function to reduce a domain's memory usage.
- *
- * Returns 0 for success; -1 (with errno) on error
- */
-int
-xend_set_memory(virConnectPtr xend, const char *name, uint64_t value)
-{
-    char buf[1024];
-
-    snprintf(buf, sizeof(buf), "%llu", value >> 20);
-    return xend_op(xend, name, "op", "mem_target_set", "target", buf,
-                   NULL);
-}
-
-
 /**
  * xenDaemonDomainLookupByName_ids:
  * @xend: A xend instance
@@ -1886,8 +1859,7 @@ xenDaemonDomainGetMaxMemory(virDomainPtr domain)
  *
  * This method will set the maximum amount of memory that can be allocated to
  * a domain.  Please note that a domain is able to allocate up to this amount
- * on its own (although under normal circumstances, memory allocation for a
- * domain is only done through xend_set_memory()).
+ * on its own.
  *
  * Returns 0 for success; -1 (with errno) on error
  */
@@ -1906,6 +1878,37 @@ xenDaemonDomainSetMaxMemory(virDomainPtr domain, unsigned long memory)
                    buf, NULL);
 }
 
+/**
+ * xenDaemonDomainSetMemory:
+ * @domain: pointer to the Domain block
+ * @memory: The target memory in kilobytes
+ *
+ * This method will set a target memory allocation for a given domain and
+ * request that the guest meet this target.  The guest may or may not actually
+ * achieve this target.  When this function returns, it does not signify that
+ * the domain has actually reached that target.
+ *
+ * Memory for a domain can only be allocated up to the maximum memory setting.
+ * There is no safe guard for allocations that are too small so be careful
+ * when using this function to reduce a domain's memory usage.
+ *
+ * Returns 0 for success; -1 (with errno) on error
+ */
+int
+xenDaemonDomainSetMemory(virDomainPtr domain, unsigned long memory)
+{
+    char buf[1024];
+
+    if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
+        virXendError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG,
+                    __FUNCTION__);
+        return(-1);
+    }
+    snprintf(buf, sizeof(buf), "%lu", memory >> 10);
+    return xend_op(domain->conn, domain->name, "op", "mem_target_set",
+                   "target", buf, NULL);
+}
+
 /**
  * xenDaemonDomainDumpXML:
  * @domain: a domain object
index 1deead8d6619508b1204af413840ae2c9aca5789..e00c482d966316478279f3fff13b6dfec60c110b 100644 (file)
@@ -531,25 +531,6 @@ int xenDaemonOpen_unix(virConnectPtr xend, const char *path);
  */
     int xenDaemonDomainCreateLinux(virConnectPtr xend, const char *sexpr);
 
-/**
- * \brief Set the memory allocation for a domain
- * \param xend A xend instance
- * \param name The name of the domain
- * \param value The desired allocation in bytes
- * \return 0 for success; -1 (with errno) on error
- *
- * This method will set a target memory allocation for a given domain and
- * request that the guest meet this target.  The guest may or may not actually
- * achieve this target.  When this function returns, it does not signify that
- * the domain has actually reached that target.
- *
- * Memory for a domain can only be allocated up to the maximum memory setting.
- * There is no safe guard for allocations that are too small so be careful
- * when using this function to reduce a domain's memory usage.
- */
-    int xend_set_memory(virConnectPtr xend, const char *name,
-                        uint64_t value);
-
 /**
  * \brief Lookup the id of a domain
  * \param xend A xend instance
@@ -559,7 +540,7 @@ int xenDaemonOpen_unix(virConnectPtr xend, const char *path);
  *
  * This method looks up the ids of a domain
  */
-    int xenDaemonDomainLookupByName_ids(virConnectPtr xend,
+int xenDaemonDomainLookupByName_ids(virConnectPtr xend,
                             const char *name, unsigned char *uuid);
 
 
@@ -636,6 +617,7 @@ int xenDaemonDomainReboot(virDomainPtr domain, unsigned int flags);
 int xenDaemonDomainDestroy(virDomainPtr domain);
 int xenDaemonDomainSave(virDomainPtr domain, const char *filename);
 int xenDaemonDomainRestore(virConnectPtr conn, const char *filename);
+int xenDaemonDomainSetMemory(virDomainPtr domain, unsigned long memory);
 int xenDaemonDomainSetMaxMemory(virDomainPtr domain, unsigned long memory);
 int xenDaemonDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info);
 char *xenDaemonDomainDumpXML(virDomainPtr domain);
index 9785261f4cf68c7a3122fde9f687c30438e33307..b31f91d28705309a02a6c916a6d7f093aadfffd3 100644 (file)
@@ -55,7 +55,8 @@ static virDriver xenStoreDriver = {
     NULL, /* domainGetUUID */
     NULL, /* domainGetOSType */
     xenStoreDomainGetMaxMemory, /* domainGetMaxMemory */
-    xenStoreDomainSetMaxMemory, /* domainSetMaxMemory */
+    NULL, /* domainSetMaxMemory */
+    xenStoreDomainSetMemory, /* domainSetMemory */
     xenStoreGetDomainInfo, /* domainGetInfo */
     NULL, /* domainSave */
     NULL /* domainRestore */
@@ -385,7 +386,7 @@ xenStoreGetDomainInfo(virDomainPtr domain, virDomainInfoPtr info)
 }
 
 /**
- * xenStoreDomainSetMaxMemory:
+ * xenStoreDomainSetMemory:
  * @domain: pointer to the domain block
  * @memory: the max memory size in kilobytes.
  *
@@ -394,7 +395,7 @@ xenStoreGetDomainInfo(virDomainPtr domain, virDomainInfoPtr info)
  * Returns 0 in case of success, -1 in case of error.
  */
 int
-xenStoreDomainSetMaxMemory(virDomainPtr domain, unsigned long memory)
+xenStoreDomainSetMemory(virDomainPtr domain, unsigned long memory)
 {
     int ret;
     char value[20];
index 17c1d1c32e2ecdce9ed4e43990285817c671b84a..dcdb4e125c535e2bd966bf688e591f8761d3c0d9 100644 (file)
@@ -29,7 +29,7 @@ int           xenStoreListDomains     (virConnectPtr conn,
 virDomainPtr   xenStoreDomainLookupByName(virConnectPtr conn,
                                         const char *name);
 unsigned long  xenStoreGetMaxMemory    (virDomainPtr domain);
-int            xenStoreDomainSetMaxMemory(virDomainPtr domain,
+int            xenStoreDomainSetMemory (virDomainPtr domain,
                                         unsigned long memory);
 unsigned long  xenStoreDomainGetMaxMemory(virDomainPtr domain);
 int            xenStoreDomainShutdown  (virDomainPtr domain);