[libvirt] [PATCH 0/2] Make a wrapper for fork()
by Laine Stump
This was partly prompted by DV's suggestion last week.
The first of these patches creates a new function called virFork()
which behaves (almost) like fork() but takes care of some important
details that pretty much any call to fork() should be doing. The 2nd
switches three fork-calling functions in util.c over to using
virFork() instead of fork().
In the future, except for odd circumstances, code that needs to fork
should call virFork() instead, and if there is anything determined to
be universally necessary at fork-time, it should be added to virFork()
rather than to the callers of virFork(); hopefully this will ease
maintenance and reduce replicated bugs.
(Note that, while this is just an overall "code health" patch, a
couple bug fix patches I'll be submitting either tomorrow or Thursday
will assume it as a prerequisite).
14 years, 9 months
[libvirt] [PATCH] libvirt: Update docs for hotplug only commands
by Cole Robinson
The commands updated are SetMem, SetMaxMem, SetVcpus, and PinVcpu.
Signed-off-by: Cole Robinson <crobinso(a)redhat.com>
---
src/libvirt.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/src/libvirt.c b/src/libvirt.c
index 0e5f4a2..be17668 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -2758,6 +2758,9 @@ error:
* to Domain0 i.e. the domain where the application runs.
* This function requires privileged access to the hypervisor.
*
+ * This command only changes the runtime configuration of the domain,
+ * so can only be called on an active domain.
+ *
* Returns 0 in case of success and -1 in case of failure.
*/
int
@@ -2808,6 +2811,9 @@ error:
* to Domain0 i.e. the domain where the application runs.
* This function may requires privileged access to the hypervisor.
*
+ * This command only changes the runtime configuration of the domain,
+ * so can only be called on an active domain.
+ *
* Returns 0 in case of success and -1 in case of failure.
*/
int
@@ -4821,6 +4827,9 @@ error:
* does not support it or if growing the number is arbitrary limited.
* This function requires privileged access to the hypervisor.
*
+ * This command only changes the runtime configuration of the domain,
+ * so can only be called on an active domain.
+ *
* Returns 0 in case of success, -1 in case of failure.
*/
@@ -4879,6 +4888,9 @@ error:
* Dynamically change the real CPUs which can be allocated to a virtual CPU.
* This function requires privileged access to the hypervisor.
*
+ * This command only changes the runtime configuration of the domain,
+ * so can only be called on an active domain.
+ *
* Returns 0 in case of success, -1 in case of failure.
*/
int
--
1.6.5.2
14 years, 9 months
[libvirt] [PATCH 1/3] virterror: Make SetError work if no previous error was set
by Cole Robinson
virGetLastError returns NULL if no error has been set, not on
allocation error like virSetError assumed. Use virLastErrorObject
instead. This fixes virSetError when no error is currently stored.
Signed-off-by: Cole Robinson <crobinso(a)redhat.com>
---
src/util/virterror.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/util/virterror.c b/src/util/virterror.c
index bbf5021..cbd0ca8 100644
--- a/src/util/virterror.c
+++ b/src/util/virterror.c
@@ -304,7 +304,7 @@ int
virSetError(virErrorPtr newerr)
{
virErrorPtr err;
- err = virGetLastError();
+ err = virLastErrorObject();
if (!err)
return -1;
--
1.6.5.2
14 years, 9 months
[libvirt] [PATCH] macvtap teardown rework
by Stefan Berger
I have reworked and simplified the teardown of the macvtap device.
Basically all devices with the same MAC address and link device are kept
alive and not attempted to be torn down. If a macvtap device linked to a
physical interface with a certain MAC address 'M' is to be created it
will automatically fail if the interface is 'up'ed and another macvtap
with the same properties (MAC addr 'M', link dev) happens to be 'up'.
This will prevent the VM from starting or the device from being attached
to a running VM. Stale interfaces are assumed to be there for some
reason and not stem from libvirt.
In the VM shutdown path I am assuming that an interface name is always
available so that if the device type is DIRECT it can be torn down using
its name.
Signed-off-by: Stefan Berger <stefanb(a)us.ibm.com>
14 years, 9 months
[libvirt] [PATCH] Fix DSO linking problem for nodeinfotest
by Daniel Veillard
Following changes in Fedora about exposing shared libraries
dependancies, libvirt built failed for one of the test binaries
because it didn't explicitely required -ldl
gcc -DHAVE_CONFIG_H -I. -I.. -I../gnulib/lib -I../gnulib/lib
-I../include -I../include -I../src -I../src/util -I../src/conf
-I/usr/include/libxml2 -DGETTEXT_PACKAGE=\"libvirt\" -Wall
-Wformat -Wformat-security -Wmissing-prototypes -Wnested-externs
-Wpointer-arith -Wextra -Wshadow -Wcast-align -Wwrite-strings
-Waggregate-return -Wstrict-prototypes -Winline -Wredundant-decls
-Wno-sign-compare -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fasynchronous-unwind-tables -O2 -g -pipe -Wall
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom
-fasynchronous-unwind-tables -c nodeinfotest.c
CCLD nodeinfotest
/usr/bin/ld:
../src/.libs/libvirt_test.a(libvirt_driver_vbox_la-vbox_XPCOMCGlue.o):
undefined reference to symbol 'dlopen@(a)GLIBC_2.1'
/usr/bin/ld: note: 'dlopen@(a)GLIBC_2.1' is defined in DSO /lib/libdl.so.2
so try adding it to the linker command line
/lib/libdl.so.2: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
the following patch fixes it,
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel(a)veillard.com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
14 years, 9 months
[libvirt] [PATCH] Update QEMU JSON balloon command handling
by Daniel P. Berrange
The QEMU JSON monitor changed balloon commands to return/accept
bytes instead of kilobytes. Update libvirt to cope with this
* src/qemu/qemu_monitor_json.c: Expect/use bytes for ballooning
---
src/qemu/qemu_monitor_json.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index c20d063..4d52ad0 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -729,14 +729,14 @@ int qemuMonitorJSONGetBalloonInfo(qemuMonitorPtr mon,
goto cleanup;
}
- if (virJSONValueObjectGetNumberUlong(data, "balloon", &mem) < 0) {
+ if (virJSONValueObjectGetNumberUlong(data, "actual", &mem) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("info balloon reply was missing balloon data"));
ret = -1;
goto cleanup;
}
- *currmem = mem;
+ *currmem = (mem/1024);
ret = 1;
}
}
@@ -891,7 +891,7 @@ int qemuMonitorJSONSetBalloon(qemuMonitorPtr mon,
{
int ret;
virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("balloon",
- "U:value", (unsigned long long)newmem,
+ "U:value", ((unsigned long long)newmem)*1024,
NULL);
virJSONValuePtr reply = NULL;
if (!cmd)
--
1.6.2.5
14 years, 9 months
[libvirt] libvirt XML format.
by Kumar L Srikanth-B22348
Hi,
I have some doubts regarding libvirt XML format.
Can anyone please let me know in detail, what is <source> and <target>
tags in the libvirt XML format?
Can I put '/' in the <target> tag or are there any exceptions if I put
'/' in that?
Please let me know.
Regards,
Srikanth.
14 years, 9 months
[libvirt] [PATCH] openvzLoadDomains: don't ignore failing virUUIDFormat
by Jim Meyering
>From 23d248cec6efee5265bfa61071527506afdab137 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Wed, 17 Feb 2010 15:06:01 +0100
Subject: [PATCH] openvzLoadDomains: don't ignore failing virUUIDFormat
* src/openvz/openvz_conf.c (openvzLoadDomains): Diagnose failure of
virUUIDFormat.
---
src/openvz/openvz_conf.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c
index 51dbde5..a4aab1e 100644
--- a/src/openvz/openvz_conf.c
+++ b/src/openvz/openvz_conf.c
@@ -908,7 +908,11 @@ static int
openvzSetUUID(int vpsid){
unsigned char uuid[VIR_UUID_BUFLEN];
- virUUIDGenerate(uuid);
+ if (virUUIDGenerate(uuid)) {
+ openvzError(NULL, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Failed to generate UUID"));
+ return -1;
+ }
return openvzSetDefinedUUID(vpsid, uuid);
}
--
1.7.0.219.g6bb57
14 years, 9 months