[libvirt] [PATCH] Fix docs and code disagreements for character devices.
by Cole Robinson
The 'pipe' character type wasn't documented.
TCP uses a <protocol> element, not <wire>
We weren't doing strict validation for protocol and source mode values.
Signed-off-by: Cole Robinson <crobinso(a)redhat.com>
---
docs/formatdomain.html | 18 +++++++++++++++++-
docs/formatdomain.html.in | 17 ++++++++++++++++-
src/domain_conf.c | 23 ++++++++++++++++++-----
3 files changed, 51 insertions(+), 7 deletions(-)
diff --git a/docs/formatdomain.html b/docs/formatdomain.html
index bb6da11..0b21c6b 100644
--- a/docs/formatdomain.html
+++ b/docs/formatdomain.html
@@ -181,6 +181,8 @@
</li><li>
<a href="#elementsCharHost">Host device proxy</a>
</li><li>
+ <a href="#elementsCharPipe">Named pipe</a>
+ </li><li>
<a href="#elementsCharTCP">TCP client/server</a>
</li><li>
<a href="#elementsCharUDP">UDP network console</a>
@@ -879,6 +881,20 @@ qemu-kvm -net nic,model=? /dev/null
</serial>
...</pre>
<h5>
+ <a name="elementsCharPipe" id="elementsCharPipe">Named pipe</a>
+ </h5>
+ <p>
+ The character device writes output to a named pipe. See pipe(7) for
+ more info.
+ </p>
+ <pre>
+ ...
+ <serial type="pipe">
+ <source path="/tmp/mypipe"/>
+ <target port="1"/>
+ </serial>
+ ...</pre>
+ <h5>
<a name="elementsCharTCP" id="elementsCharTCP">TCP client/server</a>
</h5>
<p>
@@ -889,7 +905,7 @@ qemu-kvm -net nic,model=? /dev/null
...
<serial type="tcp">
<source mode="connect" host="0.0.0.0" service="2445"/>
- <wiremode type="telnet"/>
+ <protocol type="telnet"/>
<target port="1"/>
</serial>
...</pre>
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 48d689d..191b03e 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -839,6 +839,21 @@ qemu-kvm -net nic,model=? /dev/null
</serial>
...</pre>
+ <h5><a name="elementsCharPipe">Named pipe</a></h5>
+
+ <p>
+ The character device writes output to a named pipe. See pipe(7) for
+ more info.
+ </p>
+
+ <pre>
+ ...
+ <serial type="pipe">
+ <source path="/tmp/mypipe"/>
+ <target port="1"/>
+ </serial>
+ ...</pre>
+
<h5><a name="elementsCharTCP">TCP client/server</a></h5>
<p>
@@ -850,7 +865,7 @@ qemu-kvm -net nic,model=? /dev/null
...
<serial type="tcp">
<source mode="connect" host="0.0.0.0" service="2445"/>
- <wiremode type="telnet"/>
+ <protocol type="telnet"/>
<target port="1"/>
</serial>
...</pre>
diff --git a/src/domain_conf.c b/src/domain_conf.c
index cc8c3ef..a04a131 100644
--- a/src/domain_conf.c
+++ b/src/domain_conf.c
@@ -1169,6 +1169,7 @@ error:
* <serial type="tcp">
* <source mode="bind" host="0.0.0.0" service="2445"/>
* <target port="1"/>
+ * <protocol type='raw'/>
* </serial>
*
* <serial type="udp">
@@ -1257,11 +1258,16 @@ virDomainChrDefParseXML(virConnectPtr conn,
connectHost = virXMLPropString(cur, "host");
if (connectService == NULL)
connectService = virXMLPropString(cur, "service");
- } else {
+ } else if (STREQ((const char *)mode, "bind")) {
if (bindHost == NULL)
bindHost = virXMLPropString(cur, "host");
if (bindService == NULL)
bindService = virXMLPropString(cur, "service");
+ } else {
+ virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("Unknown source mode '%s'"),
+ mode);
+ goto error;
}
if (def->type == VIR_DOMAIN_CHR_TYPE_UDP)
@@ -1340,11 +1346,18 @@ virDomainChrDefParseXML(virConnectPtr conn,
bindService = NULL;
def->data.tcp.listen = 1;
}
- if (protocol != NULL &&
- STREQ(protocol, "telnet"))
- def->data.tcp.protocol = VIR_DOMAIN_CHR_TCP_PROTOCOL_TELNET;
- else
+
+ if (protocol == NULL ||
+ STREQ(protocol, "raw"))
def->data.tcp.protocol = VIR_DOMAIN_CHR_TCP_PROTOCOL_RAW;
+ else if (STREQ(protocol, "telnet"))
+ def->data.tcp.protocol = VIR_DOMAIN_CHR_TCP_PROTOCOL_TELNET;
+ else {
+ virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("Unknown protocol '%s'"), protocol);
+ goto error;
+ }
+
break;
case VIR_DOMAIN_CHR_TYPE_UDP:
--
1.6.0.6
15 years, 4 months
[libvirt] [PATCH] qemu: Check driver is initialized up front, to avoid segfault.
by Cole Robinson
If the qemu_driver was not initialized (possibly due to an error on driver
startup), we can segfault if attempting to connect to the URI.
Signed-off-by: Cole Robinson <crobinso(a)redhat.com>
---
src/qemu_driver.c | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/src/qemu_driver.c b/src/qemu_driver.c
index 95ea882..a9b4850 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -1779,6 +1779,12 @@ static virDrvOpenStatus qemudOpen(virConnectPtr conn,
if (conn->uri->server != NULL)
return VIR_DRV_OPEN_DECLINED;
+ if (qemu_driver == NULL) {
+ qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
+ _("qemu state driver is not active"));
+ return VIR_DRV_OPEN_ERROR;
+ }
+
if (qemu_driver->privileged) {
if (STRNEQ (conn->uri->path, "/system") &&
STRNEQ (conn->uri->path, "/session")) {
@@ -1795,14 +1801,6 @@ static virDrvOpenStatus qemudOpen(virConnectPtr conn,
return VIR_DRV_OPEN_ERROR;
}
}
-
- /* URI was good, but driver isn't active */
- if (qemu_driver == NULL) {
- qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
- _("qemu state driver is not active"));
- return VIR_DRV_OPEN_ERROR;
- }
-
}
conn->privateData = qemu_driver;
--
1.6.0.6
15 years, 4 months
[libvirt] [PATCH] Link to libvirt tickets on the Red Hat Bugzilla Server
by gdolley@arpnetworks.com
From: Garry Dolley <gdolley(a)ucla.edu>
General tickets are under the 'Virtualization Tools' product category and
Fedora specific tickets are under the 'Fedora' product category.
The component is 'libvirt' in both cases.
Signed-off-by: Garry Dolley <gdolley(a)ucla.edu>
---
docs/bugs.html | 4 ++--
docs/bugs.html.in | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/bugs.html b/docs/bugs.html
index b321505..55bcc2c 100644
--- a/docs/bugs.html
+++ b/docs/bugs.html
@@ -83,13 +83,13 @@
the <code>Virtualization Tools</code> product and the <code>libvirt</code>
component.
</p>
- <ul><li><a href="">View libvirt tickets</a></li><li><a href="http://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Virtualization%...">New libvirt ticket</a></li></ul>
+ <ul><li><a href="http://bugzilla.redhat.com/buglist.cgi?component=libvirt&product=Virt...">View libvirt tickets</a></li><li><a href="http://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Virtualization%...">New libvirt ticket</a></li></ul>
<h2>Linux Distribution specific bug reports</h2>
<ul><li>
If you are using official binaries from a <strong>Fedora distribution</strong>, enter
tickets against the <code>Fedora</code> product and the <code>libvirt</code>
component.
- <ul><li><a href="">View Fedora libvirt tickets</a></li><li><a href="http://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Fedora&comp...">New Fedora libvirt ticket</a></li></ul></li><li>
+ <ul><li><a href="http://bugzilla.redhat.com/buglist.cgi?component=libvirt&product=Fedora">View Fedora libvirt tickets</a></li><li><a href="http://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Fedora&comp...">New Fedora libvirt ticket</a></li></ul></li><li>
If you are using official binaries from <strong>Red Hat Enterprise Linux distribution</strong>,
tickets against the <code>Red Hat Enterprise Linux 5</code> product and
the <code>libvirt</code> component.
diff --git a/docs/bugs.html.in b/docs/bugs.html.in
index 0eb723a..df26c15 100644
--- a/docs/bugs.html.in
+++ b/docs/bugs.html.in
@@ -23,7 +23,7 @@
</p>
<ul>
- <li><a href="">View libvirt tickets</a></li>
+ <li><a href="http://bugzilla.redhat.com/buglist.cgi?component=libvirt&product=Virt...">View libvirt tickets</a></li>
<li><a href="http://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Virtualization%...">New libvirt ticket</a></li>
</ul>
@@ -34,7 +34,7 @@
tickets against the <code>Fedora</code> product and the <code>libvirt</code>
component.
<ul>
- <li><a href="">View Fedora libvirt tickets</a></li>
+ <li><a href="http://bugzilla.redhat.com/buglist.cgi?component=libvirt&product=Fedora">View Fedora libvirt tickets</a></li>
<li><a href="http://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Fedora&comp...">New Fedora libvirt ticket</a></li>
</ul>
</li>
--
1.6.3.1
15 years, 4 months
[libvirt] Is virConnectListDefinedDomains broken?
by Hongming Xiao
Hi, list,
Recently, I upgraded my system to Xen 3.3.1 (from Xen 3.0.3). After
this, I found that virConnectListDefinedDomains no longer works. The
problem can be reproduced by executing "virsh list -all" - those
defined but inactive domains are not be returned.
Has libvirt API been tested against Xen 3.3.1? Can this problem be
fixed by upgrading libvirt to version 0.6.5? What is the best approach
to address this issue?
Thanks in advance,
Eddy
OS: CentOS 5.3
Xen:
kernel-xen.x86_64 2.6.18-128.1.14.el5 installed
kmod-drbd83-xen.x86_64 8.3.0-3 installed
xen.x86_64 3.3.1-0 installed
xen-libs.x86_64 3.3.1-0 installed
libvirt:
libvirt.x86_64 0.4.4-3 installed
libvirt-python.x86_64 0.4.4-3 installed
python-virtinst.noarch 0.300.2-12.el5 installed
virt-viewer.x86_64 0.0.2-2.el5 installed
15 years, 4 months
[libvirt] sound does not work for me
by Gene Czarcinski
I must must be doing something wrong because all the messages, etc. I have
found says that sound works for guests.
I let the guest's virtual sound device default to ES1370.
I have tried f11 32 bit, f11 64 bit, and win2k and sound just does not work
for any of them.
I tried this with F11 64 bit host (libvirt 0.6.2) and a different F11 64 bit
host with preview packages installed (libvirt 0.6.5) ... sound works on each
of the host system but does not work for an guests.
With a F11 64 bit guest, the sound preference applet shows the output device
os "null". Also, doing "lspci" shows NO sound device.
OK, what is going on?
Gene
15 years, 4 months
[libvirt] fix two "make syntax-check" failures
by Jim Meyering
Mark McLoughlin pointed out this failure:
ChangeLog-old: if (foo) free (foo)
ChangeLog-old: if (foo != NULL) free (foo)
maint.mk: found useless "if" before "free" above
make: *** [sc_avoid_if_before_free] Error 1
Here's the other:
--- po/POTFILES.in
+++ po/POTFILES.in
@@ -1,3 +1,4 @@
+cfg.mk
qemud/qemud.c
qemud/remote.c
src/bridge.c
maint.mk: you have changed the set of files with translatable diagnostics;
apply the above patch
I had fixed the latter in gnulib (now that main.mk comes
from there), but had forgotten to tell libvirt to use
the latest version of gnulib, in order to get that fix.
To do that, I ran "git syncsub" (where syncsub is an alias:
syncsub = submodule foreach git pull origin master)
then git commit -a.
Here are the two patches I'm about to push:
>From bcf2aed1a91e66fee823e9063050c14bfc4ca29d Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Thu, 9 Jul 2009 20:00:37 +0200
Subject: [PATCH 1/2] avoid a "make syntax-check" failure
* .x-sc_avoid_if_before_free: Ignore *all* ChangeLog files,
now, including ChangeLog-old.
---
.x-sc_avoid_if_before_free | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/.x-sc_avoid_if_before_free b/.x-sc_avoid_if_before_free
index 5093ef6..7e6ce62 100644
--- a/.x-sc_avoid_if_before_free
+++ b/.x-sc_avoid_if_before_free
@@ -1,5 +1 @@
-^gnulib/lib/getaddrinfo\.c$
-^gnulib/lib/printf-parse\.c$
-^gnulib/lib/vasnprintf\.c$
-^build-aux/useless-if-before-free$
-^ChangeLog$
+^ChangeLog
--
1.6.3.3.524.g8586b
>From 72978b978991f106dc0e36b10a942d9040a1df00 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Thu, 9 Jul 2009 20:02:31 +0200
Subject: [PATCH 2/2] build: update from gnulib, for latest maint.mk
* gnulib: Update submodule to latest.
This fixes the make syntax-check failure whereby sc_po_check
would complain about cfg.mk.
---
.gnulib | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/.gnulib b/.gnulib
index 1203e8d..b653eda 160000
--- a/.gnulib
+++ b/.gnulib
@@ -1 +1 @@
-Subproject commit 1203e8d1f62dec3d2436dffadd5c20793cf84366
+Subproject commit b653eda3ac4864de205419d9f41eec267cb89eeb
--
1.6.3.3.524.g8586b
15 years, 4 months
[libvirt] libvirt repositories mirrored on gitorious
by Daniel P. Berrange
FYI, I have created a libvirt project on gitorious which has a mirror of
the master branch of the libvirt.git repository. This mirror is *readonly*
and updated automatically every 15 minutes. The purpose of this mirror is
to allow people to easily publish their personal libvirt working repos
to the world. The master upstream repository for libvirt does not change,
it will remain on http://libvirt.org/git
The main project under which libvirt repos will be hosted is at this URL:
http://gitorious.org/libvirt
You'll see the master libvirt.git repository there, and if you look at
the right hand side, you'll see myself & Mark have both got clones
for our staging repos, and topic branches within those clones for various
patchsets we're working on
If you want to publish your own patches simply signup for gitorious, go
to the libvirt repository
http://gitorious.org/libvirt/libvirt
and select the 'Clone this repository on gitorious' link. A short while
later you'll have your own personal clone where you can publish work
you are doing on libvirt. Use of this is by no means compulsory, and
doesn't change how you should submit patches to libvirt. They should
still all be emailed to this list for review.
Regards,
Daniel
--
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
15 years, 4 months
[libvirt] [PATCH] Use virDomainChrTypeFromString() instead of open coding
by Mark McLoughlin
* src/domain_conf.c: replace open coded chr type parsing with
virDomainChrTypeFromString(), retaining the existing semantics
where unknown types are silently mapped to the "null" type and
"pty" is used if none is specified
---
src/domain_conf.c | 29 ++++-------------------------
1 files changed, 4 insertions(+), 25 deletions(-)
diff --git a/src/domain_conf.c b/src/domain_conf.c
index 0407207..4056a86 100644
--- a/src/domain_conf.c
+++ b/src/domain_conf.c
@@ -1204,32 +1204,11 @@ virDomainChrDefParseXML(virConnectPtr conn,
return NULL;
}
- def->type = VIR_DOMAIN_CHR_TYPE_PTY;
type = virXMLPropString(node, "type");
- if (type != NULL) {
- if (STREQ(type, "null"))
- def->type = VIR_DOMAIN_CHR_TYPE_NULL;
- else if (STREQ(type, "vc"))
- def->type = VIR_DOMAIN_CHR_TYPE_VC;
- else if (STREQ(type, "pty"))
- def->type = VIR_DOMAIN_CHR_TYPE_PTY;
- else if (STREQ(type, "dev"))
- def->type = VIR_DOMAIN_CHR_TYPE_DEV;
- else if (STREQ(type, "file"))
- def->type = VIR_DOMAIN_CHR_TYPE_FILE;
- else if (STREQ(type, "pipe"))
- def->type = VIR_DOMAIN_CHR_TYPE_PIPE;
- else if (STREQ(type, "stdio"))
- def->type = VIR_DOMAIN_CHR_TYPE_STDIO;
- else if (STREQ(type, "udp"))
- def->type = VIR_DOMAIN_CHR_TYPE_UDP;
- else if (STREQ(type, "tcp"))
- def->type = VIR_DOMAIN_CHR_TYPE_TCP;
- else if (STREQ(type, "unix"))
- def->type = VIR_DOMAIN_CHR_TYPE_UNIX;
- else
- def->type = VIR_DOMAIN_CHR_TYPE_NULL;
- }
+ if (type == NULL)
+ def->type = VIR_DOMAIN_CHR_TYPE_PTY;
+ else if ((def->type = virDomainChrTypeFromString(type)) < 0)
+ def->type = VIR_DOMAIN_CHR_TYPE_NULL;
cur = node->children;
while (cur != NULL) {
--
1.6.2.5
15 years, 4 months
[libvirt] [PATCH] Link to libvirt tickets on the Red Hat Bugzilla Server
by Garry Dolley
General tickets are under the 'Virtualization Tools' product category and
Fedora specific tickets are under the 'Fedora' product category.
The component is 'libvirt' in both cases.
Signed-off-by: Garry Dolley <gdolley(a)ucla.edu>
---
docs/bugs.html | 4 ++--
docs/bugs.html.in | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/bugs.html b/docs/bugs.html
index b321505..55bcc2c 100644
--- a/docs/bugs.html
+++ b/docs/bugs.html
@@ -83,13 +83,13 @@
the <code>Virtualization Tools</code> product and the <code>libvirt</code>
component.
</p>
- <ul><li><a href="">View libvirt tickets</a></li><li><a href="http://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Virtualization%...">New libvirt ticket</a></li></ul>
+ <ul><li><a href="http://bugzilla.redhat.com/buglist.cgi?component=libvirt&product=Virt...">View libvirt tickets</a></li><li><a href="http://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Virtualization%...">New libvirt ticket</a></li></ul>
<h2>Linux Distribution specific bug reports</h2>
<ul><li>
If you are using official binaries from a <strong>Fedora distribution</strong>, enter
tickets against the <code>Fedora</code> product and the <code>libvirt</code>
component.
- <ul><li><a href="">View Fedora libvirt tickets</a></li><li><a href="http://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Fedora&comp...">New Fedora libvirt ticket</a></li></ul></li><li>
+ <ul><li><a href="http://bugzilla.redhat.com/buglist.cgi?component=libvirt&product=Fedora">View Fedora libvirt tickets</a></li><li><a href="http://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Fedora&comp...">New Fedora libvirt ticket</a></li></ul></li><li>
If you are using official binaries from <strong>Red Hat Enterprise Linux distribution</strong>,
tickets against the <code>Red Hat Enterprise Linux 5</code> product and
the <code>libvirt</code> component.
diff --git a/docs/bugs.html.in b/docs/bugs.html.in
index 0eb723a..df26c15 100644
--- a/docs/bugs.html.in
+++ b/docs/bugs.html.in
@@ -23,7 +23,7 @@
</p>
<ul>
- <li><a href="">View libvirt tickets</a></li>
+ <li><a href="http://bugzilla.redhat.com/buglist.cgi?component=libvirt&product=Virt...">View libvirt tickets</a></li>
<li><a href="http://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Virtualization%...">New libvirt ticket</a></li>
</ul>
@@ -34,7 +34,7 @@
tickets against the <code>Fedora</code> product and the <code>libvirt</code>
component.
<ul>
- <li><a href="">View Fedora libvirt tickets</a></li>
+ <li><a href="http://bugzilla.redhat.com/buglist.cgi?component=libvirt&product=Fedora">View Fedora libvirt tickets</a></li>
<li><a href="http://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Fedora&comp...">New Fedora libvirt ticket</a></li>
</ul>
</li>
--
1.6.3.1
15 years, 4 months
[libvirt] [PATCH 0/4] Use a unix socket for the qemu monitor
by Mark McLoughlin
Hi,
In order to support qemu NIC hotplug, we're planning
on sending tap file descriptors across the monitor to qemu.
If that sounds like magic, it is! One of the most
mystical and magical unix features around. See SCM_RIGHTS in
unix(7).
The upshot is that we need to switch to using a unix
socket for the qemu monitor. This patch series does just
that, while handling the tricky scenario where you start a vm
with an old version of libvirtd, update to a newer version
and restart libvirtd.
See also:
https://fedoraproject.org/wiki/Features/KVM_NIC_Hotplug
Cheers,
Mark.
15 years, 4 months