[libvirt] [PATCH] Point users to Virt-Viewer MSI installers for Windows builds
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
The Windows port page currently links to pre-built libvirt
DLLs for release 0.8.8 which are 2 years old now. Until we
can reliably produce official Windows installers, point
people to the virt-viewer MSI installers instead which
include the libvirt DLLs.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
docs/windows.html.in | 64 ++++++++--------------------------------------------
1 file changed, 10 insertions(+), 54 deletions(-)
diff --git a/docs/windows.html.in b/docs/windows.html.in
index 89dfdb1..a0fe533 100644
--- a/docs/windows.html.in
+++ b/docs/windows.html.in
@@ -12,67 +12,23 @@
as well but we either haven't tested or received reports for them.
</p>
- <h2><a name="installer">Experimental installation package</a></h2>
+ <h2><a name="installer">Installation packages</a></h2>
<p>
- A windows installation package is in development. An experimental
- version is available here:
+ Users who need pre-built Windows DLLs of libvirt are advised
+ to use the <a href="http://virt-manager.org">Virt Viewer</a>
+ pre-compiled <a href="http://virt-manager.org/download/">Windows MSI packages</a>
</p>
- <a href="http://libvirt.org/sources/win32_experimental/Libvirt-0.8.8-0.exe">http://libvirt.org/sources/win32_experimental/Libvirt-0.8.8-0.exe</a>
-
- <p>
- <b>It is not production ready.</b>
- </p>
-
- <p>
- This version includes the libvirt development headers and libraries
- for compiling against, the virsh shell with its needed dependencies,
- and untested Python bindings.
- </p>
-
- <h3><a name="caveats">Caveats</a></h3>
-
- <ul>
- <li>
- This installer just repackages the files compiled using Matthias
- Bolte's msys_setup scripting (described below).
- </li>
- <li>
- This is a .exe installer, created using NSIS. We're looking into
- something to create .msi installers as well.
- </li>
- <li>
- The script for the NSIS installer is available online
- <a href="https://github.com/justinclift/nsis_libvirt_installer">here</a>.
- </li>
- </ul>
-
- <h3><a name="knowninstallerprobs">Existing problems with this installer we know about</a></h3>
-
<p>
- These are problems we know about, and need to be fixed in subsequent
- versions of the installer (assistance welcomed):
+ These installers include the libvirt, gtk-vnc and spice-gtk DLLs
+ along with any of their pre-requisite supporting DLLs, the virsh
+ command line tool and the virt-viewer & remote-viewer graphical
+ tools. The development headers are not currently provided in this
+ installer, so this cannot be used for compiling new applications
+ against libvirt.
</p>
- <ul>
- <li>
- New versions install over other libvirt versions
- <br /><br />
- If a version of this installer has installed libvirt on the system
- already, this installer will automatically suggest the same
- installation location, then overwrite the version already there
- without checking.
- <br /><br />
- This is fairly non-optimal, and should be fixed. What should
- probably happen, is for this installer to detect an existing
- installation then offer to either uninstall it first or ask for a
- new installation location.
- <br /><br />
- </li>
-
- </ul>
-
<h2><a name="conntypes">Connection types</a></h2>
<p>
--
1.8.1.4
11 years, 6 months
[libvirt] [PATCH 0/3]add 'policy' attribute for qemu vnc display sharing policy
by Guannan Ren
These patches try to add a new attribute 'policy' to element graphics of
vnc type. This attribute has three values:
libvirt XML: <graphics type='vnc' port='5900' policy='force-shared'>
QEMU commandline -vnc :5900,share=allow-exclusive
Allows clients to ask for exclusive access which is
implemented by dropping other connections Connecting
multiple clients in parallel requires all clients asking
for a shared session (vncviewer: -shared switch)
libvirt XML: <graphics type='vnc' port='5900' policy='force-shared'>
QEMU commandline -vnc :5900,share=force-shared
Disables exclusive client access. Useful for shared
desktop sessions, where you don't want someone forgetting
specify -shared disconnect everybody else.
libvirt XML: <graphics type='vnc' port='5900' policy='ignore'>
QEMU commandline -vnc :5900,share=ignore
Dompletely ignores the shared flag and allows everybody
connect unconditionally
Guannan Ren(3)
[PATCH 1/3] qemu: new vnc display sharing policy caps flag
[PATCH 2/3] conf: add 'policy' attribute to graphics element for vnc
[PATCH 3/3] qemu: support share attribute and its values to -vnc
docs/formatdomain.html.in | 13 +++++++++++--
docs/schemas/domaincommon.rng | 9 +++++++++
src/conf/domain_conf.c | 28 ++++++++++++++++++++++++++++
src/conf/domain_conf.h | 11 +++++++++++
src/libvirt_private.syms | 2 ++
src/qemu/qemu_capabilities.c | 12 ++++++++----
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 13 +++++++++++++
tests/qemuhelptest.c | 9 ++++++---
tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-policy.args | 4 ++++
tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-policy.xml | 35 +++++++++++++++++++++++++++++++++++
tests/qemuxml2argvtest.c | 1 +
12 files changed, 129 insertions(+), 9 deletions(-)
11 years, 6 months
[libvirt] [PATCH RESENT] qemu: Enable the capability bit for -no-kvm-pit-reinjection on x86 only
by Viktor Mihajlovski
From: Boris Fiuczynski <fiuczy(a)linux.vnet.ibm.com>
On architectures not supporting the Intel specific programmable interval
timer, like e.g. S390, starting a domain with a clock definition containing
a pit timer results in the error "Option no-kvm-pit-reinjection not supported
for this target".
By moving the capability enablement for -no-kvm-pit-reinjection from the
InitQMPBasic section into the x86_64 and i686 only enablement section all
other architectures are no longer automatically enabled. In addition
architecture related capabilities enablements have refactored into a new
architecture bound capabilities initialization function.
Signed-off-by: Boris Fiuczynski <fiuczy(a)linux.vnet.ibm.com>
Signed-off-by: Viktor Mihajlovski <mihajlov(a)linux.vnet.ibm.com>
---
src/qemu/qemu_capabilities.c | 59 ++++++++++++++++++++++++++++--------------
1 file changed, 39 insertions(+), 20 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index a3a8d1f..71059c6 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -2378,13 +2378,48 @@ virQEMUCapsInitQMPBasic(virQEMUCapsPtr qemuCaps)
virQEMUCapsSet(qemuCaps, QEMU_CAPS_NO_USER_CONFIG);
virQEMUCapsSet(qemuCaps, QEMU_CAPS_NETDEV_BRIDGE);
virQEMUCapsSet(qemuCaps, QEMU_CAPS_SECCOMP_SANDBOX);
- virQEMUCapsSet(qemuCaps, QEMU_CAPS_NO_KVM_PIT);
virQEMUCapsSet(qemuCaps, QEMU_CAPS_DTB);
virQEMUCapsSet(qemuCaps, QEMU_CAPS_IPV6_MIGRATION);
virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACHINE_OPT);
virQEMUCapsSet(qemuCaps, QEMU_CAPS_DUMP_GUEST_CORE);
}
+/* Capabilities that are architecture depending
+ * initialized for QEMU.
+ */
+static int
+virQEMUCapsInitArchQMPBasic(virQEMUCapsPtr qemuCaps,
+ qemuMonitorPtr mon)
+{
+ char *archstr = NULL;
+ int ret = -1;
+
+ if (!(archstr = qemuMonitorGetTargetArch(mon)))
+ return -1;
+
+ if ((qemuCaps->arch = virQEMUCapsArchFromString(archstr)) == VIR_ARCH_NONE) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unknown QEMU arch %s"), archstr);
+ goto cleanup;
+ }
+
+ /*
+ * Currently only x86_64 and i686 support PCI-multibus,
+ * -no-acpi and -no-kvm-pit-reinjection.
+ */
+ if (qemuCaps->arch == VIR_ARCH_X86_64 ||
+ qemuCaps->arch == VIR_ARCH_I686) {
+ virQEMUCapsSet(qemuCaps, QEMU_CAPS_PCI_MULTIBUS);
+ virQEMUCapsSet(qemuCaps, QEMU_CAPS_NO_ACPI);
+ virQEMUCapsSet(qemuCaps, QEMU_CAPS_NO_KVM_PIT);
+ }
+
+ ret = 0;
+
+cleanup:
+ VIR_FREE(archstr);
+ return ret;
+}
static int
virQEMUCapsInitQMP(virQEMUCapsPtr qemuCaps,
@@ -2402,7 +2437,6 @@ virQEMUCapsInitQMP(virQEMUCapsPtr qemuCaps,
char *monarg = NULL;
char *monpath = NULL;
char *pidfile = NULL;
- char *archstr;
pid_t pid = 0;
virDomainObj vm;
@@ -2515,28 +2549,13 @@ virQEMUCapsInitQMP(virQEMUCapsPtr qemuCaps,
virQEMUCapsInitQMPBasic(qemuCaps);
+ if (virQEMUCapsInitArchQMPBasic(qemuCaps, mon) < 0)
+ goto cleanup;
+
/* USB option is supported v1.3.0 onwards */
if (qemuCaps->version >= 1003000)
virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACHINE_USB_OPT);
- if (!(archstr = qemuMonitorGetTargetArch(mon)))
- goto cleanup;
-
- if ((qemuCaps->arch = virQEMUCapsArchFromString(archstr)) == VIR_ARCH_NONE) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unknown QEMU arch %s"), archstr);
- VIR_FREE(archstr);
- goto cleanup;
- }
- VIR_FREE(archstr);
-
- /* Currently only x86_64 and i686 support PCI-multibus and -no-acpi. */
- if (qemuCaps->arch == VIR_ARCH_X86_64 ||
- qemuCaps->arch == VIR_ARCH_I686) {
- virQEMUCapsSet(qemuCaps, QEMU_CAPS_PCI_MULTIBUS);
- virQEMUCapsSet(qemuCaps, QEMU_CAPS_NO_ACPI);
- }
-
if (virQEMUCapsProbeQMPCommands(qemuCaps, mon) < 0)
goto cleanup;
if (virQEMUCapsProbeQMPEvents(qemuCaps, mon) < 0)
--
1.7.9.5
11 years, 6 months
[libvirt] [PATCHv3] rpc: message related sizes enlarged
by Viktor Mihajlovski
From: Daniel Hansel <daniel.hansel(a)linux.vnet.ibm.com>
We have seen an issue on s390x platform where domain XMLs larger than 1MB
were used. The define command was finished successfully. The dumpxml command
was not successful (i.e. could not encode message payload).
Enlarged message related sizes (e.g. maximum string size, message size, etc.)
to handle larger system configurations used on s390x platform.
To improve handling of the RPC message size the allocation during encode process
is changed to a dynamic one (i.e. starting with 64kB initial size and increasing
that size in steps up to 16MB if the payload data is larger).
Signed-off-by: Daniel Hansel <daniel.hansel(a)linux.vnet.ibm.com>
Signed-off-by: Viktor Mihajlovski <mihajlov(a)linux.vnet.ibm.com>
---
V2 Changes
- switch to dynamical allocation of RPC message buffers
- mention upstream version in libvirt.c
V3 Changes
- update version comment in libvirt.c to 1.0.6
src/libvirt.c | 4 ++++
src/remote/remote_protocol.x | 6 +++---
src/rpc/virnetmessage.c | 46 ++++++++++++++++++++++++++++++++++--------
src/rpc/virnetmessage.h | 3 ++-
src/rpc/virnetprotocol.x | 16 +++++++++++----
tests/virnetmessagetest.c | 2 +-
6 files changed, 60 insertions(+), 17 deletions(-)
diff --git a/src/libvirt.c b/src/libvirt.c
index 467f6dd..33a4419 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -7786,6 +7786,8 @@ error:
* For your program to be able to work reliably over a remote
* connection you should split large requests to <= 65536 bytes.
* However, with 0.9.13 this RPC limit has been raised to 1M byte.
+ * Starting with version 1.0.6 the RPC limit has been raised again.
+ * Now large requests up to 16M byte are supported.
*
* Returns: 0 in case of success or -1 in case of failure.
*/
@@ -7936,6 +7938,8 @@ error:
* For your program to be able to work reliably over a remote
* connection you should split large requests to <= 65536 bytes.
* However, with 0.9.13 this RPC limit has been raised to 1M byte.
+ * Starting with version 1.0.6 the RPC limit has been raised again.
+ * Now large requests up to 16M byte are supported.
*
* Returns: 0 in case of success or -1 in case of failure.
*/
diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x
index 512ba2e..f61d10c 100644
--- a/src/remote/remote_protocol.x
+++ b/src/remote/remote_protocol.x
@@ -65,7 +65,7 @@
* This is an arbitrary limit designed to stop the decoder from trying
* to allocate unbounded amounts of memory when fed with a bad message.
*/
-const REMOTE_STRING_MAX = 1048576;
+const REMOTE_STRING_MAX = 4194304;
/* A long string, which may NOT be NULL. */
typedef string remote_nonnull_string<REMOTE_STRING_MAX>;
@@ -160,13 +160,13 @@ const REMOTE_DOMAIN_SNAPSHOT_LIST_NAMES_MAX = 1024;
* Note applications need to be aware of this limit and issue multiple
* requests for large amounts of data.
*/
-const REMOTE_DOMAIN_BLOCK_PEEK_BUFFER_MAX = 1048576;
+const REMOTE_DOMAIN_BLOCK_PEEK_BUFFER_MAX = 4194304;
/* Maximum length of a memory peek buffer message.
* Note applications need to be aware of this limit and issue multiple
* requests for large amounts of data.
*/
-const REMOTE_DOMAIN_MEMORY_PEEK_BUFFER_MAX = 1048576;
+const REMOTE_DOMAIN_MEMORY_PEEK_BUFFER_MAX = 4194304;
/*
* Maximum length of a security label list.
diff --git a/src/rpc/virnetmessage.c b/src/rpc/virnetmessage.c
index 647fef7..b2c6e5b 100644
--- a/src/rpc/virnetmessage.c
+++ b/src/rpc/virnetmessage.c
@@ -221,7 +221,7 @@ int virNetMessageEncodeHeader(virNetMessagePtr msg)
int ret = -1;
unsigned int len = 0;
- msg->bufferLength = VIR_NET_MESSAGE_MAX + VIR_NET_MESSAGE_LEN_MAX;
+ msg->bufferLength = VIR_NET_MESSAGE_INITIAL + VIR_NET_MESSAGE_LEN_MAX;
if (VIR_REALLOC_N(msg->buffer, msg->bufferLength) < 0) {
virReportOOMError();
return ret;
@@ -351,9 +351,27 @@ int virNetMessageEncodePayload(virNetMessagePtr msg,
xdrmem_create(&xdr, msg->buffer + msg->bufferOffset,
msg->bufferLength - msg->bufferOffset, XDR_ENCODE);
- if (!(*filter)(&xdr, data)) {
- virReportError(VIR_ERR_RPC, "%s", _("Unable to encode message payload"));
- goto error;
+ /* Try to encode the payload. If the buffer is too small increase it. */
+ while (!(*filter)(&xdr, data)) {
+ if ((msg->bufferLength - VIR_NET_MESSAGE_LEN_MAX) * 4 > VIR_NET_MESSAGE_MAX) {
+ virReportError(VIR_ERR_RPC, "%s", _("Unable to encode message payload"));
+ goto error;
+ }
+
+ xdr_destroy(&xdr);
+
+ msg->bufferLength = (msg->bufferLength - VIR_NET_MESSAGE_LEN_MAX) * 4 +
+ VIR_NET_MESSAGE_LEN_MAX;
+
+ if (VIR_REALLOC_N(msg->buffer, msg->bufferLength) < 0) {
+ virReportOOMError();
+ goto error;
+ }
+
+ xdrmem_create(&xdr, msg->buffer + msg->bufferOffset,
+ msg->bufferLength - msg->bufferOffset, XDR_ENCODE);
+
+ VIR_DEBUG("Increased message buffer length = %zu", msg->bufferLength);
}
/* Get the length stored in buffer. */
@@ -415,11 +433,23 @@ int virNetMessageEncodePayloadRaw(virNetMessagePtr msg,
XDR xdr;
unsigned int msglen;
+ /* If the message buffer is too small for the payload increase it accordingly. */
if ((msg->bufferLength - msg->bufferOffset) < len) {
- virReportError(VIR_ERR_RPC,
- _("Stream data too long to send (%zu bytes needed, %zu bytes available)"),
- len, (msg->bufferLength - msg->bufferOffset));
- return -1;
+ if ((msg->bufferOffset + len) > VIR_NET_MESSAGE_MAX) {
+ virReportError(VIR_ERR_RPC,
+ _("Stream data too long to send (%zu bytes needed, %zu bytes available)"),
+ len, (VIR_NET_MESSAGE_MAX - msg->bufferOffset));
+ return -1;
+ }
+
+ msg->bufferLength = msg->bufferOffset + len;
+
+ if (VIR_REALLOC_N(msg->buffer, msg->bufferLength) < 0) {
+ virReportOOMError();
+ return -1;
+ }
+
+ VIR_DEBUG("Increased message buffer length = %zu", msg->bufferLength);
}
memcpy(msg->buffer + msg->bufferOffset, data, len);
diff --git a/src/rpc/virnetmessage.h b/src/rpc/virnetmessage.h
index dfa1c6c..c94dddc 100644
--- a/src/rpc/virnetmessage.h
+++ b/src/rpc/virnetmessage.h
@@ -34,7 +34,8 @@ typedef void (*virNetMessageFreeCallback)(virNetMessagePtr msg, void *opaque);
struct _virNetMessage {
bool tracked;
- char *buffer; /* Typically VIR_NET_MESSAGE_MAX + VIR_NET_MESSAGE_LEN_MAX */
+ char *buffer; /* Initially VIR_NET_MESSAGE_INITIAL + VIR_NET_MESSAGE_LEN_MAX */
+ /* Maximum VIR_NET_MESSAGE_MAX + VIR_NET_MESSAGE_LEN_MAX */
size_t bufferLength;
size_t bufferOffset;
diff --git a/src/rpc/virnetprotocol.x b/src/rpc/virnetprotocol.x
index eb2e81d..131e40b 100644
--- a/src/rpc/virnetprotocol.x
+++ b/src/rpc/virnetprotocol.x
@@ -44,23 +44,31 @@
/*----- Data types. -----*/
+/* Initial message size.
+ * When the message payload is larger this initial size will be
+ * quadrupled until the maximum total message size is reached.
+ */
+const VIR_NET_MESSAGE_INITIAL = 65536;
+
/* Maximum total message size (serialised). */
-const VIR_NET_MESSAGE_MAX = 4194304;
+const VIR_NET_MESSAGE_MAX = 16777216;
/* Size of struct virNetMessageHeader (serialised)*/
const VIR_NET_MESSAGE_HEADER_MAX = 24;
/* Size of message payload */
-const VIR_NET_MESSAGE_PAYLOAD_MAX = 4194280;
+const VIR_NET_MESSAGE_PAYLOAD_MAX = 16777192;
-/* Size of message length field. Not counted in VIR_NET_MESSAGE_MAX */
+/* Size of message length field. Not counted in VIR_NET_MESSAGE_MAX
+ * and VIR_NET_MESSAGE_INITIAL.
+ */
const VIR_NET_MESSAGE_LEN_MAX = 4;
/* Length of long, but not unbounded, strings.
* This is an arbitrary limit designed to stop the decoder from trying
* to allocate unbounded amounts of memory when fed with a bad message.
*/
-const VIR_NET_MESSAGE_STRING_MAX = 1048576;
+const VIR_NET_MESSAGE_STRING_MAX = 4194304;
/* Limit on number of File Descriptors allowed to be
* passed per message
diff --git a/tests/virnetmessagetest.c b/tests/virnetmessagetest.c
index 96defe4..fabeffd 100644
--- a/tests/virnetmessagetest.c
+++ b/tests/virnetmessagetest.c
@@ -46,7 +46,7 @@ static int testMessageHeaderEncode(const void *args ATTRIBUTE_UNUSED)
};
/* According to doc to virNetMessageEncodeHeader(&msg):
* msg->buffer will be this long */
- unsigned long msg_buf_size = VIR_NET_MESSAGE_MAX + VIR_NET_MESSAGE_LEN_MAX;
+ unsigned long msg_buf_size = VIR_NET_MESSAGE_INITIAL + VIR_NET_MESSAGE_LEN_MAX;
int ret = -1;
if (!msg) {
--
1.7.9.5
11 years, 6 months
[libvirt] [PATCH] Fix docs generator regression in previous commit
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
The previous commit failed to update the XSL to take account
of fact that in XHTML mode the elements need namespace
prefixes. This caused every web page to be blank!
Pushed as a website breaker fix
---
docs/drvqemu.html.in | 2 +-
docs/page.xsl | 64 +++++++++++++++++++++++++++-------------------------
docs/site.xsl | 1 +
3 files changed, 35 insertions(+), 32 deletions(-)
diff --git a/docs/drvqemu.html.in b/docs/drvqemu.html.in
index 3a5c4df..fee2819 100644
--- a/docs/drvqemu.html.in
+++ b/docs/drvqemu.html.in
@@ -560,6 +560,7 @@ $ virsh domxml-to-native qemu-argv demo.xml
possible to add an element <code><qemu:commandline></code>
under <code>driver</code>, with the following sub-elements
repeated as often as needed:
+ </p>
<dl>
<dt><code>qemu:arg</code></dt>
<dd>Add an additional command-line argument to the qemu
@@ -572,7 +573,6 @@ $ virsh domxml-to-native qemu-argv demo.xml
pair recorded in the attributes <code>name</code>
and optional <code>value</code>.</dd>
</dl>
- </p>
<p>Example:</p><pre>
<domain type='qemu' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<name>QEmu-fedora-i686</name>
diff --git a/docs/page.xsl b/docs/page.xsl
index bc8ea2a..20e4aa6 100644
--- a/docs/page.xsl
+++ b/docs/page.xsl
@@ -1,14 +1,16 @@
<?xml version="1.0"?>
<xsl:stylesheet
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
- exclude-result-prefixes="xsl exsl"
+ exclude-result-prefixes="xsl exsl html"
version="1.0">
<!-- The sitemap.html.in page contains the master navigation structure -->
- <xsl:variable name="sitemap" select="document('sitemap.html.in')/html/body/div[@id='sitemap']"/>
+ <xsl:variable name="sitemap" select="document('sitemap.html.in')/html:html/html:body/html:div[@id='sitemap']"/>
- <xsl:template match="code[@class='docref']" mode="content">
+ <xsl:template match="html:code[@class='docref']" mode="content">
<xsl:variable name="name"><xsl:value-of select="."/></xsl:variable>
<a href="html/libvirt-libvirt.html#{$name}"><code><xsl:value-of select="$name"/></code></a>
</xsl:template>
@@ -20,17 +22,17 @@
</xsl:template>
- <xsl:template match="ul[@id='toc']" mode="content">
+ <xsl:template match="html:ul[@id='toc']" mode="content">
<xsl:call-template name="toc"/>
</xsl:template>
<!-- This processes the sitemap to form a context sensitive
navigation menu for the current page -->
- <xsl:template match="ul" mode="menu">
+ <xsl:template match="html:ul" mode="menu">
<xsl:param name="pagename"/>
<xsl:param name="level"/>
<ul class="{concat('l', $level)}">
- <xsl:for-each select="li">
+ <xsl:for-each select="html:li">
<!-- The extra div tag here works around an IE6 whitespace collapsing problem -->
<li><div>
<!-- A menu is active if there is an 'a' tag with
@@ -38,7 +40,7 @@
or a child menu -->
<xsl:variable name="class">
<xsl:choose>
- <xsl:when test="count(.//a[@href = $pagename]) > 0">
+ <xsl:when test="count(.//html:a[@href = $pagename]) > 0">
<xsl:text>active</xsl:text>
</xsl:when>
<xsl:otherwise>
@@ -51,21 +53,21 @@
the immediate 'a' tag has href matching the
current pagename -->
<xsl:choose>
- <xsl:when test="$pagename = a/@href">
- <span class="{$class}"><xsl:value-of select="a"/></span>
+ <xsl:when test="$pagename = html:a/@href">
+ <span class="{$class}"><xsl:value-of select="html:a"/></span>
</xsl:when>
- <xsl:when test="starts-with(a/@href, 'http://wiki.libvirt.org')">
- <a title="{./span}" class="{$class}" href="{a/@href}"><xsl:value-of select="a"/></a>
+ <xsl:when test="starts-with(html:a/@href, 'http://wiki.libvirt.org')">
+ <a title="{./html:span}" class="{$class}" href="{html:a/@href}"><xsl:value-of select="html:a"/></a>
</xsl:when>
<xsl:otherwise>
- <a title="{./span}" class="{$class}" href="{concat($href_base, a/@href)}"><xsl:value-of select="a"/></a>
+ <a title="{./html:span}" class="{$class}" href="{concat($href_base, html:a/@href)}"><xsl:value-of select="html:a"/></a>
</xsl:otherwise>
</xsl:choose>
<!-- A sub-menu should only be expanded it contains
an 'a' tag with href matching this pagename -->
- <xsl:if test="count(.//a[@href = $pagename]) > 0">
- <xsl:apply-templates select="ul" mode="menu">
+ <xsl:if test="count(.//html:a[@href = $pagename]) > 0">
+ <xsl:apply-templates select="html:ul" mode="menu">
<xsl:with-param name="pagename" select="$pagename"/>
<xsl:with-param name="level" select="$level + 1"/>
</xsl:apply-templates>
@@ -77,33 +79,33 @@
<xsl:template name="toc">
<ul>
- <xsl:for-each select="/html/body/h2[count(a) = 1]">
+ <xsl:for-each select="/html:html/html:body/html:h2[count(html:a) = 1]">
<xsl:variable name="thish2" select="."/>
<li>
- <a href="#{a/@name}"><xsl:value-of select="a/text()"/></a>
- <xsl:if test="count(./following-sibling::h3[preceding-sibling::h2[1] = $thish2 and count(a) = 1]) > 0">
+ <a href="#{html:a/@name}"><xsl:value-of select="html:a/text()"/></a>
+ <xsl:if test="count(./following-sibling::h3[preceding-sibling::h2[1] = $thish2 and count(html:a) = 1]) > 0">
<ul>
- <xsl:for-each select="./following-sibling::h3[preceding-sibling::h2[1] = $thish2 and count(a) = 1]">
+ <xsl:for-each select="./following-sibling::html:h3[preceding-sibling::html:h2[1] = $thish2 and count(html:a) = 1]">
<xsl:variable name="thish3" select="."/>
<li>
- <a href="#{a/@name}"><xsl:value-of select="a/text()"/></a>
- <xsl:if test="count(./following-sibling::h4[preceding-sibling::h3[1] = $thish3 and count(a) = 1]) > 0">
+ <a href="#{html:a/@name}"><xsl:value-of select="html:a/text()"/></a>
+ <xsl:if test="count(./following-sibling::html:h4[preceding-sibling::html:h3[1] = $thish3 and count(html:a) = 1]) > 0">
<ul>
- <xsl:for-each select="./following-sibling::h4[preceding-sibling::h3[1] = $thish3 and count(a) = 1]">
+ <xsl:for-each select="./following-sibling::html:h4[preceding-sibling::html:h3[1] = $thish3 and count(html:a) = 1]">
<xsl:variable name="thish4" select="."/>
<li>
- <a href="#{a/@name}"><xsl:value-of select="a/text()"/></a>
- <xsl:if test="count(./following-sibling::h5[preceding-sibling::h4[1] = $thish4 and count(a) = 1]) > 0">
+ <a href="#{html:a/@name}"><xsl:value-of select="a/text()"/></a>
+ <xsl:if test="count(./following-sibling::html:h5[preceding-sibling::html:h4[1] = $thish4 and count(html:a) = 1]) > 0">
<ul>
- <xsl:for-each select="./following-sibling::h5[preceding-sibling::h4[1] = $thish4 and count(a) = 1]">
+ <xsl:for-each select="./following-sibling::html:h5[preceding-sibling::html:h4[1] = $thish4 and count(html:a) = 1]">
<xsl:variable name="thish5" select="."/>
<li>
- <a href="#{a/@name}"><xsl:value-of select="a/text()"/></a>
- <xsl:if test="count(./following-sibling::h6[preceding-sibling::h5[1] = $thish5 and count(a) = 1]) > 0">
+ <a href="#{html:a/@name}"><xsl:value-of select="a/text()"/></a>
+ <xsl:if test="count(./following-sibling::html:h6[preceding-sibling::html:h5[1] = $thish5 and count(html:a) = 1]) > 0">
<ul>
- <xsl:for-each select="./following-sibling::h6[preceding-sibling::h5[1] = $thish5 and count(a) = 1]">
+ <xsl:for-each select="./following-sibling::html:h6[preceding-sibling::html:h5[1] = $thish5 and count(html:a) = 1]">
<li>
- <a href="#{a/@name}"><xsl:value-of select="a/text()"/></a>
+ <a href="#{html:a/@name}"><xsl:value-of select="html:a/text()"/></a>
</li>
</xsl:for-each>
</ul>
@@ -136,7 +138,7 @@
<head>
<link rel="stylesheet" type="text/css" href="{$href_base}main.css"/>
<link rel="SHORTCUT ICON" href="{$href_base}32favicon.png"/>
- <title>libvirt: <xsl:value-of select="html/body/h1"/></title>
+ <title>libvirt: <xsl:value-of select="html:html/html:body/html:h1"/></title>
<meta name="description" content="libvirt, virtualization, virtualization API"/>
</head>
<body>
@@ -153,13 +155,13 @@
</div>
<div id="body">
<div id="menu">
- <xsl:apply-templates select="exsl:node-set($sitemap)/ul" mode="menu">
+ <xsl:apply-templates select="exsl:node-set($sitemap)/html:ul" mode="menu">
<xsl:with-param name="pagename" select="$pagename"/>
<xsl:with-param name="level" select="0"/>
</xsl:apply-templates>
</div>
<div id="content">
- <xsl:apply-templates select="/html/body/*" mode="content"/>
+ <xsl:apply-templates select="/html:html/html:body/*" mode="content"/>
</div>
</div>
<div id="footer">
diff --git a/docs/site.xsl b/docs/site.xsl
index a65c10d..ce354c3 100644
--- a/docs/site.xsl
+++ b/docs/site.xsl
@@ -1,5 +1,6 @@
<?xml version="1.0"?>
<xsl:stylesheet
+ xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
exclude-result-prefixes="xsl exsl"
--
1.8.1.4
11 years, 6 months
[libvirt] Missing documentation?
by Joseph Glanville
Hi,
I am playing with libvirt and I noticed the API reference appears to be
empty, the page in particular is: http://libvirt.org/html/index.html
I also tried to build the documentation from git but this also produces
empty html along with a stream of errors because W3C is blocking access to
the DTD from the useragent that is used to attempt to download it
(rightfully so, you don't need to download it more than once)
My guess is that without the DTD the parser being used is borking on
undefined entities like this:
csharp.html.in:441: parser error : Entity 'nbsp' not defined
nbsp;</td><td> </td><td> </td><td> </td><td> </td><td>
and as such is no real docs are being produced.
I am not subscribed to the list so please use reply-all (or just cc me)
Joseph.
11 years, 6 months
[libvirt] [PATCH] Fix namespace bugs in API docs, todo page & hv support page
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
The XSL for generating the API docs was missing the HTML5
namespace declarations. The todo and hvsupport scripts were
also missing the HTML5 doctype / namespace declaration.
Pushed as a website breaker fix
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
docs/hvsupport.pl | 4 +++-
docs/newapi.xsl | 2 ++
docs/todo.pl | 5 +++--
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/docs/hvsupport.pl b/docs/hvsupport.pl
index b415abc..e31441e 100755
--- a/docs/hvsupport.pl
+++ b/docs/hvsupport.pl
@@ -341,7 +341,9 @@ foreach my $drv (keys %{$groups{"virDriver"}->{drivers}}) {
# Finally we generate the HTML file with the tables
print <<EOF;
-<html>
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>libvirt API support matrix</title>
</head>
diff --git a/docs/newapi.xsl b/docs/newapi.xsl
index af1dbc8..d5b210e 100644
--- a/docs/newapi.xsl
+++ b/docs/newapi.xsl
@@ -6,6 +6,8 @@
Daniel Veillard
-->
<xsl:stylesheet version="1.0"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
xmlns:str="http://exslt.org/strings"
diff --git a/docs/todo.pl b/docs/todo.pl
index 68d82d4..36698e8 100755
--- a/docs/todo.pl
+++ b/docs/todo.pl
@@ -87,8 +87,9 @@ sub escape {
return $txt;
};
-print "<?xml version=\"1.0\"?>\n";
-print "<html>\n";
+print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
+print "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n";
+print "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n";
print " <body>\n";
if (defined $title) {
print " <h1>", &escape($title), "</h1>\n";
--
1.8.1.4
11 years, 6 months
[libvirt] [RFC] New CPU hotplug APIs
by Peter Krempa
Hi upstream,
I'd like to discuss the design of CPU modification related APIs before I
start working on them.
Qemu recently added support for modification of the state of the cpu
using the guest agent and is also doing work on hot plug of cpus and
possibly even hot unplug.
This stuff will require us to introduce new APIs to take full advantage
of the new code for qemu.
I'm imagining adding 3 new API functions: 1 universal getter function
and 2 specific setters: one for agent based modifications and one for
classic (ACPI) cpu hotplug.
1) The getter function:
int
virDomainGetVCPUMap(virDomainPtr dom,
const char **cpumap,
unsigned int flags);
With no flags, this function would return the map of online CPUs in the
guest.
The flags will allow us then to do:
VIR_DOMAIN_VCPU_MAP_AGENT_ONLINE - map of online cpus as the guest agent
sees it
VIR_DOMAIN_VCPU_MAP_AGENT_OFFLINABLE - map of online cpus that can be
turned off
VIR_DOMAIN_VCPU_MAP_AGENT_ONLINABLE - map of offline cpus that can be
turned on
VIR_DOMAIN_VCPU_MAP_AGENT_POSSIBLE - all vcpus as the guest agent sees them
(_AGENT_OFFLINE probably isn't useful
And similarly for offline processors:
VIR_DOMAIN_VCPU_MAP_ONLINE
VIR_DOMAIN_VCPU_MAP_ONLINABLE
VIR_DOMAIN_VCPU_MAP_POSSIBLE
(no idea if offlinable makes sense here)
The universal nature of this function would be documented right away and
would save us having separate getters for agent based hotplug and
classic one.
The returned map would be automatically allocated and the length of it
returned as the return value.
This getter will allow us representing (possibly) sparse allocation of
the cpu IDs.
2) Setters
int
virDomainSetVCPUState(virDomainPtr dom,
int id,
bool state,
unsigned int flags);
for classic CPU hotplug and:
virDomainSetGuestVCPUState(virDomainPtr dom,
int id,
bool state,
unsigned int flags);
for agent based cpu offlining.
This will represent the setter functions with similar semantics. I've
gone for two to absolutely differentiate the agent based stuff from the
classic one, but they could be merged into a single one with appropriate
flags).
These will allow modification of state of single CPUs so that errors can
be handled gracefully. The id corresponds to position of the bit in the
cpumap requested by the getter func described above.
Thanks in advance for your input on this design stuff.
Peter
11 years, 6 months
[libvirt] Libvirt 1.0.5 with Openvswitch 1.11.90: unable to add bridge br0 port vnet0 operation not supported
by Christopher Paggen (cpaggen)
Howdy,
Running the most recent OVS and libvirt I'm running into the following error message with virt-install:
root@qemu-kvm:~/libvirt-1.0.5# ovs-vsctl -V
ovs-vsctl (Open vSwitch) 1.11.90
Compiled May 6 2013 22:37:22
root@qemu-kvm:~/libvirt-1.0.5#
root@qemu-kvm:~/libvirt-1.0.5# virt-install --connect qemu:///system --name DSL2 --ram 1024 --vcpus 1 --disk path=/tmp/dsl2,size=1,bus=virtio,cache=none --network=bridge:br0 --vnc --os-type=linux --cdrom /dev/sr0
Starting install...
ERROR Unable to add bridge br0 port vnet0: Operation not supported
Domain installation does not appear to have been successful.
If it was, you can restart your domain by running:
virsh --connect qemu:///system start DSL2
otherwise, please restart your installation.
root@qemu-kvm:~/libvirt-1.0.5# ovs-vsctl del-port br0 vnet0
root@qemu-kvm:~/libvirt-1.0.5# libvirtd --version
libvirtd (libvirt) 1.0.5
root@qemu-kvm:~/libvirt-1.0.5# virsh --version
1.0.5
root@qemu-kvm:~/libvirt-1.0.5# virt-install --connect qemu:///system --name DSL2 --ram 1024 --vcpus 1 --disk path=/tmp/dsl2,size=1,bus=virtio,cache=none --network=bridge:br0 --vnc --os-type=linux --cdrom /dev/sr0
Starting install...
ERROR Unable to add bridge br0 port vnet0: Operation not supported
Domain installation does not appear to have been successful.
If it was, you can restart your domain by running:
virsh --connect qemu:///system start DSL2
otherwise, please restart your installation.
root@qemu-kvm:~/libvirt-1.0.5#
root@qemu-kvm:~/libvirt-1.0.5# ovs-vsctl show
b81788a2-f45d-4fad-aad2-f423e6e70bad
Bridge "br0"
Port "eth1"
Interface "eth1"
Port "br0"
Interface "br0"
type: internal
Port "tap0"
Interface "tap0"
root@qemu-kvm:~/libvirt-1.0.5#<mailto:root@qemu-kvm:~/libvirt-1.0.5#>
Even if I create a new OVS switch I get the same result:
root@qemu-kvm:~/libvirt-1.0.5# ovs-vsctl add-br b1
root@qemu-kvm:~/libvirt-1.0.5# virt-install --connect qemu:///system --name DSL2 --ram 1024 --vcpus 1 --disk path=/tmp/dsl2,size=1,bus=virtio,cache=none --network=bridge:b1 --vnc --os-type=linux --cdrom /dev/sr0
Starting install...
ERROR Unable to add bridge b1 port vnet0: Operation not supported
Domain installation does not appear to have been successful.
If it was, you can restart your domain by running:
virsh --connect qemu:///system start DSL2
otherwise, please restart your installation.
root@qemu-kvm:~/libvirt-1.0.5#
Nothing in the openvswitch log file (OVS itself works fine, I can start VMs with the kvm command line).
Any clues? I'm not too sure how to trace libvirt calls to OVS (according to the release notes, versions 1.0+ of libvirtd should work with OVS. Note: I am not using brcompat, I believe it's obsolete in the OVS version I'm running).
Thanks,
Chris.
11 years, 6 months
[libvirt] [PATCHv2] qemu: Do fake auto-allocation of ports when generating native command
by Peter Krempa
When attempting to generate the native command line from an XML file
that uses graphics port auto allocation, the generated commandline
wouldn't be valid.
This patch adds fake autoallocation of ports as done when starting the
actual machine.
---
Notes:
Version 2:
- rebased after context-conflict with 11fc1beab6e018a88182f80056d35217c150b3de
src/qemu/qemu_driver.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 9492850..45fcf05 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -5274,6 +5274,58 @@ static char *qemuConnectDomainXMLToNative(virConnectPtr conn,
if (qemuDomainAssignAddresses(def, qemuCaps, NULL) < 0)
goto cleanup;
+ /* do fake auto-alloc of graphics ports, if such config is used */
+ for (i = 0 ; i < def->ngraphics; ++i) {
+ virDomainGraphicsDefPtr graphics = def->graphics[i];
+ if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC &&
+ !graphics->data.vnc.socket && graphics->data.vnc.autoport) {
+ graphics->data.vnc.port = 5900;
+ } else if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE) {
+ int j;
+ bool needTLSPort = false;
+ bool needPort = false;
+ int defaultMode = graphics->data.spice.defaultMode;
+
+ if (graphics->data.spice.autoport) {
+ /* check if tlsPort or port need allocation */
+ for (j = 0 ; j < VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_LAST ; j++) {
+ switch (graphics->data.spice.channels[j]) {
+ case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_SECURE:
+ needTLSPort = true;
+ break;
+
+ case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_INSECURE:
+ needPort = true;
+ break;
+
+ case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_ANY:
+ switch (defaultMode) {
+ case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_SECURE:
+ needTLSPort = true;
+ break;
+
+ case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_INSECURE:
+ needPort = true;
+ break;
+
+ case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_ANY:
+ needTLSPort = true;
+ needPort = true;
+ break;
+ }
+ break;
+ }
+ }
+ }
+
+ if (needPort || graphics->data.spice.port == -1)
+ graphics->data.spice.port = 5901;
+
+ if (needTLSPort || graphics->data.spice.tlsPort == -1)
+ graphics->data.spice.tlsPort = 5902;
+ }
+ }
+
if (!(cmd = qemuBuildCommandLine(conn, driver, def,
&monConfig, monitor_json, qemuCaps,
NULL, -1, NULL, VIR_NETDEV_VPORT_PROFILE_OP_NO_OP)))
--
1.8.2.1
11 years, 6 months