mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
* 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) Daniel
This commit is contained in:
parent
cb8f47047b
commit
e081236077
10
ChangeLog
10
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
|
||||
|
@ -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 />
|
||||
@ -114,6 +118,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 />
|
||||
</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 />
|
||||
@ -131,16 +136,19 @@
|
||||
</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 />
|
||||
@ -201,6 +209,7 @@
|
||||
<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 />
|
||||
|
@ -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 />
|
||||
@ -148,6 +150,7 @@
|
||||
</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 />
|
||||
@ -194,6 +197,7 @@
|
||||
<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 />
|
||||
@ -203,6 +207,7 @@
|
||||
<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 />
|
||||
|
@ -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 />
|
||||
@ -125,6 +127,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 />
|
||||
</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 />
|
||||
@ -154,9 +157,11 @@
|
||||
<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 />
|
||||
@ -187,6 +192,7 @@
|
||||
<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 />
|
||||
@ -207,6 +213,7 @@
|
||||
<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 />
|
||||
@ -242,6 +249,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#virInitialize">virInitialize</a><br />
|
||||
|
@ -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 />
|
||||
|
@ -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 />
|
||||
|
@ -100,6 +100,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 />
|
||||
|
@ -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 />
|
||||
|
@ -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'/>
|
||||
@ -421,6 +422,12 @@
|
||||
<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.'/>
|
||||
|
@ -101,6 +101,7 @@
|
||||
<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'/>
|
||||
@ -228,6 +229,7 @@
|
||||
<ref name='virDomainResume'/>
|
||||
<ref name='virDomainSave'/>
|
||||
<ref name='virDomainSetMaxMemory'/>
|
||||
<ref name='virDomainSetMemory'/>
|
||||
<ref name='virDomainShutdown'/>
|
||||
<ref name='virDomainState'/>
|
||||
<ref name='virDomainSuspend'/>
|
||||
@ -286,6 +288,7 @@
|
||||
</type>
|
||||
<type name='unsigned long'>
|
||||
<ref name='virDomainSetMaxMemory'/>
|
||||
<ref name='virDomainSetMemory'/>
|
||||
</type>
|
||||
<type name='unsigned long *'>
|
||||
<ref name='virConnectGetVersion'/>
|
||||
@ -325,6 +328,7 @@
|
||||
<ref name='virDomainResume'/>
|
||||
<ref name='virDomainSave'/>
|
||||
<ref name='virDomainSetMaxMemory'/>
|
||||
<ref name='virDomainSetMemory'/>
|
||||
<ref name='virDomainShutdown'/>
|
||||
<ref name='virDomainSuspend'/>
|
||||
</type>
|
||||
@ -406,6 +410,7 @@
|
||||
<ref name='virDomainResume'/>
|
||||
<ref name='virDomainSave'/>
|
||||
<ref name='virDomainSetMaxMemory'/>
|
||||
<ref name='virDomainSetMemory'/>
|
||||
<ref name='virDomainShutdown'/>
|
||||
<ref name='virDomainState'/>
|
||||
<ref name='virDomainSuspend'/>
|
||||
@ -510,9 +515,11 @@
|
||||
<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'>
|
||||
@ -586,6 +593,7 @@
|
||||
<ref name='virDomainLookupByName'/>
|
||||
<ref name='virDomainLookupByUUID'/>
|
||||
<ref name='virDomainSetMaxMemory'/>
|
||||
<ref name='virDomainSetMemory'/>
|
||||
<ref name='virGetLastError'/>
|
||||
<ref name='virGetVersion'/>
|
||||
<ref name='virSetErrorFunc'/>
|
||||
@ -673,6 +681,7 @@
|
||||
<ref name='virDomainResume'/>
|
||||
<ref name='virDomainSave'/>
|
||||
<ref name='virDomainSetMaxMemory'/>
|
||||
<ref name='virDomainSetMemory'/>
|
||||
<ref name='virDomainSuspend'/>
|
||||
</word>
|
||||
<word name='Try'>
|
||||
@ -720,6 +729,7 @@
|
||||
<ref name='virDomainDestroy'/>
|
||||
<ref name='virDomainResume'/>
|
||||
<ref name='virDomainSetMaxMemory'/>
|
||||
<ref name='virDomainSetMemory'/>
|
||||
<ref name='virDomainSuspend'/>
|
||||
</word>
|
||||
<word name='accesses'>
|
||||
@ -753,6 +763,7 @@
|
||||
<ref name='virDomainGetInfo'/>
|
||||
<ref name='virDomainGetMaxMemory'/>
|
||||
<ref name='virDomainSetMaxMemory'/>
|
||||
<ref name='virDomainSetMemory'/>
|
||||
<ref name='virDomainSuspend'/>
|
||||
<ref name='virNodeGetInfo'/>
|
||||
</word>
|
||||
@ -765,6 +776,7 @@
|
||||
<word name='amount'>
|
||||
<ref name='virDomainGetMaxMemory'/>
|
||||
<ref name='virDomainSetMaxMemory'/>
|
||||
<ref name='virDomainSetMemory'/>
|
||||
</word>
|
||||
<word name='anymore'>
|
||||
<ref name='virDomainSave'/>
|
||||
@ -773,6 +785,7 @@
|
||||
<ref name='virConnectClose'/>
|
||||
<ref name='virDomainGetMaxMemory'/>
|
||||
<ref name='virDomainSetMaxMemory'/>
|
||||
<ref name='virDomainSetMemory'/>
|
||||
</word>
|
||||
<word name='applications'>
|
||||
<ref name='virInitialize'/>
|
||||
@ -887,6 +900,7 @@
|
||||
</word>
|
||||
<word name='change'>
|
||||
<ref name='virDomainSetMaxMemory'/>
|
||||
<ref name='virDomainSetMemory'/>
|
||||
</word>
|
||||
<word name='clean'>
|
||||
<ref name='virResetError'/>
|
||||
@ -1038,6 +1052,7 @@
|
||||
<ref name='virDomainResume'/>
|
||||
<ref name='virDomainSave'/>
|
||||
<ref name='virDomainSetMaxMemory'/>
|
||||
<ref name='virDomainSetMemory'/>
|
||||
<ref name='virDomainShutdown'/>
|
||||
<ref name='virDomainSuspend'/>
|
||||
<ref name='virGetVersion'/>
|
||||
@ -1116,6 +1131,7 @@
|
||||
<ref name='virDomainDestroy'/>
|
||||
<ref name='virDomainResume'/>
|
||||
<ref name='virDomainSetMaxMemory'/>
|
||||
<ref name='virDomainSetMemory'/>
|
||||
<ref name='virDomainSuspend'/>
|
||||
<ref name='virErrorFunc'/>
|
||||
<ref name='virSetErrorFunc'/>
|
||||
@ -1235,6 +1251,7 @@
|
||||
<ref name='_virNodeInfo'/>
|
||||
<ref name='virDomainGetMaxMemory'/>
|
||||
<ref name='virDomainSetMaxMemory'/>
|
||||
<ref name='virDomainSetMemory'/>
|
||||
</word>
|
||||
<word name='knowing'>
|
||||
<ref name='virDomainShutdown'/>
|
||||
@ -1317,6 +1334,7 @@
|
||||
<ref name='virDomainReboot'/>
|
||||
<ref name='virDomainResume'/>
|
||||
<ref name='virDomainSave'/>
|
||||
<ref name='virDomainSetMemory'/>
|
||||
<ref name='virDomainShutdown'/>
|
||||
<ref name='virDomainSuspend'/>
|
||||
<ref name='virGetLastError'/>
|
||||
@ -1330,6 +1348,7 @@
|
||||
<ref name='virDomainGetMaxMemory'/>
|
||||
<ref name='virDomainSave'/>
|
||||
<ref name='virDomainSetMaxMemory'/>
|
||||
<ref name='virDomainSetMemory'/>
|
||||
<ref name='virDomainSuspend'/>
|
||||
</word>
|
||||
<word name='message'>
|
||||
@ -1444,6 +1463,7 @@
|
||||
<ref name='virDomainResume'/>
|
||||
<ref name='virDomainSave'/>
|
||||
<ref name='virDomainSetMaxMemory'/>
|
||||
<ref name='virDomainSetMemory'/>
|
||||
<ref name='virDomainShutdown'/>
|
||||
<ref name='virDomainSuspend'/>
|
||||
</word>
|
||||
@ -1512,6 +1532,7 @@
|
||||
<word name='physical'>
|
||||
<ref name='virDomainGetMaxMemory'/>
|
||||
<ref name='virDomainSetMaxMemory'/>
|
||||
<ref name='virDomainSetMemory'/>
|
||||
</word>
|
||||
<word name='pointed'>
|
||||
<ref name='virResetError'/>
|
||||
@ -1557,6 +1578,7 @@
|
||||
<ref name='virDomainDestroy'/>
|
||||
<ref name='virDomainResume'/>
|
||||
<ref name='virDomainSetMaxMemory'/>
|
||||
<ref name='virDomainSetMemory'/>
|
||||
<ref name='virDomainSuspend'/>
|
||||
</word>
|
||||
<word name='problem'>
|
||||
@ -1620,11 +1642,13 @@
|
||||
<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'/>
|
||||
@ -1685,6 +1709,7 @@
|
||||
<word name='runs'>
|
||||
<ref name='virDomainGetMaxMemory'/>
|
||||
<ref name='virDomainSetMaxMemory'/>
|
||||
<ref name='virDomainSetMemory'/>
|
||||
</word>
|
||||
</letter>
|
||||
<letter name='s'>
|
||||
@ -1725,6 +1750,7 @@
|
||||
<ref name='virConnectListDomains'/>
|
||||
<ref name='virDomainGetMaxMemory'/>
|
||||
<ref name='virDomainSetMaxMemory'/>
|
||||
<ref name='virDomainSetMemory'/>
|
||||
</word>
|
||||
<word name='socket'>
|
||||
<ref name='_virNodeInfo'/>
|
||||
@ -1786,6 +1812,7 @@
|
||||
<ref name='virDomainResume'/>
|
||||
<ref name='virDomainSave'/>
|
||||
<ref name='virDomainSetMaxMemory'/>
|
||||
<ref name='virDomainSetMemory'/>
|
||||
<ref name='virDomainShutdown'/>
|
||||
<ref name='virDomainSuspend'/>
|
||||
<ref name='virInitialize'/>
|
||||
@ -1814,6 +1841,7 @@
|
||||
<word name='target'>
|
||||
<ref name='virConnCopyLastError'/>
|
||||
<ref name='virCopyLastError'/>
|
||||
<ref name='virDomainSetMemory'/>
|
||||
</word>
|
||||
<word name='terminated'>
|
||||
<ref name='virConnectGetType'/>
|
||||
@ -1835,6 +1863,7 @@
|
||||
<ref name='virConnectOpenReadOnly'/>
|
||||
<ref name='virDomainGetMaxMemory'/>
|
||||
<ref name='virDomainSetMaxMemory'/>
|
||||
<ref name='virDomainSetMemory'/>
|
||||
</word>
|
||||
<word name='there'>
|
||||
<ref name='virConnectClose'/>
|
||||
@ -1852,6 +1881,7 @@
|
||||
<ref name='virDomainGetMaxMemory'/>
|
||||
<ref name='virDomainSave'/>
|
||||
<ref name='virDomainSetMaxMemory'/>
|
||||
<ref name='virDomainSetMemory'/>
|
||||
<ref name='virInitialize'/>
|
||||
</word>
|
||||
<word name='those'>
|
||||
@ -1990,6 +2020,7 @@
|
||||
<ref name='virDomainGetMaxMemory'/>
|
||||
<ref name='virDomainResume'/>
|
||||
<ref name='virDomainSetMaxMemory'/>
|
||||
<ref name='virDomainSetMemory'/>
|
||||
</word>
|
||||
<word name='which'>
|
||||
<ref name='virConnGetLastError'/>
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
/*
|
||||
* 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);
|
||||
}
|
||||
|
||||
ret = xenHypervisorSetMaxMemory(domain, memory);
|
||||
if (ret < 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 (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);
|
||||
|
||||
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;
|
||||
|
||||
if (!xs_write(domain->conn->xshandle, 0, &s[0], &v[0], strlen(v)))
|
||||
ret = -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);
|
||||
}
|
||||
|
||||
|
@ -66,6 +66,7 @@ static virDriver xenHypervisorDriver = {
|
||||
NULL, /* domainGetOSType */
|
||||
NULL, /* domainGetMaxMemory */
|
||||
xenHypervisorSetMaxMemory, /* domainSetMaxMemory */
|
||||
NULL, /* domainSetMemory */
|
||||
xenHypervisorGetDomainInfo, /* domainGetInfo */
|
||||
NULL, /* domainSave */
|
||||
NULL /* domainRestore */
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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];
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user