[libvirt] IPv6 DNS and domain details
by Neil Wilson
Hi all,
I notice that the current IPv6 auto address implementation doesn't pass
down any DNS details to the guest machine - which means that an 'IPv6
only' guest that works automatically is currently just out of reach.
Support for handing out these details depends upon the version of
'radvd' that is installed on the host server. RHEL5's standard version
has no support for DNS options. 6.0 has 1.6 installed which can hand out
the DNS address, but you need 1.7 before DNS search lists from RFC6106
are supported.
The data for these options is available in the network definition and it
appears at first glance to be reasonably straightforward to add them.
What do you think would be the best way to implement this? Is there a
mechanism within libvirt already that checks versions of subsiduary
programs and runs slightly different code accordingly?
Or are there other plans in the pipeline?
Rgs
Neil Wilson
13 years, 8 months
[libvirt] [PATCH] docs: document freecell --all
by Eric Blake
Based on a smaller patch developed by Moritoshi Oshiro:
https://bugzilla.redhat.com/show_bug.cgi?id=693963
* tools/virsh.pod (freecell): Mention all, and clarify that
optional cellno requires --cellno.
---
I think this is the first case where virsh.pod is trying to convey
mutually exclusive options; does the resulting layout look
reasonable?
tools/virsh.pod | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/tools/virsh.pod b/tools/virsh.pod
index f4bd294..2e98d5b 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -314,10 +314,11 @@ crashed.
=back
-=item B<freecell> optional I<cellno>
+=item B<freecell> optional { I<--cellno> B<cellno> | I<--all> }
Prints the available amount of memory on the machine or within a
-NUMA cell if I<cellno> is provided.
+NUMA cell if I<cellno> is provided. If I<--all> is provided instead
+of I<--cellno>, then show the information on all NUMA cells.
=item B<cpu-baseline> I<FILE>
--
1.7.4
13 years, 8 months
[libvirt] Paused networking on VM up/down with NAT fwd
by Serge Hallyn
Hi all,
some time ago bug
https://bugs.launchpad.net/ubuntu/maverick/+source/qemu-kvm/+bug/584048
was fixed in libvirt. It's the one where when a VM is started or stopped
which has a lower macaddr than what the bridge currently has, the bridge
changes macaddr and networking pauses. The fix was to make sure that a
macaddr assigned by libvirt will start with 'fe:' making it higher than
the physical interface.
But this doesn't help when virbr0 isn't associated with any physical
nic, as in the common NAT case!
Is there anything we can do to help that case?
thanks,
-serge
13 years, 8 months
[libvirt] [PATCH] docs: remove "returns" word from beginning of lines
by Jean-Baptiste Rouault
Move "returns" keyword from beginning of API doc lines
when it does not describe return values.
Maybe the API doc extractor could be changed to look for
"returns: " to avoid such confusion.
---
src/libvirt.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/libvirt.c b/src/libvirt.c
index 85dfc58..344e921 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -10097,8 +10097,8 @@ error:
*
* The virDomainPtr object handle passed into the callback upon delivery
* of an event is only valid for the duration of execution of the callback.
- * If the callback wishes to keep the domain object after the callback
- * returns, it shall take a reference to it, by calling virDomainRef.
+ * If the callback wishes to keep the domain object after the callback returns,
+ * it shall take a reference to it, by calling virDomainRef.
* The reference can be released once the object is no longer required
* by calling virDomainFree.
*
@@ -12727,8 +12727,8 @@ error:
*
* The virDomainPtr object handle passed into the callback upon delivery
* of an event is only valid for the duration of execution of the callback.
- * If the callback wishes to keep the domain object after the callback
- * returns, it shall take a reference to it, by calling virDomainRef.
+ * If the callback wishes to keep the domain object after the callback returns,
+ * it shall take a reference to it, by calling virDomainRef.
* The reference can be released once the object is no longer required
* by calling virDomainFree.
*
--
1.7.0.4
13 years, 8 months
[libvirt] [PATCH v2] xen: Remove PATH_MAX sized stack allocation from block stats code
by Matthias Bolte
---
src/xen/block_stats.c | 51 +++++++++++++++++++++++++------------------------
1 files changed, 26 insertions(+), 25 deletions(-)
diff --git a/src/xen/block_stats.c b/src/xen/block_stats.c
index e7c80c9..1918257 100644
--- a/src/xen/block_stats.c
+++ b/src/xen/block_stats.c
@@ -113,34 +113,35 @@ read_stat (const char *path)
}
static int64_t
-read_bd_stat (int device, int domid, const char *str)
+read_bd_stat(int device, int domid, const char *str)
{
- char path[PATH_MAX];
+ static const char *paths[] = {
+ "/sys/bus/xen-backend/devices/vbd-%d-%d/statistics/%s",
+ "/sys/bus/xen-backend/devices/tap-%d-%d/statistics/%s",
+ "/sys/devices/xen-backend/vbd-%d-%d/statistics/%s",
+ "/sys/devices/xen-backend/tap-%d-%d/statistics/%s"
+ };
+
+ int i;
+ char *path;
int64_t r;
- snprintf (path, sizeof path,
- "/sys/bus/xen-backend/devices/vbd-%d-%d/statistics/%s",
- domid, device, str);
- r = read_stat (path);
- if (r >= 0) return r;
-
- snprintf (path, sizeof path,
- "/sys/bus/xen-backend/devices/tap-%d-%d/statistics/%s",
- domid, device, str);
- r = read_stat (path);
- if (r >= 0) return r;
-
- snprintf (path, sizeof path,
- "/sys/devices/xen-backend/vbd-%d-%d/statistics/%s",
- domid, device, str);
- r = read_stat (path);
- if (r >= 0) return r;
-
- snprintf (path, sizeof path,
- "/sys/devices/xen-backend/tap-%d-%d/statistics/%s",
- domid, device, str);
- r = read_stat (path);
- return r;
+ for (i = 0; i < ARRAY_CARDINALITY(paths); ++i) {
+ if (virAsprintf(&path, paths[i], domid, device, str) < 0) {
+ virReportOOMError();
+ return -1;
+ }
+
+ r = read_stat(path);
+
+ VIR_FREE(path);
+
+ if (r >= 0) {
+ return r;
+ }
+ }
+
+ return -1;
}
/* In Xenstore, /local/domain/0/backend/vbd/<domid>/<device>/state,
--
1.7.0.4
13 years, 8 months
[libvirt] [PATCH 1/3] Don't use virSetCloseExec in event loop on Win32
by Daniel P. Berrange
The virSetCloseExec API returns -1 on Win32 since it cannot
possibly work. Avoid calling it from the event loop since
is not required in this case.
* src/util/event_poll.c: Remove virSetCloseExec
---
src/util/event_poll.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/util/event_poll.c b/src/util/event_poll.c
index 91000e2..90788a4 100644
--- a/src/util/event_poll.c
+++ b/src/util/event_poll.c
@@ -658,10 +658,12 @@ int virEventPollInit(void)
}
if (pipe(eventLoop.wakeupfd) < 0 ||
- virSetNonBlock(eventLoop.wakeupfd[0]) < 0 ||
- virSetNonBlock(eventLoop.wakeupfd[1]) < 0 ||
+#ifndef WIN32
virSetCloseExec(eventLoop.wakeupfd[0]) < 0 ||
- virSetCloseExec(eventLoop.wakeupfd[1]) < 0) {
+ virSetCloseExec(eventLoop.wakeupfd[1]) < 0 ||
+#endif
+ virSetNonBlock(eventLoop.wakeupfd[0]) < 0 ||
+ virSetNonBlock(eventLoop.wakeupfd[1]) < 0) {
virReportSystemError(errno, "%s",
_("Unable to setup wakeup pipe"));
return -1;
--
1.7.4
13 years, 8 months
[libvirt] [PATCH] build: fix mingw build
by Eric Blake
Commit 02c39a2 introduced a mingw build regression, due to a
regression in gnulib's areadlink module:
../../../gnulib/lib/careadlinkat.c: In function 'careadlinkat':
../../../gnulib/lib/careadlinkat.c:143:39: error: 'const struct allocator' has no member named 'malloc'
* .gnulib: Update to latest, for careadlinkat fix.
---
Pushing under the build-breaker rule.
* .gnulib bd5d1e6...9cc9910 (1):
> careadlink: fix compilation error on mingw
.gnulib | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/.gnulib b/.gnulib
index bd5d1e6..9cc9910 160000
--- a/.gnulib
+++ b/.gnulib
@@ -1 +1 @@
-Subproject commit bd5d1e621103ea3f7fbae09010348ce2df563808
+Subproject commit 9cc991025d6139a3a8f3e0f1570bf39a66f3aafa
--
1.7.4.2
13 years, 8 months
[libvirt] patch review tool for libvirt patches?
by Laine Stump
Now that 0.9.0 is out, I'd like to ask everyone's opinions about patch
review tools.
I've been noticing lately that the volume of libvirt patches has
increased significantly, and it's getting more and more difficult for me
to keep up with reading the traffic, much less doing my part to review
the patches. It would be very helpful if I could just see a view of
pending patches, each properly colorcoded (or, even better, hidden)
based on a patch being ACKed, deprecated, someone else in process of
reviewing, etc. I know there are a few tools available, but I've never
used any of them and wonder if anyone else has, and if they might be
able to make a recommendation on something the libvirt project could use
(or maybe something I could just use myself by sending a list feed into
an application).
I'm sending this message 1) to see if others are feeling the pressure of
the extra traffic too (or is my brain just processing more slowly :-/),
and 2) to learn what your opinions are of setting up such a system for
libvirt (for *optional* use only), and any opinions you have on what's
available (or maybe you could provide a recipe for how you already
manage all the patches without going crazy).
Here's my list of requirements; feel free to add/shoot down:
1) usage must be optional, so it must be able to update itself via
monitoring messages on the list (a minimal amount of change/addition to
the current message flow might be acceptable, but nothing major, and
encountering PATCH/review/ACK messages as currently sent shouldn't make
it blow up).
2) keep track of patches that are posted, NACKed, ACKed, re-posted
(deprecating the original), and pushed (this should be done by
monitoring git, not by looking at emails, as I've noticed patches are
often pushed without a corresponding message to the list).
3) would also be nice if there was a place in the UI that those wanting
to could "take" a patch for review so that two people didn't spend a lot
of time on something not requiring that much attention, at the expense
of other ignored patches.
4) maintain patchsets according to the "n/n" notation in the header (I
mention this because one comment I saw about Gerrit said that it didn't
do this).
5) provide some sort of interface for viewing the patch, annotating it
with comments, and sending that back to the list as an ACK/NACK or
simply a comment.
6) provide a simple way to save a patchset to files that can be "git
am"ed (or maybe even do it for you, automatically creating a branch
first, etc. This could possibly even be extended into a command to push
a given patchset)
7) (of course it must be open source. Do I even need to say that? :-))
Ideally, a person wanting to use this system should be able to setup
their email to filter all libvir-list traffic containing "PATCH" in the
subject line, then create an account on the patch review system and
handle all patch review via the tool's interface
Here's a list of tool that Rich Jones came up with in another discussion
on the same topic, along with a few others that were mentioned in the
ensuing discussion. To the right, I've included comments from others
that seemed interesting to me. Please point out any that you disagree with!
Gerrit (https://code.google.com/p/gerrit) "The assumption that one issue == one patch is too deeply embedded"
Kiln (http://www.fogcreek.com/kiln/) (proprietary, so probably shouldn't be considered)
Patchwork (http://ozlabs.org/~jk/projects/patchwork/) (used by Linux kernel& kvm maintainers)
http://www.reviewboard.org/ "didn't work well with git"
Also someone pointed out that gitorious has code review aids:
http://blog.gitorious.org/2009/11/06/awesome-code-review/
If I were going to investigate one of these and try setting it up, which do you think would have the greatest likelyhood of success (if any)?
13 years, 8 months
[libvirt] [PATCH v5] qemu: Remove the managed state file only if restoring succeeded
by Osier Yang
1) Both "qemuDomainStartWithFlags" and "qemuAutostartDomain" try to
restore the domain from managedsave'ed image if it exists (by
invoking "qemuDomainObjRestore"), but it unlinks the image even
if restoring fails, which causes data loss. (This problem exists
for "virsh managedsave dom; virsh start dom").
The fix for is to unlink the managed state file only if restoring
succeeded.
2) For "virsh save dom; virsh restore dom;", it can cause data
corruption if one reuse the saved state file for restoring. Add
doc to tell user about it.
3) In "qemuDomainObjStart", if "managed_save" is NULL, we shouldn't
fallback to start the domain, skipping it to cleanup as a incidental
fix. Discovered by Eric.
---
src/qemu/qemu_driver.c | 12 +++++++-----
tools/virsh.pod | 6 +++++-
2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 48fe266..a84780b 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -3423,18 +3423,20 @@ static int qemudDomainObjStart(virConnectPtr conn,
/*
* If there is a managed saved state restore it instead of starting
- * from scratch. In any case the old state is removed.
+ * from scratch. The old state is removed once the restoring succeeded.
*/
managed_save = qemuDomainManagedSavePath(driver, vm);
+
+ if (!managed_save)
+ goto cleanup;
+
if ((managed_save) && (virFileExists(managed_save))) {
ret = qemuDomainObjRestore(conn, driver, vm, managed_save);
- if (unlink(managed_save) < 0) {
+ if ((ret == 0) && (unlink(managed_save) < 0))
VIR_WARN("Failed to remove the managed state %s", managed_save);
- }
- if (ret == 0)
- goto cleanup;
+ goto cleanup;
}
ret = qemuProcessStart(conn, driver, vm, NULL, start_paused, -1, NULL,
diff --git a/tools/virsh.pod b/tools/virsh.pod
index f4bd294..6319373 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -546,7 +546,11 @@ I<on_reboot> parameter in the domain's XML definition.
=item B<restore> I<state-file>
-Restores a domain from an B<virsh save> state file. See I<save> for more info.
+Restores a domain from an B<virsh save> state file. See I<save> for more info.
+
+B<Note>: To avoid corrupting file system contents within the domain, you
+should not reuse the saved state file to B<restore> unless you are convinced
+with reverting the domain to the previous state.
=item B<save> I<domain-id> I<state-file>
--
1.7.4
13 years, 8 months
[libvirt] [PATCH] do not build libvirt_iohelper when building without libvirtd
by Wen Congyang
The libexec program libvirt_iohelper is only for libvirtd. If we build rpm
without libvirtd, we will receive the following messages:
Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/wency/rpmbuild/BUILDROOT/libvirt-0.9.0-1.el6.x86_64
error: Installed (but unpackaged) file(s) found:
/usr/libexec/libvirt_iohelper
---
src/Makefile.am | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index 3649106..dce866e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1183,6 +1183,7 @@ EXTRA_DIST += $(LIBVIRT_QEMU_SYMBOL_FILE)
libexec_PROGRAMS =
+if WITH_LIBVIRTD
libexec_PROGRAMS += libvirt_iohelper
libvirt_iohelper_SOURCES = $(UTIL_IO_HELPER_SOURCES)
libvirt_iohelper_LDFLAGS = $(WARN_LDFLAGS) $(AM_LDFLAGS)
@@ -1191,6 +1192,7 @@ libvirt_iohelper_LDADD = \
../gnulib/lib/libgnu.la
libvirt_iohelper_CFLAGS = $(AM_CFLAGS)
+endif
if WITH_STORAGE_DISK
if WITH_LIBVIRTD
--
1.7.1
13 years, 8 months