[libvirt] [Charles_Duffy@messageone.com: [PATCH] autoport overrides actual VNC port number in dump-xml]
by Daniel P. Berrange
Forwarding message that was sent to wrong list...
----- Forwarded message from Charles Duffy <Charles_Duffy(a)messageone.com> -----
> To: kvm(a)vger.kernel.org
> From: Charles Duffy <Charles_Duffy(a)messageone.com>
> Subject: [PATCH] autoport overrides actual VNC port number in dump-xml
> Date: Wed, 30 Jul 2008 00:32:57 -0500
>
> Per subject; if autoport is in use for a host, the current
> virDomainGraphicsDefFormat code always emits "port=-1", even if a port
> is assigned to the host; this leaves no way for a client to find the VNC
> port assigned to the host in question.
>
> --------------090103050500010408080902
> Content-Type: text/x-diff;
> name="libvirt-fix-vnc-port-output.patch"
> Content-Transfer-Encoding: 7bit
> Content-Disposition: inline;
> filename="libvirt-fix-vnc-port-output.patch"
>
> diff --git a/src/domain_conf.c b/src/domain_conf.c
> index d629093..ece471e 100644
> --- a/src/domain_conf.c
> +++ b/src/domain_conf.c
> @@ -2431,11 +2431,11 @@ virDomainGraphicsDefFormat(virConnectPtr conn,
>
> switch (def->type) {
> case VIR_DOMAIN_GRAPHICS_TYPE_VNC:
> - if (def->data.vnc.autoport)
> - virBufferAddLit(buf, " port='-1'");
> - else if (def->data.vnc.port)
> + if (def->data.vnc.port)
> virBufferVSprintf(buf, " port='%d'",
> def->data.vnc.port);
> + else if (def->data.vnc.autoport)
> + virBufferAddLit(buf, " port='-1'");
>
> virBufferVSprintf(buf, " autoport='%s'",
> def->data.vnc.autoport ? "yes" : "no");
>
> --------------090103050500010408080902--
>
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo(a)vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
----- End forwarded message -----
--
|: 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 :|
16 years, 4 months
[libvirt] [PATCH] qemudDomainCreate check if domain is already active
by Guido Günther
Hi,
currently virsh create foo.xml overwrites running domains. In case of
qemu this leaves detached qemu processes around and the domain creation
fails later on being unable to start other domains afterwards - not
nice.
Attached patch checks if we already have a running domain by that name
and in this case refuses to create a new domain from xml by that name.
Probably this check needs to be pushed further upward since this might
affect other hypervisors too, haven't checked that though.
Cheers,
-- Guido
16 years, 4 months
[libvirt] listing domains on Fedora 8 XEN kernel
by Steve Oliphant
I am having a problem being able to get domain information in an Fedora
8 XEN environment.The code does not receive an error status on the XEN
kernel and does not get any information.
The same code running on the non XEN kernel works fine.
I am running default configuration files.
Is this a known issue?
Do I need to tweak the configuration files?
Is there anything else I need to do get the code to work on the XEN
kernel? Please point me in the right direction.
If any other information is required to assist in answering my question,
please let me know.
Thank you in advance for your help.
Steven Oliphant
Software installed:
rpm -qa | grep kernel
kernel-headers-2.6.25.9-40.fc8
kernel-devel-2.6.23.1-42.fc8
kernel-2.6.23.1-42.fc8
kernel-xen-2.6.21-2950.fc8
kernel-2.6.25.9-40.fc8
kernel-devel-2.6.25.9-40.fc8
kernel-xen-2.6.21.7-3.fc8
rpm -qa | grep xen
xen-devel-3.1.2-2.fc8
xenwatch-0.5.2-2.fc8
kernel-xen-2.6.21-2950.fc8
xen-debuginfo-3.1.2-2.fc8
kernel-xen-2.6.21.7-3.fc8
xen-libs-3.1.2-2.fc8
xen-3.1.2-2.fc8
rpm -qa | grep virt
libvirt-devel-0.4.4-1.fc8
ruby-libvirt-0.0.7-1.fc8
libvirt-python-0.4.4-1.fc8
python-virtinst-0.300.2-4.fc8
virt-manager-0.5.3-2.fc8
libvirt-debuginfo-0.4.4-1.fc8
libvirt-0.4.4-1.fc8
Non XEN kernel:
uname -a
Linux steve-1.verizon.net 2.6.25.9-40.fc8 #1 SMP Fri Jun 27 16:25:53 EDT
2008 i686 athlon i386 GNU/Linux
XEN kernel
uname -a
Linux steve-1.verizon.net 2.6.21.7-3.fc8xen #1 SMP Thu Mar 20 14:57:53
EDT 2008 i686 athlon i386 GNU/Linux
Code sample:
#include <stdio.h>
#include <libvirt/libvirt.h>
#define DOMAIN_COUNT 10
/**
* getInfo:
*
* extract the virtual machine information
*/
static void
getInfo(void) {
virConnectPtr conn = NULL; /* the hypervisor connection */
virDomainPtr dom = NULL; /* the domain being checked */
int ret;
int id;
int i, j, k, ids[DOMAIN_COUNT];
char *names[DOMAIN_COUNT];
/* NULL means connect to local Xen hypervisor */
conn = virConnectOpen(NULL);
if (conn == NULL) {
fprintf(stderr, "Failed to connect to hypervisor\n");
goto error;
}
/* Get the active domain list */
i = virConnectListDomains(conn, &ids[0], DOMAIN_COUNT);
if (i < 0) {
fprintf(stderr, "Failed to list the domains\n");
goto error;
}
for (j = 0;j < i;j++) {
if (ids[j] != 0) {
id = ids[j];
fprintf(stdout, "Active Domain: %d\n", id);
/* Get the information */
}
}
/* Get defined Domain Names */
ret = virConnectListDefinedDomains (conn, names, DOMAIN_COUNT);
if (ret < 0) {
fprintf(stderr, "Failed to get Domain Names\n");
goto error;
}
for (k = 0;k < ret;k++) {
printf("Inactive Domain Name: %s\n", names[k]);
}
error:
if (dom != NULL)
virDomainFree(dom);
if (conn != NULL)
virConnectClose(conn);
}
int main() {
getInfo();
return(0);
}
16 years, 4 months
[libvirt] what ever happened to the SCSI HBA storage backend?
by David Lively
Hi Folks -
I see Daniel Berrange submitted a SCSI HBA storage backend in March.
What ever happened to that? I'd be happy to pick this up if there's
more work to do (is there a code base later than the posted patch?)
In the longer run, I'm looking towards adding support necessary for FC
environments (like multipath). Also, it seems (to my iSCSI-ignorant
mind) that iSCSI should be just another flavor of the SCSI driver (kind
of like netfs is a flavor of the fs driver ...). Is anyone working on
such a refactoring?
Thanks,
Dave
16 years, 4 months
[libvirt] PATCH: Validate all test suite XML files against schema
by Daniel P. Berrange
After frequent prompting from John I've implemented a small test case to
validate all the domain XML files we have in the test suite against the
defined RNG schema. This showed one minor bug in the schema :-)
Daniel
diff -r c44225477420 docs/libvirt.rng
--- a/docs/libvirt.rng Wed Jul 30 14:20:38 2008 +0100
+++ b/docs/libvirt.rng Wed Jul 30 16:17:19 2008 +0100
@@ -141,6 +141,7 @@
</attribute>
<attribute name='machine'>
<choice>
+ <value>xenfv</value>
<value>pc</value>
<value>isapc</value>
</choice>
diff -r c44225477420 tests/Makefile.am
--- a/tests/Makefile.am Wed Jul 30 14:20:38 2008 +0100
+++ b/tests/Makefile.am Wed Jul 30 16:17:19 2008 +0100
@@ -37,13 +37,14 @@
test-lib.sh \
xmlrpcserver.py \
qemuxml2argvdata \
- nodeinfodata
+ nodeinfodata \
+ domainschematest
noinst_PROGRAMS = xmlrpctest xml2sexprtest sexpr2xmltest virshtest conftest \
reconnect xmconfigtest xencapstest qemuxml2argvtest qemuxml2xmltest \
nodeinfotest statstest qparamtest
-test_scripts =
+test_scripts = domainschematest
if WITH_LIBVIRTD
test_scripts += \
test_conf.sh \
diff -r c44225477420 tests/domainschematest
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/domainschematest Wed Jul 30 16:17:19 2008 +0100
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+test -z "$srcdir" && srcdir=`pwd`
+
+DOMAINDIRS="qemuxml2argvdata sexpr2xmldata xmconfigdata xml2sexprdata"
+
+n=0
+f=0
+for dir in $DOMAINDIRS
+do
+ XML=`find $dir -name '*.xml'`
+
+ for xml in $XML
+ do
+ n=`expr $n + 1`
+ printf "%4d) %-60s " $n $xml
+ result=`xmllint --relaxng $srcdir/../docs/libvirt.rng --noout $xml 2>&1`
+ ret=$?
+ if test $ret = 0; then
+ echo "OK"
+ else
+ echo "FAILED"
+ echo $result
+ f=`expr $f + 1`
+ fi
+ done
+done
+echo "Validated $n files, $f failed"
+
+ret=0
+test $f != 0 && ret=255
+exit $ret
--
|: 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 :|
16 years, 4 months
[libvirt] [PATCH] Detailed XML errors when XML is not well-formed
by Richard W.M. Jones
This patch changes the implementations lots of functions which parse
XML documents, so that if the XML document is not well-formed then we
get detailed error messages.
The general form of the change is:
static void
catchXMLError (void *ctx, const char *msg ATTRIBUTE_UNUSED, ...)
{
// a callback which calls virDomainReportError
}
virDomainDefPtr virDomainDefParseString(virConnectPtr conn,
virCapsPtr caps,
const char *xmlStr)
{
xmlParserCtxtPtr pctxt;
pctxt = xmlNewParserCtxt ();
pctxt->sax->error = catchXMLError;
xml = xmlCtxtReadDoc (pctxt, //...) etc.
There are some unavoidable shortcomings:
(1) There is no place to stash user pointers during the callback (the
suggestively named pctxt->userData field is already used for something
else), so we cannot pass the virConnectPtr to the error function. As
a result, virterror will store the error in a global variable, and
callers will probably not be able to access it.
(2) The XML parser routinely produces multiple error messages, and
virterror throws away all but the last one.
The errors do, however, get printed to stderr.
You can test this by using 'virsh define', 'virsh net-define', 'virsh
pool-define', etc. on not-well-formed XML files.
Rich.
--
Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines. Boot with a
live CD or over the network (PXE) and turn machines into Xen guests.
http://et.redhat.com/~rjones/virt-p2v
16 years, 4 months