diff options
author | 2006-01-25 09:46:22 +0000 | |
---|---|---|
committer | 2006-01-25 09:46:22 +0000 | |
commit | b64c353863d171e078da512b88b19f3458775c6b (patch) | |
tree | 7e0abe34613438f43f3d31f9092b84219aac6ecb | |
parent | * src/libvir.c: Karel pointed out handle was lost in (diff) | |
download | libvirt-b64c353863d171e078da512b88b19f3458775c6b.tar.gz libvirt-b64c353863d171e078da512b88b19f3458775c6b.tar.bz2 libvirt-b64c353863d171e078da512b88b19f3458775c6b.zip |
add xshandle checks, fix virsh grammar
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | docs/APIchunk0.html | 2 | ||||
-rw-r--r-- | docs/APIchunk1.html | 2 | ||||
-rw-r--r-- | docs/APIchunk2.html | 2 | ||||
-rw-r--r-- | docs/APIconstructors.html | 2 | ||||
-rw-r--r-- | docs/APIfiles.html | 2 | ||||
-rw-r--r-- | docs/APIfunctions.html | 2 | ||||
-rw-r--r-- | docs/APIsymbols.html | 2 | ||||
-rw-r--r-- | docs/html/book1.html | 2 | ||||
-rw-r--r-- | docs/html/index.html | 2 | ||||
-rw-r--r-- | docs/html/libvir-lib.html | 2 | ||||
-rw-r--r-- | docs/html/libvir-libvir.html | 4 | ||||
-rw-r--r-- | docs/index.html | 3 | ||||
-rw-r--r-- | src/libvir.c | 59 | ||||
-rw-r--r-- | src/libvir_sym.version | 2 | ||||
-rw-r--r-- | src/virsh.c | 117 |
16 files changed, 137 insertions, 74 deletions
@@ -1,3 +1,9 @@ +Tue Jan 24 11:44:53 CET 2006 Karel Zak <kzak@redhat.com> + + * src/libvir_sym.version: add virDeomainRestore and virDomainSave + * src/virsh.c: support '=' in options, fix command grammar + * src/libvir.c: add conn->xshandle checks + Tue Jan 24 14:09:37 CET 2006 Daniel Veillard <veillard@redhat.com> * src/libvir.c: Karel pointed out handle was lost in diff --git a/docs/APIchunk0.html b/docs/APIchunk0.html index 0e4e12d15..373d5d78e 100644 --- a/docs/APIchunk0.html +++ b/docs/APIchunk0.html @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="stylesheet" type="text/css" href="libvir.css" /><title>API Alphabetic Index A-f for libvir</title></head><body><div id="container"><div id="intro"><div id="adjustments"></div><div id="pageHeader"></div><div id="content2"><h1 class="style1">API Alphabetic Index A-f for libvir</h1><h2 align="center"><a href="APIchunk0.html">A-f</a> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="stylesheet" type="text/css" href="libvir.css" /><link rel="SHORTCUT ICON" href="/32favicon.png" /><title>API Alphabetic Index A-f for libvir</title></head><body><div id="container"><div id="intro"><div id="adjustments"></div><div id="pageHeader"></div><div id="content2"><h1 class="style1">API Alphabetic Index A-f for libvir</h1><h2 align="center"><a href="APIchunk0.html">A-f</a> <a href="APIchunk1.html">g-r</a> <a href="APIchunk2.html">s-z</a> </h2><h2>Letter A:</h2><dl><dt>ABI</dt><dd><a href="html/libvir-libvir.html#_virDomainInfo">_virDomainInfo</a><br /> diff --git a/docs/APIchunk1.html b/docs/APIchunk1.html index 769fd43a6..e1628cbb7 100644 --- a/docs/APIchunk1.html +++ b/docs/APIchunk1.html @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="stylesheet" type="text/css" href="libvir.css" /><title>API Alphabetic Index g-r for libvir</title></head><body><div id="container"><div id="intro"><div id="adjustments"></div><div id="pageHeader"></div><div id="content2"><h1 class="style1">API Alphabetic Index g-r for libvir</h1><h2 align="center"><a href="APIchunk0.html">A-f</a> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="stylesheet" type="text/css" href="libvir.css" /><link rel="SHORTCUT ICON" href="/32favicon.png" /><title>API Alphabetic Index g-r for libvir</title></head><body><div id="container"><div id="intro"><div id="adjustments"></div><div id="pageHeader"></div><div id="content2"><h1 class="style1">API Alphabetic Index g-r for libvir</h1><h2 align="center"><a href="APIchunk0.html">A-f</a> <a href="APIchunk1.html">g-r</a> <a href="APIchunk2.html">s-z</a> </h2><h2>Letter g:</h2><dl><dt>general</dt><dd><a href="html/libvir-libvir.html#virDomainShutdown">virDomainShutdown</a><br /> diff --git a/docs/APIchunk2.html b/docs/APIchunk2.html index 43e4e64dd..e87e8c165 100644 --- a/docs/APIchunk2.html +++ b/docs/APIchunk2.html @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="stylesheet" type="text/css" href="libvir.css" /><title>API Alphabetic Index s-z for libvir</title></head><body><div id="container"><div id="intro"><div id="adjustments"></div><div id="pageHeader"></div><div id="content2"><h1 class="style1">API Alphabetic Index s-z for libvir</h1><h2 align="center"><a href="APIchunk0.html">A-f</a> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="stylesheet" type="text/css" href="libvir.css" /><link rel="SHORTCUT ICON" href="/32favicon.png" /><title>API Alphabetic Index s-z for libvir</title></head><body><div id="container"><div id="intro"><div id="adjustments"></div><div id="pageHeader"></div><div id="content2"><h1 class="style1">API Alphabetic Index s-z for libvir</h1><h2 align="center"><a href="APIchunk0.html">A-f</a> <a href="APIchunk1.html">g-r</a> <a href="APIchunk2.html">s-z</a> </h2><h2>Letter s:</h2><dl><dt>same</dt><dd><a href="html/libvir-libvir.html#virDomainGetName">virDomainGetName</a><br /> diff --git a/docs/APIconstructors.html b/docs/APIconstructors.html index 7874c394f..fe3b2e18d 100644 --- a/docs/APIconstructors.html +++ b/docs/APIconstructors.html @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="stylesheet" type="text/css" href="libvir.css" /><title>List of constructors for libvir</title></head><body><div id="container"><div id="intro"><div id="adjustments"></div><div id="pageHeader"></div><div id="content2"><h1 class="style1">List of constructors for libvir</h1><h2>Type unsigned int:</h2><p><a href="html/libvir-libvir.html#virDomainGetID">virDomainGetID</a><br /> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="stylesheet" type="text/css" href="libvir.css" /><link rel="SHORTCUT ICON" href="/32favicon.png" /><title>List of constructors for libvir</title></head><body><div id="container"><div id="intro"><div id="adjustments"></div><div id="pageHeader"></div><div id="content2"><h1 class="style1">List of constructors for libvir</h1><h2>Type unsigned int:</h2><p><a href="html/libvir-libvir.html#virDomainGetID">virDomainGetID</a><br /> </p><h2>Type unsigned long:</h2><p><a href="html/libvir-libvir.html#virDomainGetMaxMemory">virDomainGetMaxMemory</a><br /> </p><h2>Type virConnectPtr:</h2><p><a href="html/libvir-libvir.html#virConnectOpen">virConnectOpen</a><br /> <a href="html/libvir-libvir.html#virConnectOpenReadOnly">virConnectOpenReadOnly</a><br /> diff --git a/docs/APIfiles.html b/docs/APIfiles.html index 12606aa56..04f2e9e76 100644 --- a/docs/APIfiles.html +++ b/docs/APIfiles.html @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="stylesheet" type="text/css" href="libvir.css" /><title>List of Symbols per Module for libvir</title></head><body><div id="container"><div id="intro"><div id="adjustments"></div><div id="pageHeader"></div><div id="content2"><h1 class="style1">List of Symbols per Module for libvir</h1><h2><a name="libvir" id="libvir">Module libvir</a>:</h2><p><a href="html/libvir-libvir.html#LIBVIR_VERSION_NUMBER">LIBVIR_VERSION_NUMBER</a><br /> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="stylesheet" type="text/css" href="libvir.css" /><link rel="SHORTCUT ICON" href="/32favicon.png" /><title>List of Symbols per Module for libvir</title></head><body><div id="container"><div id="intro"><div id="adjustments"></div><div id="pageHeader"></div><div id="content2"><h1 class="style1">List of Symbols per Module for libvir</h1><h2><a name="libvir" id="libvir">Module libvir</a>:</h2><p><a href="html/libvir-libvir.html#LIBVIR_VERSION_NUMBER">LIBVIR_VERSION_NUMBER</a><br /> <a href="html/libvir-libvir.html#VIR_DEVICE_DEFAULT">VIR_DEVICE_DEFAULT</a><br /> <a href="html/libvir-libvir.html#VIR_DEVICE_RO">VIR_DEVICE_RO</a><br /> <a href="html/libvir-libvir.html#VIR_DEVICE_RW">VIR_DEVICE_RW</a><br /> diff --git a/docs/APIfunctions.html b/docs/APIfunctions.html index ddfd268a7..2d2d4aa7e 100644 --- a/docs/APIfunctions.html +++ b/docs/APIfunctions.html @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="stylesheet" type="text/css" href="libvir.css" /><title>List of function manipulating types in libvir</title></head><body><div id="container"><div id="intro"><div id="adjustments"></div><div id="pageHeader"></div><div id="content2"><h1 class="style1">List of function manipulating types in libvir</h1><h2>Type int *:</h2><p><a href="html/libvir-libvir.html#virConnectListDomains">virConnectListDomains</a><br /> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="stylesheet" type="text/css" href="libvir.css" /><link rel="SHORTCUT ICON" href="/32favicon.png" /><title>List of function manipulating types in libvir</title></head><body><div id="container"><div id="intro"><div id="adjustments"></div><div id="pageHeader"></div><div id="content2"><h1 class="style1">List of function manipulating types in libvir</h1><h2>Type int *:</h2><p><a href="html/libvir-libvir.html#virConnectListDomains">virConnectListDomains</a><br /> </p><h2>Type unsigned int:</h2><p><a href="html/libvir-libvir.html#virDomainCreateLinux">virDomainCreateLinux</a><br /> </p><h2>Type unsigned long:</h2><p><a href="html/libvir-libvir.html#virDomainCreateLinux">virDomainCreateLinux</a><br /> <a href="html/libvir-libvir.html#virDomainSetMaxMemory">virDomainSetMaxMemory</a><br /> diff --git a/docs/APIsymbols.html b/docs/APIsymbols.html index 0102184f5..0758d2a51 100644 --- a/docs/APIsymbols.html +++ b/docs/APIsymbols.html @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="stylesheet" type="text/css" href="libvir.css" /><title>Alphabetic List of Symbols in libvir</title></head><body><div id="container"><div id="intro"><div id="adjustments"></div><div id="pageHeader"></div><div id="content2"><h1 class="style1">Alphabetic List of Symbols in libvir</h1><h2>Letter L:</h2><p><a href="html/libvir-libvir.html#LIBVIR_VERSION_NUMBER">LIBVIR_VERSION_NUMBER</a><br /> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="stylesheet" type="text/css" href="libvir.css" /><link rel="SHORTCUT ICON" href="/32favicon.png" /><title>Alphabetic List of Symbols in libvir</title></head><body><div id="container"><div id="intro"><div id="adjustments"></div><div id="pageHeader"></div><div id="content2"><h1 class="style1">Alphabetic List of Symbols in libvir</h1><h2>Letter L:</h2><p><a href="html/libvir-libvir.html#LIBVIR_VERSION_NUMBER">LIBVIR_VERSION_NUMBER</a><br /> </p><h2>Letter V:</h2><p><a href="html/libvir-libvir.html#VIR_DEVICE_DEFAULT">VIR_DEVICE_DEFAULT</a><br /> <a href="html/libvir-libvir.html#VIR_DEVICE_RO">VIR_DEVICE_RO</a><br /> <a href="html/libvir-libvir.html#VIR_DEVICE_RW">VIR_DEVICE_RW</a><br /> diff --git a/docs/html/book1.html b/docs/html/book1.html index 60519eb0b..b612a9dc1 100644 --- a/docs/html/book1.html +++ b/docs/html/book1.html @@ -1,3 +1,3 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="stylesheet" type="text/css" href="../libvir.css" /><title>Reference Manual for libvir</title></head><body><div id="container"><div id="intro"><div id="adjustments"></div><div id="pageHeader"></div><div id="content2"><h1 class="style1">Reference Manual for libvir</h1><h2>Table of Contents</h2><ul><li><a href="libvir-libvir.html">libvir</a>: core interfaces for the libvir library</li></ul></div></div><div class="linkList2"><div class="llinks2"><h3 class="links2"><span>main menu</span></h3><ul><li><a href="../index.html">Home</a></li><li><a style="font-weight:bold" href="html/index.html">API Menu</a></li><li><a href="ChangeLog.html">Recent Changes</a></li></ul></div><div class="llinks2"><h3 class="links2"><span>related links</span></h3><ul><li><a href="https://www.redhat.com/archives/libvir-list/">Mail archive</a></li><li><a href="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html">Xen project</a></li><li><form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="12" value="Search..." /><input name="submit" type="submit" value="Go" /></form></li><li><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-90x34.gif" alt="Made with Libxml2 Logo" /></a></li></ul></div></div><div id="bottom"><p class="p1"></p></div></div></body></html> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="stylesheet" type="text/css" href="../libvir.css" /><link rel="SHORTCUT ICON" href="/32favicon.png" /><title>Reference Manual for libvir</title></head><body><div id="container"><div id="intro"><div id="adjustments"></div><div id="pageHeader"></div><div id="content2"><h1 class="style1">Reference Manual for libvir</h1><h2>Table of Contents</h2><ul><li><a href="libvir-libvir.html">libvir</a>: core interfaces for the libvir library</li></ul></div></div><div class="linkList2"><div class="llinks2"><h3 class="links2"><span>main menu</span></h3><ul><li><a href="../index.html">Home</a></li><li><a style="font-weight:bold" href="../html/index.html">API Menu</a></li><li><a href="../ChangeLog.html">Recent Changes</a></li></ul></div><div class="llinks2"><h3 class="links2"><span>related links</span></h3><ul><li><a href="https://www.redhat.com/archives/libvir-list/">Mail archive</a></li><li><a href="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html">Xen project</a></li><li><form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="12" value="Search..." /><input name="submit" type="submit" value="Go" /></form></li><li><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-90x34.gif" alt="Made with Libxml2 Logo" /></a></li></ul></div></div><div id="bottom"><p class="p1"></p></div></div></body></html> diff --git a/docs/html/index.html b/docs/html/index.html index 60519eb0b..b612a9dc1 100644 --- a/docs/html/index.html +++ b/docs/html/index.html @@ -1,3 +1,3 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="stylesheet" type="text/css" href="../libvir.css" /><title>Reference Manual for libvir</title></head><body><div id="container"><div id="intro"><div id="adjustments"></div><div id="pageHeader"></div><div id="content2"><h1 class="style1">Reference Manual for libvir</h1><h2>Table of Contents</h2><ul><li><a href="libvir-libvir.html">libvir</a>: core interfaces for the libvir library</li></ul></div></div><div class="linkList2"><div class="llinks2"><h3 class="links2"><span>main menu</span></h3><ul><li><a href="../index.html">Home</a></li><li><a style="font-weight:bold" href="html/index.html">API Menu</a></li><li><a href="ChangeLog.html">Recent Changes</a></li></ul></div><div class="llinks2"><h3 class="links2"><span>related links</span></h3><ul><li><a href="https://www.redhat.com/archives/libvir-list/">Mail archive</a></li><li><a href="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html">Xen project</a></li><li><form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="12" value="Search..." /><input name="submit" type="submit" value="Go" /></form></li><li><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-90x34.gif" alt="Made with Libxml2 Logo" /></a></li></ul></div></div><div id="bottom"><p class="p1"></p></div></div></body></html> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="stylesheet" type="text/css" href="../libvir.css" /><link rel="SHORTCUT ICON" href="/32favicon.png" /><title>Reference Manual for libvir</title></head><body><div id="container"><div id="intro"><div id="adjustments"></div><div id="pageHeader"></div><div id="content2"><h1 class="style1">Reference Manual for libvir</h1><h2>Table of Contents</h2><ul><li><a href="libvir-libvir.html">libvir</a>: core interfaces for the libvir library</li></ul></div></div><div class="linkList2"><div class="llinks2"><h3 class="links2"><span>main menu</span></h3><ul><li><a href="../index.html">Home</a></li><li><a style="font-weight:bold" href="../html/index.html">API Menu</a></li><li><a href="../ChangeLog.html">Recent Changes</a></li></ul></div><div class="llinks2"><h3 class="links2"><span>related links</span></h3><ul><li><a href="https://www.redhat.com/archives/libvir-list/">Mail archive</a></li><li><a href="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html">Xen project</a></li><li><form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="12" value="Search..." /><input name="submit" type="submit" value="Go" /></form></li><li><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-90x34.gif" alt="Made with Libxml2 Logo" /></a></li></ul></div></div><div id="bottom"><p class="p1"></p></div></div></body></html> diff --git a/docs/html/libvir-lib.html b/docs/html/libvir-lib.html index 60519eb0b..b612a9dc1 100644 --- a/docs/html/libvir-lib.html +++ b/docs/html/libvir-lib.html @@ -1,3 +1,3 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="stylesheet" type="text/css" href="../libvir.css" /><title>Reference Manual for libvir</title></head><body><div id="container"><div id="intro"><div id="adjustments"></div><div id="pageHeader"></div><div id="content2"><h1 class="style1">Reference Manual for libvir</h1><h2>Table of Contents</h2><ul><li><a href="libvir-libvir.html">libvir</a>: core interfaces for the libvir library</li></ul></div></div><div class="linkList2"><div class="llinks2"><h3 class="links2"><span>main menu</span></h3><ul><li><a href="../index.html">Home</a></li><li><a style="font-weight:bold" href="html/index.html">API Menu</a></li><li><a href="ChangeLog.html">Recent Changes</a></li></ul></div><div class="llinks2"><h3 class="links2"><span>related links</span></h3><ul><li><a href="https://www.redhat.com/archives/libvir-list/">Mail archive</a></li><li><a href="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html">Xen project</a></li><li><form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="12" value="Search..." /><input name="submit" type="submit" value="Go" /></form></li><li><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-90x34.gif" alt="Made with Libxml2 Logo" /></a></li></ul></div></div><div id="bottom"><p class="p1"></p></div></div></body></html> +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="stylesheet" type="text/css" href="../libvir.css" /><link rel="SHORTCUT ICON" href="/32favicon.png" /><title>Reference Manual for libvir</title></head><body><div id="container"><div id="intro"><div id="adjustments"></div><div id="pageHeader"></div><div id="content2"><h1 class="style1">Reference Manual for libvir</h1><h2>Table of Contents</h2><ul><li><a href="libvir-libvir.html">libvir</a>: core interfaces for the libvir library</li></ul></div></div><div class="linkList2"><div class="llinks2"><h3 class="links2"><span>main menu</span></h3><ul><li><a href="../index.html">Home</a></li><li><a style="font-weight:bold" href="../html/index.html">API Menu</a></li><li><a href="../ChangeLog.html">Recent Changes</a></li></ul></div><div class="llinks2"><h3 class="links2"><span>related links</span></h3><ul><li><a href="https://www.redhat.com/archives/libvir-list/">Mail archive</a></li><li><a href="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html">Xen project</a></li><li><form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="12" value="Search..." /><input name="submit" type="submit" value="Go" /></form></li><li><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-90x34.gif" alt="Made with Libxml2 Logo" /></a></li></ul></div></div><div id="bottom"><p class="p1"></p></div></div></body></html> diff --git a/docs/html/libvir-libvir.html b/docs/html/libvir-libvir.html index 3cca872e6..8b32257b3 100644 --- a/docs/html/libvir-libvir.html +++ b/docs/html/libvir-libvir.html @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="stylesheet" type="text/css" href="../libvir.css" /><title>Module libvir from libvir</title></head><body><div id="container"><div id="intro"><div id="adjustments"></div><div id="pageHeader"></div><div id="content2"><h1 class="style1">Module libvir from libvir</h1><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="u" href="index.html"><img src="up.png" width="24" height="24" border="0" alt="Up" /></a></td><th align="left"><a href="index.html">API documentation</a></th><td><a accesskey="h" href="../index.html"><img src="home.png" width="24" height="24" border="0" alt="Home" /></a></td><th align="center"><a href="../index.html">The virtualization API</a></th></tr></table><p>Provides the interfaces of the libvir library to handle Xen domains from a process running in domain 0 </p><h2>Table of Contents</h2><pre class="programlisting">#define <a href="#LIBVIR_VERSION_NUMBER">LIBVIR_VERSION_NUMBER</a></pre><pre class="programlisting">Structure <a href="#virConnect">virConnect</a><br />struct _virConnect +<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="stylesheet" type="text/css" href="../libvir.css" /><link rel="SHORTCUT ICON" href="/32favicon.png" /><title>Module libvir from libvir</title></head><body><div id="container"><div id="intro"><div id="adjustments"></div><div id="pageHeader"></div><div id="content2"><h1 class="style1">Module libvir from libvir</h1><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="u" href="index.html"><img src="up.png" width="24" height="24" border="0" alt="Up" /></a></td><th align="left"><a href="index.html">API documentation</a></th><td><a accesskey="h" href="../index.html"><img src="home.png" width="24" height="24" border="0" alt="Home" /></a></td><th align="center"><a href="../index.html">The virtualization API</a></th></tr></table><p>Provides the interfaces of the libvir library to handle Xen domains from a process running in domain 0 </p><h2>Table of Contents</h2><pre class="programlisting">#define <a href="#LIBVIR_VERSION_NUMBER">LIBVIR_VERSION_NUMBER</a></pre><pre class="programlisting">Structure <a href="#virConnect">virConnect</a><br />struct _virConnect The content of this structure is not made public by the API. </pre><pre class="programlisting">Typedef <a href="libvir-libvir.html#virConnect">virConnect</a> * <a name="virConnectPtr" id="virConnectPtr">virConnectPtr</a> </pre><pre class="programlisting">Enum <a href="#virDeviceMode">virDeviceMode</a> @@ -138,4 +138,4 @@ The content of this structure is not made public by the API. </pre><p>Suspends an active domain, the process is frozen without further access to CPU resources and I/O but the memory used by the domain at the hypervisor level will stay allocated. Use virDomainResume() to reactivate the domain. This function may requires priviledged access.</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="virGetVersion" id="virGetVersion"></a>Function: virGetVersion</h3><pre class="programlisting">int virGetVersion (unsigned long * libVer, <br /> const char * type, <br /> unsigned long * typeVer)<br /> </pre><p>Provides two information back, @libVer is the version of the library while @typeVer will be the version of the hypervisor type @type against which the library was compiled. If @type is NULL, "Xen" is assumed, if @type is unknown or not availble, an error code will be returned and @typeVer will be 0.</p> -<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>libVer</tt></i>:</span></td><td>return value for the library version (OUT)</td></tr><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td>hypervisor type</td></tr><tr><td><span class="term"><i><tt>typeVer</tt></i>:</span></td><td>return value for the version of the hypervisor (OUT)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of failure, 0 otherwise, and values for @libVer and @typeVer have the format major * 1,000,000 + minor * 1,000 + release.</td></tr></tbody></table></div></div></div><div class="linkList2"><div class="llinks2"><h3 class="links2"><span>main menu</span></h3><ul><li><a href="../index.html">Home</a></li><li><a style="font-weight:bold" href="html/index.html">API Menu</a></li><li><a href="ChangeLog.html">Recent Changes</a></li></ul></div><div class="llinks2"><h3 class="links2"><span>related links</span></h3><ul><li><a href="https://www.redhat.com/archives/libvir-list/">Mail archive</a></li><li><a href="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html">Xen project</a></li><li><form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="12" value="Search..." /><input name="submit" type="submit" value="Go" /></form></li><li><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-90x34.gif" alt="Made with Libxml2 Logo" /></a></li></ul></div></div><div id="bottom"><p class="p1"></p></div></div></body></html> +<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>libVer</tt></i>:</span></td><td>return value for the library version (OUT)</td></tr><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td>hypervisor type</td></tr><tr><td><span class="term"><i><tt>typeVer</tt></i>:</span></td><td>return value for the version of the hypervisor (OUT)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of failure, 0 otherwise, and values for @libVer and @typeVer have the format major * 1,000,000 + minor * 1,000 + release.</td></tr></tbody></table></div></div></div><div class="linkList2"><div class="llinks2"><h3 class="links2"><span>main menu</span></h3><ul><li><a href="../index.html">Home</a></li><li><a style="font-weight:bold" href="../html/index.html">API Menu</a></li><li><a href="../ChangeLog.html">Recent Changes</a></li></ul></div><div class="llinks2"><h3 class="links2"><span>related links</span></h3><ul><li><a href="https://www.redhat.com/archives/libvir-list/">Mail archive</a></li><li><a href="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html">Xen project</a></li><li><form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="12" value="Search..." /><input name="submit" type="submit" value="Go" /></form></li><li><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-90x34.gif" alt="Made with Libxml2 Logo" /></a></li></ul></div></div><div id="bottom"><p class="p1"></p></div></div></body></html> diff --git a/docs/index.html b/docs/index.html index 53cdd03d0..d2c8a3886 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,7 +1,8 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> - <head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <link rel="stylesheet" type="text/css" href="libvir.css" /> <link rel="SHORTCUT ICON" href="/32favicon.png" /> <title>the virtualization API</title> diff --git a/src/libvir.c b/src/libvir.c index 23ec2587b..4fd1fe0a0 100644 --- a/src/libvir.c +++ b/src/libvir.c @@ -344,14 +344,12 @@ virConnectListDomains(virConnectPtr conn, int *ids, int maxids) { ret = -1; goto done; } - if (virConnectCheckStoreID(conn, (int) id) < 0) continue; ids[ret++] = (int) id; } } - done: if ((t != NULL) && (conn->xshandle != NULL)) xs_transaction_end(conn->xshandle, t, 0); @@ -602,6 +600,8 @@ virDomainGetVMInfo(virDomainPtr domain, const char *vm, if (!VIR_IS_CONNECTED_DOMAIN(domain)) return(NULL); + if (domain->conn->xshandle==NULL) + return(NULL); snprintf(s, 255, "%s/%s", vm, name); s[255] = 0; @@ -721,33 +721,34 @@ virDomainLookupByName(virConnectPtr conn, const char *name) { } /* then though the XenStore */ - - t = xs_transaction_start(conn->xshandle); - if (t == NULL) - goto done; - - idlist = xs_directory(conn->xshandle, t, "/local/domain", &num); - if (idlist == NULL) - goto done; - - for (i = 0;i < num;i++) { - id = strtol(idlist[i], &endptr, 10); - if ((endptr == idlist[i]) || (*endptr != 0)) { - goto done; - } - if (virConnectCheckStoreID(conn, (int) id) < 0) - continue; - snprintf(prop, 199, "/local/domain/%s/name", idlist[i]); - prop[199] = 0; - tmp = xs_read(conn->xshandle, t, prop, &len); - if (tmp != NULL) { - found = !strcmp(name, tmp); - free(tmp); - if (found) - break; - } + if (conn->xshandle != NULL) { + t = xs_transaction_start(conn->xshandle); + if (t == NULL) + goto done; + + idlist = xs_directory(conn->xshandle, t, "/local/domain", &num); + if (idlist == NULL) + goto done; + + for (i = 0;i < num;i++) { + id = strtol(idlist[i], &endptr, 10); + if ((endptr == idlist[i]) || (*endptr != 0)) { + goto done; + } + if (virConnectCheckStoreID(conn, (int) id) < 0) + continue; + snprintf(prop, 199, "/local/domain/%s/name", idlist[i]); + prop[199] = 0; + tmp = xs_read(conn->xshandle, t, prop, &len); + if (tmp != NULL) { + found = !strcmp(name, tmp); + free(tmp); + if (found) + break; + } + } + path = xs_get_domain_path(conn->xshandle, (unsigned int) id); } - path = xs_get_domain_path(conn->xshandle, (unsigned int) id); do_found: @@ -1128,6 +1129,8 @@ virDomainSetMaxMemory(virDomainPtr domain, unsigned long memory) { return(-1); if (domain->conn->flags & VIR_CONNECT_RO) return(-1); + if (domain->conn->xshandle==NULL) + return(-1); ret = xenHypervisorSetMaxMemory(domain->conn->handle, domain->handle, memory); if (ret < 0) diff --git a/src/libvir_sym.version b/src/libvir_sym.version index 534e85153..271048892 100644 --- a/src/libvir_sym.version +++ b/src/libvir_sym.version @@ -18,7 +18,9 @@ virDomainGetXMLDesc; virDomainLookupByID; virDomainLookupByName; + virDomainRestore; virDomainResume; + virDomainSave; virDomainSetMaxMemory; virDomainShutdown; virDomainSuspend; diff --git a/src/virsh.c b/src/virsh.c index 08ab7226b..673fff234 100644 --- a/src/virsh.c +++ b/src/virsh.c @@ -70,13 +70,10 @@ typedef enum { * int_option = --optionname <number> * string_option = --optionname <string> * - * keyword = [a-zA-Z] - * number = [0-9]+ - * string = [^[:blank:]] | "[[:alnum:]]"$ + * keyword = [a-zA-Z] + * number = [0-9]+ + * string = [^[:blank:]] | "[[:alnum:]]"$ * - * Note: only one <data> token per command is supported. It means: - * "command aaa bbb" is unsupported and you have to use any option, like: - * "command --aaa <data> bbb" or whatever. */ /* @@ -323,7 +320,7 @@ static vshCmdInfo info_dstate[] = { }; static vshCmdOptDef opts_dstate[] = { - { "domain", VSH_OT_DATA, 0, "domain name or id" }, + { "domain", VSH_OT_DATA, VSH_OFLAG_REQ, "domain name or id" }, { NULL, 0, 0, NULL } }; @@ -359,7 +356,7 @@ static vshCmdInfo info_suspend[] = { }; static vshCmdOptDef opts_suspend[] = { - { "domain", VSH_OT_DATA, 0, "domain name or id" }, + { "domain", VSH_OT_DATA, VSH_OFLAG_REQ, "domain name or id" }, { NULL, 0, 0, NULL } }; @@ -390,15 +387,15 @@ cmdSuspend(vshControl *ctl, vshCmd *cmd) { * "save" command */ static vshCmdInfo info_save[] = { - { "syntax", "save <domain> to <file>" }, + { "syntax", "save <domain> <file>" }, { "help", "save a domain state to a file" }, { "desc", "Save a running domain." }, { NULL, NULL } }; static vshCmdOptDef opts_save[] = { - { "file", VSH_OT_STRING, VSH_OFLAG_REQ, "where to save the data" }, - { "domain", VSH_OT_DATA, 0, "domain name or id" }, + { "file", VSH_OT_DATA, VSH_OFLAG_REQ, "where to save the data" }, + { "domain", VSH_OT_DATA, VSH_OFLAG_REQ, "domain name or id" }, { NULL, 0, 0, NULL } }; @@ -407,14 +404,12 @@ cmdSave(vshControl *ctl, vshCmd *cmd) { virDomainPtr dom; char *name; char *to; - int found; int ret = TRUE; if (!vshConnectionUsability(ctl, ctl->conn, TRUE)) return FALSE; - to = vshCommandOptString(cmd, "file", &found); - if (!found) + if (!(to = vshCommandOptString(cmd, "file", NULL))) return FALSE; if (!(dom = vshCommandOptDomain(ctl, cmd, "domain", &name))) @@ -442,7 +437,7 @@ static vshCmdInfo info_restore[] = { }; static vshCmdOptDef opts_restore[] = { - { "file", VSH_OT_DATA, 0, "the state to restore" }, + { "file", VSH_OT_DATA, VSH_OFLAG_REQ, "the state to restore" }, { NULL, 0, 0, NULL } }; @@ -479,7 +474,7 @@ static vshCmdInfo info_resume[] = { }; static vshCmdOptDef opts_resume[] = { - { "domain", VSH_OT_DATA, 0, "domain name or id" }, + { "domain", VSH_OT_DATA, VSH_OFLAG_REQ, "domain name or id" }, { NULL, 0, 0, NULL } }; @@ -517,7 +512,7 @@ static vshCmdInfo info_shutdown[] = { }; static vshCmdOptDef opts_shutdown[] = { - { "domain", VSH_OT_DATA, 0, "domain name or id" }, + { "domain", VSH_OT_DATA, VSH_OFLAG_REQ, "domain name or id" }, { NULL, 0, 0, NULL } }; @@ -555,7 +550,7 @@ static vshCmdInfo info_destroy[] = { }; static vshCmdOptDef opts_destroy[] = { - { "domain", VSH_OT_DATA, 0, "domain name or id" }, + { "domain", VSH_OT_DATA, VSH_OFLAG_REQ, "domain name or id" }, { NULL, 0, 0, NULL } }; @@ -593,7 +588,7 @@ static vshCmdInfo info_dinfo[] = { }; static vshCmdOptDef opts_dinfo[] = { - { "domain", VSH_OT_DATA, 0, "domain name or id" }, + { "domain", VSH_OT_DATA, VSH_OFLAG_REQ, "domain name or id" }, { NULL, 0, 0, NULL } }; @@ -659,7 +654,7 @@ static vshCmdInfo info_dumpxml[] = { }; static vshCmdOptDef opts_dumpxml[] = { - { "domain", VSH_OT_DATA, 0, "domain name or id" }, + { "domain", VSH_OT_DATA, VSH_OFLAG_REQ, "domain name or id" }, { NULL, 0, 0, NULL } }; @@ -697,7 +692,7 @@ static vshCmdInfo info_nameof[] = { }; static vshCmdOptDef opts_nameof[] = { - { "id", VSH_OT_DATA, 0, "domain Id" }, + { "id", VSH_OT_DATA, VSH_OFLAG_REQ, "domain Id" }, { NULL, 0, 0, NULL } }; @@ -733,7 +728,7 @@ static vshCmdInfo info_idof[] = { }; static vshCmdOptDef opts_idof[] = { - { "name", VSH_OT_DATA, 0, "domain name" }, + { "name", VSH_OT_DATA, VSH_OFLAG_REQ, "domain name" }, { NULL, 0, 0, NULL } }; @@ -902,15 +897,54 @@ vshCmddefGetOption(vshCmdDef *cmd, const char *name) { } static vshCmdOptDef * -vshCmddefGetData(vshCmdDef *cmd) { +vshCmddefGetData(vshCmdDef *cmd, int data_ct) { vshCmdOptDef *opt; - for (opt = cmd->opts; opt && opt->name; opt++) - if (opt->type==VSH_OT_DATA) - return opt; + for (opt = cmd->opts; opt && opt->name; opt++) { + if (opt->type==VSH_OT_DATA) { + if (data_ct==0) + return opt; + else + data_ct--; + } + } return NULL; } +/* + * Checks for required options + */ +static int +vshCommandCheckOpts(vshControl *ctl, vshCmd *cmd) +{ + vshCmdDef *def = cmd->def; + vshCmdOptDef *d; + int err=0; + + for (d = def->opts; d && d->name; d++) { + if (d->flag & VSH_OFLAG_REQ) { + vshCmdOpt *o = cmd->opts; + int ok=0; + + while(o && ok==0) { + if (o->def == d) + ok=1; + o = o->next; + } + if (!ok) { + vshError(ctl, FALSE, + d->type == VSH_OT_DATA ? + "command '%s' requires <%s> option" : + "command '%s' requires --%s option", + def->name, d->name); + err = 1; + } + + } + } + return !err; +} + static vshCmdDef * vshCmddefSearch(const char *cmdname) { vshCmdDef *c; @@ -1040,7 +1074,8 @@ vshCommandOptString(vshCmd *cmd, const char *name, int *found) { vshCmdOpt *arg = vshCommandOpt(cmd, name); if (found) *found = arg ? TRUE : FALSE; - return arg ? arg->data : NULL; + + return arg && arg->data && *arg->data ? arg->data : NULL; } /* @@ -1051,6 +1086,7 @@ vshCommandOptBool(vshCmd *cmd, const char *name) { return vshCommandOpt(cmd, name) ? TRUE : FALSE; } + static virDomainPtr vshCommandOptDomain(vshControl *ctl, vshCmd *cmd, const char *optname, char **name) { virDomainPtr dom = NULL; @@ -1062,18 +1098,23 @@ vshCommandOptDomain(vshControl *ctl, vshCmd *cmd, const char *optname, char **na return NULL; } + vshPrint(ctl, VSH_DEBUG5, "%s: found option <%s>: %s\n", cmd->def->name, optname, n); + if (name) *name = n; /* try it by ID */ id = (int) strtol(n, &end, 10); - if (id >= 0 && end && *end=='\0') + if (id >= 0 && end && *end=='\0') { + vshPrint(ctl, VSH_DEBUG5, "%s: <%s> seems like domain ID\n", cmd->def->name, optname); dom = virDomainLookupByID(ctl->conn, id); + } /* try it by NAME */ - if (!dom) + if (!dom) { + vshPrint(ctl, VSH_DEBUG5, "%s: <%s> tring as domain NAME\n", cmd->def->name, optname); dom = virDomainLookupByName(ctl->conn, n); - + } if (!dom) vshError(ctl, FALSE, "failed to get domain '%s'", n); @@ -1143,7 +1184,13 @@ vshCommandGetToken(vshControl *ctl, char *str, char **end, char **res) { /* end of token is blank space or ';' */ if ((quote==FALSE && isblank((unsigned char) *p)) || *p==';') break; - + + /* end of option name could be '=' */ + if (tk==VSH_TK_OPTION && *p=='=') { + p++; /* skip '=' */ + break; + } + if (tk==VSH_TK_NONE) { if (*p=='-' && *(p+1)=='-' && *(p+2) && isalnum((unsigned char) *(p+2))) { tk = VSH_TK_OPTION; @@ -1204,6 +1251,7 @@ vshCommandParse(vshControl *ctl, char *cmdstr) { vshCmdOpt *last = NULL; vshCmdDef *cmd = NULL; int tk = VSH_TK_NONE; + int data_ct = 0; first = NULL; @@ -1262,7 +1310,7 @@ vshCommandParse(vshControl *ctl, char *cmdstr) { } } } else if (tk==VSH_TK_DATA) { - if (!(opt = vshCmddefGetData(cmd))) { + if (!(opt = vshCmddefGetData(cmd, data_ct++))) { vshError(ctl, FALSE, "unexpected data '%s'", tkdata); @@ -1301,6 +1349,9 @@ vshCommandParse(vshControl *ctl, char *cmdstr) { c->def = cmd; c->next = NULL; + if (!vshCommandCheckOpts(ctl, c)) + goto syntaxError; + if (!ctl->cmd) ctl->cmd = c; if (clast) @@ -1619,7 +1670,7 @@ vshParseArgv(vshControl *ctl, int argc, char **argv) { if (argc < 2) return TRUE; - /* look for begin of command, for example: + /* look for begin of the command, for example: * ./virsh --debug 5 -q command --cmdoption * <--- ^ ---> * getopt() stuff | command suff |