[libvirt] VM image running on 2 Intels
by Zvi Dubitzky
I have 2 types of hosts as below ( each is 64 bits processor . number of
processor is not equal . First has 1G memory . the second 3 G memor):
IBM blade HS21 with Intel Xeon L5320 (1,86Ghz) . 8 processors (blade)
IBM desktop with Intel(R) Core(TM)2 Duo CPU E6550 @ 2.33GHz
I have generated an Ubuntu 8.10 client image on the first . It runs smooth
on the first via virsh . It runs ok on the second but not well via virsh
( define + start <xml> ). just by a direct : sudo qemu-system-x86_64 call
.
If I generate a similar image on the second host (using same .iso Ubuntu
CD image) then it runs on the first and second host smoothly via virsh
(define + start <xml>)
Is there an explanation for that ?
Also : please comment if the below qemu-system-x86_64 explicit image
start of a VM and the same done by a virsh command by : define + start
<.xml>
are equivalent and if not what change should I make to the
.xml file (below)
1. sudo qemu-system-x86_64 -hda <path/to/image/file> -m 512 -net nic,
model=e1000 -nic tap
2. The xml file
thanks
Zvi Dubitzky
Virtualization and System Architecture Email:dubi@il.ibm.com
IBM Haifa Research Laboratory Phone: +972-4-8296182
Haifa, 31905, ISRAEL
15 years, 6 months
[libvirt] [PATCH 1/2] support for multiple graphics devices
by Pritesh Kothari
Hi All,
I have added support for multiple graphics devices, the patches are as below.
I have checked them against current cvs head and works fine
PATCH 1/2: contains changes in libvirt for multiple graphics devices
PATCH 2/2: contains corresponding changes in qemu driver.
Regards,
Pritesh
15 years, 6 months
[libvirt] libvirt will create two guest with the same name, but with different UUIDs
by Kaitlin Rupert
Hi,
libvirt allows you to create two guests with same name, but with
different UUIDs.
This causes some problems in the reporting though. virsh will report
that a guest is running (when it isn't). This also causes some confusion
for the dominfo call - virsh will only return info for one of the
guests. I've seen similar issues when using the virDomainLookupByName()
API.
I suspect all the issues are the same bug, but I haven't had a chance to
track down where.
Thanks!
# virsh version
Compiled against library: libvir 0.6.3
Using library: libvir 0.6.3
Using API: QEMU 0.6.3
Running hypervisor: QEMU 0.9.1
# virsh list --all
Id Name State
----------------------------------
109 demo2 running
- domU1 shut off
- test_domain shut off
# virsh dumpxml demo2
<domain type='kvm' id='109'>
<name>demo2</name>
<uuid>4dea24b3-1d52-d8f3-2516-782e98a23fa0</uuid>
<memory>131072</memory>
<currentMemory>131072</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch='i686' machine='pc'>hvm</type>
<boot dev='hd'/>
</os>
<clock offset='utc'/>
<on_poweroff>restart</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/bin/qemu-kvm</emulator>
<disk type='file' device='disk'>
<source file='/tmp/default-kvm-dimage'/>
<target dev='hda' bus='ide'/>
</disk>
<interface type='user'>
<mac address='24:42:53:21:52:45'/>
</interface>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='5900' autoport='yes'/>
</devices>
</domain>
# cat demo2
<domain type='kvm' id='55'>
<name>demo2</name>
<uuid>4dea24b3-1d52-d8f3-2516-782e98a23fa3</uuid>
<memory>131072</memory>
<currentMemory>131072</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch='i686' machine='pc'>hvm</type>
<boot dev='hd'/>
</os>
<clock offset='utc'/>
<on_poweroff>restart</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/bin/qemu-kvm</emulator>
<disk type='file' device='disk'>
<source file='/tmp/default-kvm-dimage'/>
<target dev='hda' bus='ide'/>
</disk>
<interface type='user'>
<mac address='24:42:53:21:52:45'/>
</interface>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='5902' autoport='yes'/>
</devices>
</domain>
# virsh define demo2
Domain demo2 defined from demo2
# virsh list --all
Id Name State
----------------------------------
109 demo2 running
- demo2 running
- domU1 shut off
- test_domain shut off
# ps -ef | grep qemu
root 11464 1 96 09:04 ? 00:02:12 /usr/bin/qemu-kvm -S -M
pc -cpu qemu32 -m 128 -smp 1 -name demo2 -uuid
4dea24b3-1d52-d8f3-2516-782e98a23fa0 -monitor pty -pidfile
/var/run/libvirt/qemu//demo2.pid -no-acpi -boot c -drive
file=/tmp/default-kvm-dimage,if=ide,index=0,boot=on -net
nic,macaddr=24:42:53:21:52:45,vlan=0 -net user,vlan=0 -serial none
-parallel none -usb -vnc 127.0.0.1:0
root 11483 27407 0 09:06 pts/1 00:00:00 grep qemu
#
--
Kaitlin Rupert
IBM Linux Technology Center
kaitlin(a)linux.vnet.ibm.com
15 years, 6 months
[libvirt] PATCH: Add a new error code for invalid operations
by Daniel P. Berrange
A number of operations are only valid when the corresponding object is in
a particular state. eg, you can only suspend a domain, if it is currently
running. We don't have a very consistent way of reporting this problem
across drivers, so this patch introduces a new error code for this situation
called VIR_ERR_INVALID_OPERATION. This code is intended to be used if the
operation is supported, but not applicable for the object at this time.
It updates the Xen and QEMU drivers to use this error code.
Daniel
diff -r 2e97361b7242 include/libvirt/virterror.h
--- a/include/libvirt/virterror.h Mon Apr 27 11:44:32 2009 +0100
+++ b/include/libvirt/virterror.h Mon Apr 27 12:12:23 2009 +0100
@@ -157,6 +157,7 @@ typedef enum {
VIR_ERR_INVALID_NODE_DEVICE,/* invalid node device object */
VIR_ERR_NO_NODE_DEVICE,/* node device not found */
VIR_ERR_NO_SECURITY_MODEL, /* security model not found */
+ VIR_ERR_OPERATION_INVALID, /* operation is not applicable at this time */
} virErrorNumber;
/**
diff -r 2e97361b7242 src/qemu_driver.c
--- a/src/qemu_driver.c Mon Apr 27 11:44:32 2009 +0100
+++ b/src/qemu_driver.c Mon Apr 27 12:12:23 2009 +0100
@@ -1325,7 +1325,7 @@ static int qemudStartVMDaemon(virConnect
FD_ZERO(&keepfd);
if (virDomainIsActive(vm)) {
- qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ qemudReportError(conn, NULL, NULL, VIR_ERR_OPERATION_INVALID,
"%s", _("VM is already active"));
return -1;
}
@@ -2214,7 +2214,7 @@ static int qemudDomainSuspend(virDomainP
goto cleanup;
}
if (!virDomainIsActive(vm)) {
- qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED,
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_INVALID,
"%s", _("domain is not running"));
goto cleanup;
}
@@ -2267,7 +2267,7 @@ static int qemudDomainResume(virDomainPt
goto cleanup;
}
if (!virDomainIsActive(vm)) {
- qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED,
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_INVALID,
"%s", _("domain is not running"));
goto cleanup;
}
@@ -2755,7 +2755,7 @@ static int qemudDomainSave(virDomainPtr
}
if (!virDomainIsActive(vm)) {
- qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED,
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_INVALID,
"%s", _("domain is not running"));
goto cleanup;
}
@@ -2890,7 +2890,7 @@ static int qemudDomainSetVcpus(virDomain
}
if (virDomainIsActive(vm)) {
- qemudReportError(dom->conn, dom, NULL, VIR_ERR_NO_SUPPORT, "%s",
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_INVALID, "%s",
_("cannot change vcpu count of an active domain"));
goto cleanup;
}
@@ -2942,8 +2942,16 @@ qemudDomainPinVcpu(virDomainPtr dom,
vm = virDomainFindByUUID(&driver->domains, dom->uuid);
qemuDriverUnlock(driver);
- if (!virDomainIsActive(vm)) {
- qemudReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_ARG,
+ if (!vm) {
+ char uuidstr[VIR_UUID_STRING_BUFLEN];
+ virUUIDFormat(dom->uuid, uuidstr);
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_NO_DOMAIN,
+ _("no domain with matching uuid '%s'"), uuidstr);
+ goto cleanup;
+ }
+
+ if (!virDomainIsActive(vm)) {
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_INVALID,
"%s",_("cannot pin vcpus on an inactive domain"));
goto cleanup;
}
@@ -3003,8 +3011,16 @@ qemudDomainGetVcpus(virDomainPtr dom,
vm = virDomainFindByUUID(&driver->domains, dom->uuid);
qemuDriverUnlock(driver);
- if (!virDomainIsActive(vm)) {
- qemudReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_ARG,
+ if (!vm) {
+ char uuidstr[VIR_UUID_STRING_BUFLEN];
+ virUUIDFormat(dom->uuid, uuidstr);
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_NO_DOMAIN,
+ _("no domain with matching uuid '%s'"), uuidstr);
+ goto cleanup;
+ }
+
+ if (!virDomainIsActive(vm)) {
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_INVALID,
"%s",_("cannot pin vcpus on an inactive domain"));
goto cleanup;
}
@@ -3248,7 +3264,7 @@ static int qemudDomainRestore(virConnect
vm = virDomainFindByName(&driver->domains, def->name);
if (vm) {
if (virDomainIsActive(vm)) {
- qemudReportError(conn, NULL, NULL, VIR_ERR_OPERATION_FAILED,
+ qemudReportError(conn, NULL, NULL, VIR_ERR_OPERATION_INVALID,
_("domain is already active as '%s'"), vm->def->name);
goto cleanup;
} else {
@@ -3503,7 +3519,7 @@ static int qemudDomainUndefine(virDomain
}
if (virDomainIsActive(vm)) {
- qemudReportError(dom->conn, dom, NULL, VIR_ERR_INTERNAL_ERROR,
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_INVALID,
"%s", _("cannot delete active domain"));
goto cleanup;
}
@@ -3900,7 +3916,7 @@ static int qemudDomainAttachDevice(virDo
if (!virDomainIsActive(vm)) {
qemuDriverUnlock(driver);
- qemudReportError(dom->conn, dom, NULL, VIR_ERR_INTERNAL_ERROR,
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_INVALID,
"%s", _("cannot attach device on inactive domain"));
goto cleanup;
}
@@ -4052,7 +4068,7 @@ static int qemudDomainDetachDevice(virDo
if (!virDomainIsActive(vm)) {
qemuDriverUnlock(driver);
- qemudReportError(dom->conn, dom, NULL, VIR_ERR_INTERNAL_ERROR,
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_INVALID,
"%s", _("cannot detach device on inactive domain"));
goto cleanup;
}
@@ -4212,7 +4228,7 @@ qemudDomainBlockStats (virDomainPtr dom,
goto cleanup;
}
if (!virDomainIsActive (vm)) {
- qemudReportError (dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED,
+ qemudReportError (dom->conn, dom, NULL, VIR_ERR_OPERATION_INVALID,
"%s", _("domain is not running"));
goto cleanup;
}
@@ -4351,7 +4367,7 @@ qemudDomainInterfaceStats (virDomainPtr
}
if (!virDomainIsActive(vm)) {
- qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED,
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_INVALID,
"%s", _("domain is not running"));
goto cleanup;
}
@@ -4497,7 +4513,7 @@ qemudDomainMemoryPeek (virDomainPtr dom,
}
if (!virDomainIsActive(vm)) {
- qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED,
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_INVALID,
"%s", _("domain is not running"));
goto cleanup;
}
@@ -4824,7 +4840,7 @@ qemudDomainMigratePerform (virDomainPtr
}
if (!virDomainIsActive(vm)) {
- qemudReportError (dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED,
+ qemudReportError (dom->conn, dom, NULL, VIR_ERR_OPERATION_INVALID,
"%s", _("domain is not running"));
goto cleanup;
}
diff -r 2e97361b7242 src/virterror.c
--- a/src/virterror.c Mon Apr 27 11:44:32 2009 +0100
+++ b/src/virterror.c Mon Apr 27 12:12:23 2009 +0100
@@ -1018,6 +1018,12 @@ virErrorMsg(virErrorNumber error, const
else
errmsg = _("Security model not found: %s");
break;
+ case VIR_ERR_OPERATION_INVALID:
+ if (info == NULL)
+ errmsg = _("Requested operation is not valid");
+ else
+ errmsg = _("Requested operation is not valid: %s");
+ break;
}
return (errmsg);
}
diff -r 2e97361b7242 src/xen_internal.c
--- a/src/xen_internal.c Mon Apr 27 11:44:32 2009 +0100
+++ b/src/xen_internal.c Mon Apr 27 12:12:23 2009 +0100
@@ -1068,9 +1068,14 @@ xenHypervisorGetSchedulerType(virDomainP
}
priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
- if (priv->handle < 0 || domain->id < 0) {
+ if (priv->handle < 0) {
virXenErrorFunc(domain->conn, VIR_ERR_INTERNAL_ERROR, __FUNCTION__,
- "priv->handle or domain->id invalid", 0);
+ "priv->handle invalid", 0);
+ return NULL;
+ }
+ if (domain->id < 0) {
+ virXenError(domain->conn, VIR_ERR_OPERATION_INVALID,
+ "%s", _("domain is not running"));
return NULL;
}
@@ -1143,9 +1148,14 @@ xenHypervisorGetSchedulerParameters(virD
}
priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
- if (priv->handle < 0 || domain->id < 0) {
+ if (priv->handle < 0) {
virXenErrorFunc(domain->conn, VIR_ERR_INTERNAL_ERROR, __FUNCTION__,
- "priv->handle or domain->id invalid", 0);
+ "priv->handle invalid", 0);
+ return -1;
+ }
+ if (domain->id < 0) {
+ virXenError(domain->conn, VIR_ERR_OPERATION_INVALID,
+ "%s", _("domain is not running"));
return -1;
}
@@ -1241,9 +1251,14 @@ xenHypervisorSetSchedulerParameters(virD
}
priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
- if (priv->handle < 0 || domain->id < 0) {
- virXenErrorFunc (domain->conn, VIR_ERR_INTERNAL_ERROR, __FUNCTION__,
- "priv->handle or domain->id invalid", 0);
+ if (priv->handle < 0) {
+ virXenErrorFunc(domain->conn, VIR_ERR_INTERNAL_ERROR, __FUNCTION__,
+ "priv->handle invalid", 0);
+ return -1;
+ }
+ if (domain->id < 0) {
+ virXenError(domain->conn, VIR_ERR_OPERATION_INVALID,
+ "%s", _("domain is not running"));
return -1;
}
diff -r 2e97361b7242 src/xend_internal.c
--- a/src/xend_internal.c Mon Apr 27 11:44:32 2009 +0100
+++ b/src/xend_internal.c Mon Apr 27 12:12:23 2009 +0100
@@ -2970,7 +2970,7 @@ xenDaemonDomainSuspend(virDomainPtr doma
}
if (domain->id < 0) {
- virXendError(domain->conn, VIR_ERR_INVALID_ARG,
+ virXendError(domain->conn, VIR_ERR_OPERATION_INVALID,
_("Domain %s isn't running."), domain->name);
return(-1);
}
@@ -2997,7 +2997,7 @@ xenDaemonDomainResume(virDomainPtr domai
}
if (domain->id < 0) {
- virXendError(domain->conn, VIR_ERR_INVALID_ARG,
+ virXendError(domain->conn, VIR_ERR_OPERATION_INVALID,
_("Domain %s isn't running."), domain->name);
return(-1);
}
@@ -3025,7 +3025,7 @@ xenDaemonDomainShutdown(virDomainPtr dom
}
if (domain->id < 0) {
- virXendError(domain->conn, VIR_ERR_INVALID_ARG,
+ virXendError(domain->conn, VIR_ERR_OPERATION_INVALID,
_("Domain %s isn't running."), domain->name);
return(-1);
}
@@ -3054,7 +3054,7 @@ xenDaemonDomainReboot(virDomainPtr domai
}
if (domain->id < 0) {
- virXendError(domain->conn, VIR_ERR_INVALID_ARG,
+ virXendError(domain->conn, VIR_ERR_OPERATION_INVALID,
_("Domain %s isn't running."), domain->name);
return(-1);
}
@@ -3085,7 +3085,7 @@ xenDaemonDomainDestroy(virDomainPtr doma
}
if (domain->id < 0) {
- virXendError(domain->conn, VIR_ERR_INVALID_ARG,
+ virXendError(domain->conn, VIR_ERR_OPERATION_INVALID,
_("Domain %s isn't running."), domain->name);
return(-1);
}
@@ -3160,7 +3160,7 @@ xenDaemonDomainSave(virDomainPtr domain,
}
if (domain->id < 0) {
- virXendError(domain->conn, VIR_ERR_INVALID_ARG,
+ virXendError(domain->conn, VIR_ERR_OPERATION_INVALID,
_("Domain %s isn't running."), domain->name);
return(-1);
}
@@ -3197,7 +3197,7 @@ xenDaemonDomainCoreDump(virDomainPtr dom
}
if (domain->id < 0) {
- virXendError(domain->conn, VIR_ERR_INVALID_ARG,
+ virXendError(domain->conn, VIR_ERR_OPERATION_INVALID,
_("Domain %s isn't running."), domain->name);
return(-1);
}
--
|: 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, 7 months
[libvirt] [PATCH 2/2] Support for 'hostonly' and 'internal' network in VirtualBox
by Pritesh Kothari
Hi All,
I have added the support for hostonly and internal network as suggested on irc
and list and am attaching the patch for same.
PATCH 1/2: contains changes in the xml parsing/formatting on libvirt side
namely adding a mode attribute to <source> tag in domain/interface xml
PATCH 2/2: contains changes in the vbox driver itself.
Regards,
Pritesh
15 years, 7 months
[libvirt] PATCH: Allow for quiet build output
by Daniel P. Berrange
The following patch is a slightly gross hack that puts a wrapper around
libtool to make it STFU, and only print the name of the output file, and
associated input files. Since we can't change the automake generated
Makefile.in to add '@' in front of all libtool commands, this sill won't
be quiet by default. To make it really quiet you need to run 'make -s'
eg, a short transcript with this applied....
$ make -s
Making all in gnulib/lib
(CC) -o c-ctype.lo c-ctype.c
(CC) -o asnprintf.lo asnprintf.c
(CC) -o physmem.lo physmem.c
(CC) -o printf-args.lo printf-args.c
(CC) -o printf-parse.lo printf-parse.c
(CC) -o tempname.lo tempname.c
(CC) -o vasnprintf.lo vasnprintf.c
(LD) -o libgnu.la c-ctype.lo asnprintf.lo physmem.lo printf-args.lo printf-parse.lo tempname.lo vasnprintf.lo
Making all in include
Making all in libvirt
Making all in src
(CC) -o bridge.lo bridge.c
(CC) -o buf.lo buf.c
(CC) -o conf.lo conf.c
(CC) -o event.lo event.c
(CC) -o hash.lo hash.c
(CC) -o iptables.lo iptables.c
(CC) -o logging.lo logging.c
(CC) -o memory.lo memory.c
(CC) -o pci.lo pci.c
(CC) -o qparams.lo qparams.c
(CC) -o threads.lo threads.c
(CC) -o uuid.lo uuid.c
(CC) -o util.lo util.c
(CC) -o virterror.lo virterror.c
(CC) -o xml.lo xml.c
(LD) -o libvirt_util.la bridge.lo buf.lo conf.lo event.lo hash.lo iptables.lo logging.lo memory.lo pci.lo qparams.lo threads.lo uuid.lo util.lo virterror.lo xml.lo
(CC) -o libvirt_driver_la-driver.lo driver.c
(CC) -o libvirt_driver_la-datatypes.lo datatypes.c
(CC) -o libvirt_driver_la-domain_event.lo domain_event.c
(CC) -o libvirt_driver_la-stats_linux.lo stats_linux.c
(CC) -o libvirt_driver_la-libvirt.lo libvirt.c
(CC) -o libvirt_driver_la-capabilities.lo capabilities.c
(CC) -o libvirt_driver_la-domain_conf.lo domain_conf.c
(CC) -o libvirt_driver_la-nodeinfo.lo nodeinfo.c
(CC) -o libvirt_driver_la-network_conf.lo network_conf.c
(CC) -o libvirt_driver_la-storage_conf.lo storage_conf.c
(CC) -o libvirt_driver_la-node_device_conf.lo node_device_conf.c
(LD) -o libvirt_driver.la libvirt_driver_la-driver.lo libvirt_driver_la-datatypes.lo libvirt_driver_la-domain_event.lo libvirt_driver_la-stats_linux.lo libvirt_driver_la-libvirt.lo libvirt_driver_la-capabilities.lo libvirt_driver_la-domain_conf.lo libvirt_driver_la-nodeinfo.lo libvirt_driver_la-network_conf.lo libvirt_driver_la-storage_conf.lo libvirt_driver_la-node_device_conf.lo
(CC) -o test.lo test.c
(LD) -o libvirt_driver_test.la test.lo
(CC) -o libvirt_driver_remote_la-remote_internal.lo remote_internal.c
(CC) -o libvirt_driver_remote_la-remote_protocol.lo ../qemud/remote_protocol.c
(LD) -o libvirt_driver_remote.la libvirt_driver_remote_la-remote_internal.lo libvirt_driver_remote_la-remote_protocol.lo
(CC) -o libvirt_driver_xen_la-proxy_internal.lo proxy_internal.c
Aside from changing libtool and automake themselves, I don't see any
easier way to do this better.
b/mylibtool | 62 ++++++++++++++++++++++++++++
examples/domain-events/events-c/Makefile.am | 3 +
examples/hellolibvirt/Makefile.am | 3 +
gnulib/lib/Makefile.am | 3 +
proxy/Makefile.am | 3 +
qemud/Makefile.am | 3 +
src/Makefile.am | 3 +
tests/Makefile.am | 3 +
tools/Makefile.am | 3 +
9 files changed, 86 insertions(+)
Daniel
diff -r f60b121571f2 examples/domain-events/events-c/Makefile.am
--- a/examples/domain-events/events-c/Makefile.am Mon Apr 27 12:12:23 2009 +0100
+++ b/examples/domain-events/events-c/Makefile.am Tue Apr 28 12:26:44 2009 +0100
@@ -1,3 +1,6 @@
+AM_LIBTOOLFLAGS = --silent
+LIBTOOL = $(top_srcdir)/mylibtool
+
INCLUDES = -I@top_srcdir@/include
noinst_PROGRAMS = event-test
event_test_CFLAGS = $(WARN_CFLAGS)
diff -r f60b121571f2 examples/hellolibvirt/Makefile.am
--- a/examples/hellolibvirt/Makefile.am Mon Apr 27 12:12:23 2009 +0100
+++ b/examples/hellolibvirt/Makefile.am Tue Apr 28 12:26:44 2009 +0100
@@ -1,3 +1,6 @@
+AM_LIBTOOLFLAGS = --silent
+LIBTOOL = $(top_srcdir)/mylibtool
+
INCLUDES = -I@top_srcdir@/include
noinst_PROGRAMS = hellolibvirt
hellolibvirt_CFLAGS = $(WARN_CFLAGS)
diff -r f60b121571f2 gnulib/lib/Makefile.am
--- a/gnulib/lib/Makefile.am Mon Apr 27 12:12:23 2009 +0100
+++ b/gnulib/lib/Makefile.am Tue Apr 28 12:26:44 2009 +0100
@@ -11,6 +11,9 @@
# Generated by gnulib-tool.
# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib/lib --m4-base=gnulib/m4 --doc-base=doc --tests-base=gnulib/tests --aux-dir=build-aux --with-tests --lgpl=2 --libtool --macro-prefix=gl --no-vc-files c-ctype close connect getaddrinfo gethostname getpass gettext inet_pton ioctl mkstemp mktempd perror physmem poll posix-shell random_r recv send setsockopt socket stpcpy strerror strndup strsep sys_stat time_r useless-if-before-free vasprintf vc-list-files verify
+AM_LIBTOOLFLAGS = --silent
+LIBTOOL = $(top_srcdir)/mylibtool
+
AUTOMAKE_OPTIONS = 1.5 gnits
SUBDIRS =
diff -r f60b121571f2 mylibtool
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mylibtool Tue Apr 28 12:26:44 2009 +0100
@@ -0,0 +1,62 @@
+#!/bin/sh
+
+mode=libtool
+cfiles=""
+ofiles=""
+afiles=""
+
+wantnext=0
+for v in "$@"
+do
+ case $v
+ in
+ --mode=compile)
+ mode=CC
+ ;;
+ --mode=link)
+ mode=LD
+ ;;
+ esac
+
+ case $v
+ in
+ *.c)
+ cfiles="$cfiles $v"
+ ;;
+ *.o)
+ if [ "$mode" = "LD" -o "$wantnext" = "1" ]; then
+ ofiles="$ofiles $v"
+ fi
+ ;;
+ *.lo)
+ if [ "$mode" = "LD" -o "$wantnext" = "1" ]; then
+ ofiles="$ofiles $v"
+ fi
+ ;;
+ esac
+
+ if [ "$mode" = "LD" -a "$wantnext" = "1" ]; then
+ afiles="$afiles $v"
+ fi
+
+ if [ "$v" = "-o" ]; then
+ wantnext=1
+ else
+ wantnext=0
+ fi
+done
+
+#afiles=`echo $afiles | sed -e 's/ /\n/g' | sort | uniq | tr '\n' ' '`
+#cfiles=`echo $cfiles | sed -e 's/ /\n/g' | sort | uniq | tr '\n' ' '`
+#ofiles=`echo $ofiles | sed -e 's/ /\n/g' | sort | uniq | tr '\n' ' '`
+
+args=""
+test -n "$afiles" && args="$args -o$afiles"
+test -n "$ofiles" -a "$mode" = "CC" && args="$args -o"
+test -n "$ofiles" && args="$args$ofiles"
+test -n "$cfiles" && args="$args$cfiles"
+
+echo "($mode)$args"
+
+here=`dirname $0`
+exec $here/libtool "$@"
diff -r f60b121571f2 proxy/Makefile.am
--- a/proxy/Makefile.am Mon Apr 27 12:12:23 2009 +0100
+++ b/proxy/Makefile.am Tue Apr 28 12:26:44 2009 +0100
@@ -1,5 +1,8 @@
## Process this file with automake to produce Makefile.in
+AM_LIBTOOLFLAGS = --silent
+LIBTOOL = $(top_srcdir)/mylibtool
+
if WITH_PROXY
INCLUDES = -I$(top_srcdir)/gnulib/lib -I../gnulib/lib \
-I$(top_builddir)/include -I@top_srcdir@/include \
diff -r f60b121571f2 qemud/Makefile.am
--- a/qemud/Makefile.am Mon Apr 27 12:12:23 2009 +0100
+++ b/qemud/Makefile.am Tue Apr 28 12:26:44 2009 +0100
@@ -1,5 +1,8 @@
## Process this file with automake to produce Makefile.in
+AM_LIBTOOLFLAGS = --silent
+LIBTOOL = $(top_srcdir)/mylibtool
+
DAEMON_SOURCES = \
event.c event.h \
qemud.c qemud.h \
diff -r f60b121571f2 src/Makefile.am
--- a/src/Makefile.am Mon Apr 27 12:12:23 2009 +0100
+++ b/src/Makefile.am Tue Apr 28 12:26:44 2009 +0100
@@ -1,5 +1,8 @@
## Process this file with automake to produce Makefile.in
+AM_LIBTOOLFLAGS = --silent
+LIBTOOL = $(top_srcdir)/mylibtool
+
INCLUDES = \
-I$(top_srcdir)/gnulib/lib -I../gnulib/lib \
-I../include \
diff -r f60b121571f2 tests/Makefile.am
--- a/tests/Makefile.am Mon Apr 27 12:12:23 2009 +0100
+++ b/tests/Makefile.am Tue Apr 28 12:26:44 2009 +0100
@@ -1,5 +1,8 @@
## Process this file with automake to produce Makefile.in
+AM_LIBTOOLFLAGS = --silent
+LIBTOOL = $(top_srcdir)/mylibtool
+
SHELL = $(PREFERABLY_POSIX_SHELL)
SUBDIRS = confdata sexpr2xmldata \
diff -r f60b121571f2 tools/Makefile.am
--- a/tools/Makefile.am Mon Apr 27 12:12:23 2009 +0100
+++ b/tools/Makefile.am Tue Apr 28 12:26:44 2009 +0100
@@ -1,3 +1,6 @@
+
+AM_LIBTOOLFLAGS = --silent
+LIBTOOL = $(top_srcdir)/mylibtool
bin_SCRIPTS = \
virt-xml-validate
--
|: 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, 7 months
[libvirt] qemu+tls server certificate validation failure (The certificate is not trusted)
by Scott Beardsley
I'm having a problem with remote TLS libvirt connections from an
Ubuntu Jaunty client. I've reported the bug here[1] but haven't had
any hits yet so I thought I'd come to the source. Let me know if ya'll
have any ideas or know of any bugs in the versions I'm using (see
below). I just upgraded my client to Jaunty from Intrepid and I can no
longer connect to Hardy or Intrepid libvirt servers that have TLS
enabled. I get the following errors:
$ virt-viewer -c qemu+tls://example.com/system virt.example.com
libvir: Remote error : server certificate failed validation: The
certificate is not trusted.
libvir: Remote error : unable to connect to 'example.com': Invalid argument
unable to connect to libvirt qemu+tls://example.com/system
$
In the past (ie hardy, intrepid) I was able to use the following
command. Now I get an error:
$ virt-viewer -c qemu://example.com/system virt.example.com
libvir: error : could not connect to qemu://example.com/system
unable to connect to libvirt qemu://example.com/system
$
The server's config has not changed (I've tested against libvirt-bin
versions 0.4.4-3ubuntu3.1 and 0.4.0-2ubuntu8.1 on the server side). I
have the CA certificate installed on both server and client (in
/etc/pki/CA/cacert.pem). That cert signed both my x509 client cert and
the server cert. Here is some proof that it *should* work:
$ openssl s_client -CAfile /etc/pki/CA/cacert.pem -cert
/etc/pki/libvirt/clientcert.pem -key
/etc/pki/libvirt/private/clientkey.pem -connect example.com:16514
2>/dev/null|sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p'
>servercert.pem
$ openssl verify -CAfile /etc/pki/CA/cacert.pem servercert.pem
servercert.pem: OK
$ openssl verify -CAfile /etc/pki/CA/cacert.pem /etc/pki/libvirt/clientcert.pem
/etc/pki/libvirt/clientcert.pem: OK
$
When I run strace against virt-viewer I can see that it is accessing
and (successfully opening) the correct certs/keys:
$ grep /etc/pki /tmp/out
stat64("/etc/pki/CA/cacert.pem", {st_mode=S_IFREG|0644, st_size=1716, ...}) = 0
stat64("/etc/pki/libvirt/private/clientkey.pem",
{st_mode=S_IFREG|0644, st_size=887, ...}) = 0
stat64("/etc/pki/libvirt/clientcert.pem", {st_mode=S_IFREG|0644,
st_size=1172, ...}) = 0
open("/etc/pki/CA/cacert.pem", O_RDONLY) = 5
open("/etc/pki/libvirt/private/clientkey.pem", O_RDONLY) = 5
open("/etc/pki/libvirt/clientcert.pem", O_RDONLY) = 5
$
Thanks in advance,
Scott
------------
[1] https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/366455
15 years, 7 months
[libvirt] PATCH: Fix compiler flag check for -Wformat-security
by Daniel P. Berrange
Certain versions of GCC will ignore the -Wformat-security flag unless you
have also set the -Wformat flag. Unfortunately when checking flags, we only
check one at a time in isolation, so it was thinking -Wformat-security
is not supported in Fedora. The fix is to include all previously verified
flags during the check process, but not for -Werror because for added fun,
the autoconf test program itself causes compile warnings with some flags
we have. The patch also fixes 3 harmless format problems in virsh
Daniel
Index: m4/compiler-flags.m4
===================================================================
RCS file: /data/cvs/libvirt/m4/compiler-flags.m4,v
retrieving revision 1.2
diff -u -p -r1.2 compiler-flags.m4
--- m4/compiler-flags.m4 14 Jan 2009 15:23:26 -0000 1.2
+++ m4/compiler-flags.m4 27 Apr 2009 10:34:43 -0000
@@ -24,7 +24,15 @@ AC_DEFUN([gl_COMPILER_FLAGS],
[AC_MSG_CHECKING(whether compiler accepts $1)
AC_SUBST(COMPILER_FLAGS)
ac_save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $1"
+ dnl Some flags are dependant, so we set all previously checked
+ dnl flags when testing. Except for -Werror which we have to
+ dnl check on its own, because some of our compiler flags cause
+ dnl warnings from the autoconf test program!
+ if test "$1" = "-Werror" ; then
+ CFLAGS="$CFLAGS $1"
+ else
+ CFLAGS="$CFLAGS $COMPILER_FLAGS $1"
+ fi
AC_TRY_LINK([], [], has_option=yes, has_option=no,)
echo 'int x;' >conftest.c
$CC $CFLAGS -c conftest.c 2>conftest.err
Index: src/virsh.c
===================================================================
RCS file: /data/cvs/libvirt/src/virsh.c,v
retrieving revision 1.201
diff -u -p -r1.201 virsh.c
--- src/virsh.c 15 Apr 2009 20:09:09 -0000 1.201
+++ src/virsh.c 27 Apr 2009 10:34:45 -0000
@@ -4463,7 +4463,7 @@ cmdNodeListDevicesPrint(vshControl *ctl,
}
/* Print this device */
- vshPrint(ctl, indentBuf);
+ vshPrint(ctl, "%s", indentBuf);
vshPrint(ctl, "%s\n", devices[devid]);
@@ -4487,7 +4487,7 @@ cmdNodeListDevicesPrint(vshControl *ctl,
/* If there is a child device, then print another blank line */
if (nextlastdev != -1) {
- vshPrint(ctl, indentBuf);
+ vshPrint(ctl, "%s", indentBuf);
vshPrint(ctl, " |\n");
}
@@ -4511,7 +4511,7 @@ cmdNodeListDevicesPrint(vshControl *ctl,
/* If there was no child device, and we're the last in
* a list of devices, then print another blank line */
if (nextlastdev == -1 && devid == lastdev) {
- vshPrint(ctl, indentBuf);
+ vshPrint(ctl, "%s", indentBuf);
vshPrint(ctl, "\n");
}
}
--
|: 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, 7 months