[libvirt] [PATCH] tools: Fix virsh connect man page
by Jiri Denemark
The URI parameter is optional and xen:/// is not the default connection
URI.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
tools/virsh.pod | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/virsh.pod b/tools/virsh.pod
index c6a8be3..677931f 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -226,7 +226,7 @@ This command is only available in interactive mode.
Will print the current directory.
-=item B<connect> I<URI> [I<--readonly>]
+=item B<connect> [I<URI>] [I<--readonly>]
(Re)-Connect to the hypervisor. When the shell is first started, this
is automatically run with the I<URI> parameter requested by the C<-c>
@@ -239,7 +239,7 @@ common are:
=item xen:///
-this is used to connect to the local Xen hypervisor, this is the default
+this is used to connect to the local Xen hypervisor
=item qemu:///system
--
1.8.5.1
10 years, 11 months
[libvirt] [PATCH] specfile: fix make rpm when with_driver_modules is 1
by Laine Stump
Commit ff76566 moved around things in the specfiles to put
driver-specific files into their appropriate sub-packages (when
with_driver_modules == 1), but accidentally changed things so that the
deamon-driver-network and daemon-config-network files were only
included in a package when with_driver_modules == 0. This broke "make
rpm" on fedora (where with_driver_modules == 1).
This patch follows the pattern (already used for the files in other
sub-modules) of duplicating the files for the main package
(!with_driver_modules) and the sub-package (with_driver_modules). I
think this is asking for trouble, but the first priority is to fix the
build, then worry about removing redundancy later.
---
I would push this as a build breaker, but am unsure enough of my
specfile knowledge to be certain that I'm not breaking something else
(it does allow make rpm to complete successfully). Since I have to
leave for the weekend *right now*, I would appreciate if someone else
can push this for me if it's a proper fix.
Thanks!
libvirt.spec.in | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index f615c62..d7d0e7e 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -1843,14 +1843,16 @@ exit 0
%if ! %{with_driver_modules}
%if %{with_network}
+# Files from the daemon-driver-network sub-package
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/autostart
%dir %{_datadir}/libvirt/networks/
-%{_datadir}/libvirt/networks/default.xml
%ghost %dir %{_localstatedir}/run/libvirt/network/
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/network/
%dir %attr(0755, root, root) %{_localstatedir}/lib/libvirt/dnsmasq/
+# File from the daemon-config-network sub-package
+%{_datadir}/libvirt/networks/default.xml
%endif
%if %{with_storage_disk}
%attr(0755, root, root) %{_libexecdir}/libvirt_parthelper
@@ -1894,11 +1896,6 @@ exit 0
%endif
%endif # ! %{with_driver_modules}
- %if %{with_network}
-%files daemon-config-network
-%defattr(-, root, root)
- %endif
-
%if %{with_nwfilter}
%files daemon-config-nwfilter
%defattr(-, root, root)
@@ -1913,8 +1910,19 @@ exit 0
%endif
%if %{with_network}
+%files daemon-config-network
+%defattr(-, root, root)
+%{_datadir}/libvirt/networks/default.xml
+
%files daemon-driver-network
%defattr(-, root, root)
+%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/
+%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/
+%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/autostart
+%dir %{_datadir}/libvirt/networks/
+%ghost %dir %{_localstatedir}/run/libvirt/network/
+%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/network/
+%dir %attr(0755, root, root) %{_localstatedir}/lib/libvirt/dnsmasq/
%{_libdir}/%{name}/connection-driver/libvirt_driver_network.so
%endif
--
1.8.3.1
10 years, 11 months
[libvirt] [PATCH] libvirt-perl: Use correct free() in get_cpu_model_names
by Olaf Hering
Make check currently fails for me due to wrong free usage in
get_cpu_model_names. names is allocated by libvirt, so it should be
released with just free().
> t/100-connect..........panic: free from wrong pool at t/100-connect.t line 81.
> # Looks like you planned 25 tests but only ran 24.
> # Looks like your test died just after 24.
> dubious
> Test returned status 255 (wstat 65280, 0xff00)
> DIED. FAILED test 25
> Failed 1/25 tests, 96.00% okay (less 1 skipped test: 23 okay, 92.00%)
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
---
Virt.xs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Virt.xs b/Virt.xs
index 33758d1..27ca445 100644
--- a/Virt.xs
+++ b/Virt.xs
@@ -1925,7 +1925,7 @@ PREINIT:
PUSHs(sv_2mortal(newSVpv(names[i], 0)));
free(names[i]);
}
- Safefree(names);
+ free(names);
10 years, 11 months
[libvirt] [PATCH 0/4] Support for integrating cgroups with systemd
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
This is a much changed / expanded version of my previous work to
create cgroups via systemd. The difference is that this time it
actually works :-)
I'm not proposing this for merge until after the 1.1.1 release.
Daniel P. Berrange (4):
Add APIs for formatting systemd slice/scope names
Add support for systemd cgroup mount
Cope with races while killing processes
Enable support for systemd-machined in cgroups creation
src/libvirt_private.syms | 2 +
src/lxc/lxc_process.c | 10 +-
src/qemu/qemu_cgroup.c | 1 +
src/util/vircgroup.c | 270 +++++++++++++++++++++++++++++++++++++++++------
src/util/vircgroup.h | 2 +
src/util/virsystemd.c | 96 ++++++++++++++++-
src/util/virsystemd.h | 5 +
tests/vircgrouptest.c | 9 ++
tests/virsystemdtest.c | 48 +++++++++
9 files changed, 403 insertions(+), 40 deletions(-)
--
1.8.1.4
10 years, 11 months
[libvirt] [PATCH] LXC: Change incorrect error report in lxcContainerPivotRoot
by Gao feng
The newroot is not mounted as tmpfs, we bind root->src to it.
Signed-off-by: Gao feng <gaofeng(a)cn.fujitsu.com>
---
src/lxc/lxc_container.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index fbce8e8..86705a7 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -706,8 +706,8 @@ static int lxcContainerPivotRoot(virDomainFSDefPtr root)
/* ... and mount our root onto it */
if (mount(root->src, newroot, NULL, MS_BIND|MS_REC, NULL) < 0) {
virReportSystemError(errno,
- _("Failed to bind new root %s into tmpfs"),
- root->src);
+ _("Failed to bind %s to new root %s"),
+ root->src, newroot);
goto err;
}
--
1.8.3.1
10 years, 11 months
[libvirt] First mail & (long) question
by Joaquim Barrera
Hello everybody!
I would like to introduce myself, as this is my first contact with
libvirt mailing list (although I've been reading quite a lot of
documentation).
My name is Joaquim Barrera, from Barcelona, Catalonia. I am a computer
engineer and recently I joined a research group here in the university.
My task is related to VM migration and management, and since then (a
couple of months) I've been trying to figure some things up.
Now I need to go one step forward, and I would like to set up a nice dev
environment to try some modifications we want to make to libvirt, such
as new API or migration-related-stuff.
Although I am familiar with linux environrment and programming, I am not
really quite familiar with this kind of, may I say, professional
development, and there are some issues I need to solve before start
writting code. Some of this issues you'll find not relevant or newbie
stuff, but I assure you I tried lots of times before coming here. :-)
Here is what I got following the instructions in
http://libvirt.org/compiling.html
$ ./autogen.sh --system
$ make
After make finishes I have compiled 1.2.0 libvirt in the source tree,
and if I execute 'sudo ./run tools/virsh version' I get a this answer:
/Compiled against library: libvirt 1.2.0//
//Using library: libvirt 1.2.0//
//Using API: QEMU 1.2.0//
//Running hypervisor: QEMU 1.5.0/
(note that now I need to run virsh with sudo, I don't know exactly why)
So far, so good. I guess that, with --system flag, 1.2.0 custom libvirt
uses config files from standard directories such as
/etc/libvirt/libvirtd.conf, and if I used a custom directory instead, I
would have to redefine my VMs, am I right?
Problems come when I want to use custom 1.2.0 daemon. If I execute "sudo
service libvirt-bin stop" followed by "./daemon/libvirtd -d", then
custom virsh gives me this error:
/error: failed to connect to the hypervisor//
//error: no valid connection//
//error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No
such file or directory/
And I need to kill custom daemon and restart 1.1.1 libvirtd to recover
from this. Any advice?
Finally (sorry about this large mail), there is one thing that does
bother me quite a lot.
Using custom virsh, command history seems to vanish, as I press Arrow-UP
and I get "^[[A" in the screen, instead of last command used. Tell me,
please, that this is just some silly config I need to adjust... :_(
The final comment is, am I following the right direction to be able to
develop something with libvirt? ^^
Ok, that's all for now, thank you A LOT for your time.
Joaquim.
10 years, 11 months
[libvirt] [test-api][PATCH] Fix issue : nwfilter list never success
by Time Su
Fix issue : nwfilter list never success
---
repos/nwfilter/nwfilter_list.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/repos/nwfilter/nwfilter_list.py b/repos/nwfilter/nwfilter_list.py
index 0a3718e..8c392bc 100644
--- a/repos/nwfilter/nwfilter_list.py
+++ b/repos/nwfilter/nwfilter_list.py
@@ -48,7 +48,7 @@ def nwfilter_list(params):
nwfilter_list_dir = get_nwfilterlist_dir()
if nwfilter_num == len(nwfilter_list_api) and \
len(nwfilter_list_api) == len(nwfilter_list_dir) and \
- cmp(nwfilter_namelist_api,nwfilter_list_dir):
+ cmp(nwfilter_namelist_api,nwfilter_list_dir) == 0 :
logger.info("The number of available network filters is %s" % \
nwfilter_num)
else:
--
1.8.3.1
10 years, 11 months
[libvirt] [PATCH] Set the 'container_ttys' env variable for LXC consoles
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
Systemd specified that any /dev/pts/NNN device on which it
is expected to spawn a agetty login, should be listed in
the 'container_ttys' env variable. It should just contain
the relative paths, eg 'pts/0' not '/dev/pts/0' and should
be space separated.
http://cgit.freedesktop.org/systemd/systemd/commit/?id=1d97ff7dd71902a560...
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/lxc/lxc_container.c | 28 ++++++++++++++++++++++++++--
1 file changed, 26 insertions(+), 2 deletions(-)
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index 51fa1b3..f0b526f 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -196,10 +196,30 @@ int lxcContainerHasReboot(void)
*
* Returns a virCommandPtr
*/
-static virCommandPtr lxcContainerBuildInitCmd(virDomainDefPtr vmDef)
+static virCommandPtr lxcContainerBuildInitCmd(virDomainDefPtr vmDef,
+ char **ttyPaths,
+ size_t nttyPaths)
{
char uuidstr[VIR_UUID_STRING_BUFLEN];
virCommandPtr cmd;
+ virBuffer buf = VIR_BUFFER_INITIALIZER;
+ size_t i;
+
+ for (i = 0 ; i < nttyPaths ; i++) {
+ if (!STRPREFIX(ttyPaths[0], "/dev/")) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Expected a /dev path for '%s'"),
+ ttyPaths[0]);
+ virBufferFreeAndReset(&buf);
+ return NULL;
+ }
+ if (i)
+ virBufferAddLit(&buf, " ");
+ virBufferAdd(&buf, ttyPaths[i] + 5, -1);
+ }
+
+ if (virBufferError(&buf))
+ return NULL;
virUUIDFormat(vmDef->uuid, uuidstr);
@@ -214,9 +234,11 @@ static virCommandPtr lxcContainerBuildInitCmd(virDomainDefPtr vmDef)
virCommandAddEnvPair(cmd, "container_uuid", uuidstr);
virCommandAddEnvPair(cmd, "LIBVIRT_LXC_UUID", uuidstr);
virCommandAddEnvPair(cmd, "LIBVIRT_LXC_NAME", vmDef->name);
+ virCommandAddEnvPair(cmd, "container_ttys", virBufferCurrentContent(&buf));
if (vmDef->os.cmdline)
virCommandAddEnvPair(cmd, "LIBVIRT_LXC_CMDLINE", vmDef->os.cmdline);
+ virBufferFreeAndReset(&buf);
return cmd;
}
@@ -1789,7 +1811,9 @@ static int lxcContainerChild(void *data)
if ((hasReboot = lxcContainerHasReboot()) < 0)
goto cleanup;
- cmd = lxcContainerBuildInitCmd(vmDef);
+ cmd = lxcContainerBuildInitCmd(vmDef,
+ argv->ttyPaths,
+ argv->nttyPaths);
virCommandWriteArgLog(cmd, 1);
if (lxcContainerSetID(vmDef) < 0)
--
1.8.3.1
10 years, 11 months