[libvirt] [PATCH JAVA] Add an automated build control script
by Daniel P. Berrange
Add a control script to be used by the automated build
system
* autobuild.sh: Automated build control file
* libvirt-java.spec.in: Include %extra_release
---
autobuild.sh | 31 +++++++++++++++++++++++++++++++
libvirt-java.spec.in | 2 +-
2 files changed, 32 insertions(+), 1 deletions(-)
create mode 100755 autobuild.sh
diff --git a/autobuild.sh b/autobuild.sh
new file mode 100755
index 0000000..cca4066
--- /dev/null
+++ b/autobuild.sh
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+set -e
+set -v
+
+test -n "$1" && RESULTS=$1 || RESULTS=results.log
+
+ant clean || :
+
+ant build docs
+
+ant test 2>&1 | tee $RESULTS
+
+rm -f *.tar.gz
+ant src
+
+if [ -n "$AUTOBUILD_COUNTER" ]; then
+ EXTRA_RELEASE=".auto$AUTOBUILD_COUNTER"
+else
+ NOW=`date +"%s"`
+ EXTRA_RELEASE=".$USER$NOW"
+fi
+
+if [ -x /usr/bin/rpmbuild ]
+then
+ ant spec
+ rpmbuild --nodeps \
+ --define "extra_release $EXTRA_RELEASE" \
+ --define "_sourcedir `pwd`/target" \
+ -ba --clean target/libvirt-java.spec
+fi
diff --git a/libvirt-java.spec.in b/libvirt-java.spec.in
index 1ded8a0..2c972b7 100644
--- a/libvirt-java.spec.in
+++ b/libvirt-java.spec.in
@@ -2,7 +2,7 @@ Summary: Java bindings for the libvirt virtualization API
Name: libvirt-java
Version: @version@
Prefix: libvirt
-Release: @release@%{?dist}
+Release: @release@%{?dist}%{?extra_release}
License: LGPLv2+
BuildArch: noarch
Group: Development/Libraries
--
1.7.4
13 years, 10 months
[libvirt] consistency of virsh help output
by Zdenek Styblik
Hello,
I've found virsh help output to be inconsistent.
~~~ SNIP ~~~
attach-disk <domain> <source> <target> [--driver <string>]...
X
attach-interface <domain> <type> <source> [<target>] ...
~~~ SNIP ~~~
where <KEYWORD> is usually explained in OPTIONS as:
~~~ SNIP ~~~
[--domain] <string> domain name, id or uuid
~~~ SNIP ~~~
Substitution of <domain> -> [--domain] <string> resp. that you can only
provide a <string> without [--domain] and it's still going to work. This
took me some time to figure out. But back on point.
As you can see from snips, once you use eg. <domain> and substitution
resp. explanation is in OPTIONS and second you put "explanation" right
into SYNOPSIS.
I think it would be worth of cleaning out and make everything one way or
another. Would it be a problem? I presume it's just matter of modifying
"couple" printf()-s.
Have a nice day,
Z.
--
Zdenek Styblik
Net/Linux admin
OS TurnovFree.net
email: stybla(a)turnovfree.net
jabber: stybla(a)jabber.turnovfree.net
13 years, 10 months
[libvirt] [PATCH 0/2] set QEMUD_CMD_FLAG_PCI_MULTIBUS for x86_64 and i686 architectures
by Wen Congyang
When we attach a interface to a guest machine, we receive the
following error messages:
[root@wency ~]# virsh attach-interface RHEL6RC network default
error: Failed to attach interface
error: internal error unable to execute QEMU command 'device_add': Bus 'pci' not found
This bug was caused by 0b864eb1.
Wen Congyang (2):
QEMUD_CMD_FLAG_PCI_MULTIBUS should be set in the function
qemuCapsExtractVersionInfo()
tests: set QEMUD_CMD_FLAG_PCI_MULTIBUS in testCompareXMLToArgvFiles()
src/qemu/qemu_capabilities.c | 12 +++++++++---
src/qemu/qemu_capabilities.h | 2 +-
src/qemu/qemu_command.c | 6 ------
src/qemu/qemu_driver.c | 20 +++++++++++---------
tests/qemuxml2argvtest.c | 9 +++++++++
5 files changed, 30 insertions(+), 19 deletions(-)
13 years, 10 months
[libvirt] [PATCH ruby-libvirt] Add a control file for automated builds
by Daniel P. Berrange
* autobuild.sh: Automated build control
* ruby-libvirt.spec: Add autobuild release tag
---
autobuild.sh | 29 +++++++++++++++++++++++++++++
ruby-libvirt.spec | 2 +-
2 files changed, 30 insertions(+), 1 deletions(-)
create mode 100755 autobuild.sh
diff --git a/autobuild.sh b/autobuild.sh
new file mode 100755
index 0000000..216264e
--- /dev/null
+++ b/autobuild.sh
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+set -e
+set -v
+
+rake clean || :
+
+rake build
+#rake test
+
+rm -rf pkg
+rake package
+
+if [ -n "$AUTOBUILD_COUNTER" ]; then
+ EXTRA_RELEASE=".auto$AUTOBUILD_COUNTER"
+else
+ NOW=`date +"%s"`
+ EXTRA_RELEASE=".$USER$NOW"
+fi
+
+if [ -f /usr/bin/rpmbuild ]; then
+ ver=`grep '^PKG_VERSION' Rakefile | sed -e "s/PKG_VERSION=//" -e "s/'//g"`
+ sed -e "s/\@VERSION\@/$ver/" < ruby-libvirt.spec > pkg/ruby-libvirt.spec
+ rpmbuild --nodeps \
+ --define "extra_release $EXTRA_RELEASE" \
+ --define "_sourcedir `pwd`/pkg" \
+ -ba --clean pkg/ruby-libvirt.spec
+fi
+
diff --git a/ruby-libvirt.spec b/ruby-libvirt.spec
index 2cefe2c..dd82a73 100644
--- a/ruby-libvirt.spec
+++ b/ruby-libvirt.spec
@@ -3,7 +3,7 @@
Name: ruby-libvirt
Version: @VERSION@
-Release: 1%{?dist}
+Release: 1%{?dist}%{?extra_release}
Summary: Ruby bindings for libvirt
Group: Development/Languages
--
1.7.4
13 years, 10 months
[libvirt] domain.rng updated ?
by arnaud.champion@devatom.fr
?Hi,
I'm working on C# bindings, my goal is to expose xml descriptions (domain, node, storage and so on...) as real C# objects, for this, I'm studying the rng files provided in /docs/schemas/ directory of the sources. I'm currently working on domain.rng.
I don't know if the domain.rng file is up to date because, for example, the disk device definition in the rng doesn't speak about the "address" node that a virhs dumpxml show :
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/var/lib/libvirt/image/Ubuntu-10.10.img'/>
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0' unit='0'/>
</disk>
Is the domain.rng up to date or should I use the libvirt.org XML format page only ?
Regards,
Arnaud
13 years, 10 months
[libvirt] [PATCH] Avoid warnings from nwfilter driver when run non-root
by Daniel P. Berrange
When run non-root the nwfilter driver logs error messages about
being unable to find iptables/ebtables commands (they are in
/sbin which isn't in $PATH). The nwfilter driver can't ever work
as non-root, so simply skip it entirely thus avoiding the error
messages
* src/conf/nwfilter_conf.h, src/nwfilter/nwfilter_driver.c,
src/nwfilter/nwfilter_gentech_driver.c,
src/nwfilter/nwfilter_gentech_driver.h: Pass 'bool privileged'
flag down to final driver impl
* src/nwfilter/nwfilter_ebiptables_driver.c: Skip initialization
if not privileged
---
src/conf/nwfilter_conf.h | 2 +-
src/nwfilter/nwfilter_driver.c | 2 +-
src/nwfilter/nwfilter_ebiptables_driver.c | 9 ++++++---
src/nwfilter/nwfilter_gentech_driver.c | 6 +++---
src/nwfilter/nwfilter_gentech_driver.h | 2 +-
5 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/src/conf/nwfilter_conf.h b/src/conf/nwfilter_conf.h
index 8f8383f..34ff399 100644
--- a/src/conf/nwfilter_conf.h
+++ b/src/conf/nwfilter_conf.h
@@ -502,7 +502,7 @@ struct domUpdateCBStruct {
};
-typedef int (*virNWFilterTechDrvInit)(void);
+typedef int (*virNWFilterTechDrvInit)(bool privileged);
typedef void (*virNWFilterTechDrvShutdown)(void);
enum virDomainNetType;
diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c
index f903311..a579306 100644
--- a/src/nwfilter/nwfilter_driver.c
+++ b/src/nwfilter/nwfilter_driver.c
@@ -69,7 +69,7 @@ nwfilterDriverStartup(int privileged) {
if (virNWFilterLearnInit() < 0)
return -1;
- virNWFilterTechDriversInit();
+ virNWFilterTechDriversInit(privileged);
if (virNWFilterConfLayerInit(virNWFilterDomainFWUpdateCB) < 0)
goto conf_init_err;
diff --git a/src/nwfilter/nwfilter_ebiptables_driver.c b/src/nwfilter/nwfilter_ebiptables_driver.c
index 1b8730d..39cd0f3 100644
--- a/src/nwfilter/nwfilter_ebiptables_driver.c
+++ b/src/nwfilter/nwfilter_ebiptables_driver.c
@@ -114,7 +114,7 @@ static const char *m_physdev_out_str = "-m physdev " PHYSDEV_OUT;
#define COMMENT_VARNAME "comment"
static int ebtablesRemoveBasicRules(const char *ifname);
-static int ebiptablesDriverInit(void);
+static int ebiptablesDriverInit(bool privileged);
static void ebiptablesDriverShutdown(void);
static int ebtablesCleanAll(const char *ifname);
static int ebiptablesAllTeardown(const char *ifname);
@@ -3653,11 +3653,14 @@ virNWFilterTechDriver ebiptables_driver = {
static int
-ebiptablesDriverInit(void)
+ebiptablesDriverInit(bool privileged)
{
virBuffer buf = VIR_BUFFER_INITIALIZER;
int cli_status;
+ if (!privileged)
+ return 0;
+
if (virMutexInit(&execCLIMutex))
return EINVAL;
@@ -3730,7 +3733,7 @@ ebiptablesDriverInit(void)
static void
-ebiptablesDriverShutdown()
+ebiptablesDriverShutdown(void)
{
VIR_FREE(gawk_cmd_path);
VIR_FREE(grep_cmd_path);
diff --git a/src/nwfilter/nwfilter_gentech_driver.c b/src/nwfilter/nwfilter_gentech_driver.c
index e64c3ec..9ef3692 100644
--- a/src/nwfilter/nwfilter_gentech_driver.c
+++ b/src/nwfilter/nwfilter_gentech_driver.c
@@ -50,17 +50,17 @@ static virNWFilterTechDriverPtr filter_tech_drivers[] = {
};
-void virNWFilterTechDriversInit() {
+void virNWFilterTechDriversInit(bool privileged) {
int i = 0;
while (filter_tech_drivers[i]) {
if (!(filter_tech_drivers[i]->flags & TECHDRV_FLAG_INITIALIZED))
- filter_tech_drivers[i]->init();
+ filter_tech_drivers[i]->init(privileged);
i++;
}
}
-void virNWFilterTechDriversShutdown() {
+void virNWFilterTechDriversShutdown(void) {
int i = 0;
while (filter_tech_drivers[i]) {
if ((filter_tech_drivers[i]->flags & TECHDRV_FLAG_INITIALIZED))
diff --git a/src/nwfilter/nwfilter_gentech_driver.h b/src/nwfilter/nwfilter_gentech_driver.h
index c9dd4a1..271bf85 100644
--- a/src/nwfilter/nwfilter_gentech_driver.h
+++ b/src/nwfilter/nwfilter_gentech_driver.h
@@ -28,7 +28,7 @@ virNWFilterTechDriverPtr virNWFilterTechDriverForName(const char *name);
int virNWFilterRuleInstAddData(virNWFilterRuleInstPtr res,
void *data);
-void virNWFilterTechDriversInit(void);
+void virNWFilterTechDriversInit(bool privileged);
void virNWFilterTechDriversShutdown(void);
enum instCase {
--
1.7.4
13 years, 10 months
[libvirt] [PATCH] Reduce log level when cgroups aren't mounted
by Daniel P. Berrange
Quite a few hosts don't have cgroups mounted and so see warnings
from libvirt logged, which then cause bug reports, etc. Reduce
the log level to INFO so they're not visible by default
* src/qemu/qemu_driver.c: Reduce log level for cgroups
---
src/qemu/qemu_driver.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 52ea98e..20a4157 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1331,7 +1331,7 @@ qemudStartup(int privileged) {
rc = virCgroupForDriver("qemu", &qemu_driver->cgroup, privileged, 1);
if (rc < 0) {
char buf[1024];
- VIR_WARN("Unable to create cgroup for driver: %s",
+ VIR_INFO("Unable to create cgroup for driver: %s, disabling cgroups",
virStrerror(-rc, buf, sizeof(buf)));
}
--
1.7.4
13 years, 10 months
[libvirt] [libvirt-snmp][PATCH v2] Remove the hard coded connection URI.
by Michal Privoznik
So now we rely on libvirt LIBVIRT_DEFAULT_URI environment variable.
---
src/libvirtSnmp.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/src/libvirtSnmp.c b/src/libvirtSnmp.c
index ce21369..39b74bd 100644
--- a/src/libvirtSnmp.c
+++ b/src/libvirtSnmp.c
@@ -180,7 +180,8 @@ int libvirtSnmpInit(void)
/* virConnectOpenAuth is called here with all default parameters,
* except, possibly, the URI of the hypervisor. */
/* TODO: configure the URI */
- conn = virConnectOpenAuth("qemu:///system", virConnectAuthPtrDefault, 0);
+ /* Use libvirt env variable LIBVIRT_DEFAULT_URI by default*/
+ conn = virConnectOpenAuth("", virConnectAuthPtrDefault, 0);
if (NULL == conn) {
printf("No connection to hypervisor\n");
--
1.7.3.5
13 years, 10 months
[libvirt] [PATCH] Fix spice's passwdValidTo setting
by Michal Privoznik
This fix the typo in the source.
https://bugzilla.redhat.com/show_bug.cgi?id=676374
---
src/conf/domain_conf.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 7c1fb47..59adf36 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -3873,7 +3873,7 @@ virDomainGraphicsDefParseXML(xmlNodePtr node, int flags) {
def->data.spice.listenAddr = virXMLPropString(node, "listen");
def->data.spice.keymap = virXMLPropString(node, "keymap");
- if (virDomainGraphicsAuthDefParseXML(node, &def->data.vnc.auth) < 0)
+ if (virDomainGraphicsAuthDefParseXML(node, &def->data.spice.auth) < 0)
goto error;
cur = node->children;
--
1.7.3.5
13 years, 10 months
[libvirt] [libvirt-snmp][PATCH] New environment variable managing connection URI.
by Michal Privoznik
Add environment variable LIBVIRT_MIB_CONNECT_URI to control URI
which snmp agent is connecting to. It is now possible to connect
to all hypervisors (including test:///) instead of hardcoded
qemu:///system, which is used now by default when variable is not
set.
---
src/libvirtSnmp.c | 5 ++++-
src/libvirtSnmp.h | 3 +++
2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/src/libvirtSnmp.c b/src/libvirtSnmp.c
index ce21369..7652da0 100644
--- a/src/libvirtSnmp.c
+++ b/src/libvirtSnmp.c
@@ -180,7 +180,10 @@ int libvirtSnmpInit(void)
/* virConnectOpenAuth is called here with all default parameters,
* except, possibly, the URI of the hypervisor. */
/* TODO: configure the URI */
- conn = virConnectOpenAuth("qemu:///system", virConnectAuthPtrDefault, 0);
+ /* A simple workaround for testing - environment variable */
+ char *connect_uri = getenv(CONNECT_URI_ENV);
+
+ conn = virConnectOpenAuth((connect_uri ? connect_uri : "qemu:///system"), virConnectAuthPtrDefault, 0);
if (NULL == conn) {
printf("No connection to hypervisor\n");
diff --git a/src/libvirtSnmp.h b/src/libvirtSnmp.h
index 4ac6130..67b6125 100644
--- a/src/libvirtSnmp.h
+++ b/src/libvirtSnmp.h
@@ -10,6 +10,9 @@
#include <net-snmp/net-snmp-includes.h>
#include <net-snmp/agent/net-snmp-agent-includes.h>
+/* Environment variable to control connection URI */
+#define CONNECT_URI_ENV "LIBVIRT_MIB_CONNECT_URI"
+
/*
* Populate libvirtGuestTable into given container.
*/
--
1.7.3.5
13 years, 10 months