[libvirt] [PATCH] qemuagenttest.c: Missing documentation (Timeout)
by nehaljwani
From: Nehal J Wani <nehaljw.kkd1(a)gmail.com>
In tests/qemuagenttest.c, the Timeout test should always be
called last. Any additional tests should come before this.
---
tests/qemuagenttest.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tests/qemuagenttest.c b/tests/qemuagenttest.c
index e338c98..cf32fc4 100644
--- a/tests/qemuagenttest.c
+++ b/tests/qemuagenttest.c
@@ -605,7 +605,8 @@ mymain(void)
DO_TEST(Shutdown);
DO_TEST(CPU);
DO_TEST(ArbitraryCommand);
- DO_TEST(Timeout);
+
+ DO_TEST(Timeout); /*Timeout should always be called last*/
virObjectUnref(xmlopt);
--
1.7.11.7
11 years, 2 months
[libvirt] [PATCH V2] Allow a HTTP URL for cdrom ISO image
by Aline Manera
From: Aline Manera <alinefm(a)br.ibm.com>
V1 -> V2:
- Use -drive instead of legacy -cdrom option
Aline Manera (1):
Allow a HTTP URL for cdrom ISO image
src/conf/domain_conf.c | 3 +-
src/conf/domain_conf.h | 1 +
src/qemu/qemu_command.c | 7 ++++
.../qemuxml2argv-disk-cdrom-network.args | 5 +++
.../qemuxml2argv-disk-cdrom-network.xml | 37 ++++++++++++++++++++
tests/qemuxml2argvtest.c | 2 ++
6 files changed, 54 insertions(+), 1 deletion(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-network.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-network.xml
--
1.7.10.4
11 years, 2 months
[libvirt] [PATCH] HACKING: Introduce basic Signed-off-by politic
by Michal Privoznik
With the rising number of signed-off patches appearing on the list,
we should have policy what signed-off means, and advice (enforce?)
contributors to use it.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
HACKING | 8 ++++++--
docs/hacking.html.in | 12 ++++++++----
2 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/HACKING b/HACKING
index f9f8381..e54e584 100644
--- a/HACKING
+++ b/HACKING
@@ -73,8 +73,12 @@ commit introduced the problem, mentioning that is useful. If the patch
resolves a bugzilla report, mentioning the URL of the bug number is useful;
but also summarize the issue rather than making all readers follow the link.
You can use 'git shortlog -30' to get an idea of typical summary lines.
-Libvirt does not currently attach any meaning to Signed-off-by: lines, so it
-is up to you if you want to include or omit them in the commit message.
+Moreover, you should sign off your patches, meaning you are the original
+author(s) of them and you have right to submit them under the open source
+license indicated in the file. To add the "Signed-off-by:" line to the commit
+message automatically, you can tweak the git configuration:
+
+ git config format.signoff true
diff --git a/docs/hacking.html.in b/docs/hacking.html.in
index 543c77e..f1a5c59 100644
--- a/docs/hacking.html.in
+++ b/docs/hacking.html.in
@@ -78,10 +78,14 @@
of the bug number is useful; but also summarize the issue
rather than making all readers follow the link. You can use
'git shortlog -30' to get an idea of typical summary lines.
- Libvirt does not currently attach any meaning to
- Signed-off-by: lines, so it is up to you if you want to
- include or omit them in the commit message.
- </p>
+ Moreover, you should sign off your patches, meaning you are the
+ original author(s) of them and you have right to submit them under
+ the open source license indicated in the file. To add the
+ <code>Signed-off-by:</code> line to the commit message automatically,
+ you can tweak the git configuration: </p>
+<pre>
+ git config format.signoff true
+</pre>
</li>
<li><p>Split large changes into a series of smaller patches,
--
1.8.1.5
11 years, 2 months
[libvirt] [PATCHv4 0/4]write separate module for hostdev passthrough
by cyliu@suse.com
From: Chunyan Liu <cyliu(a)suse.com>
These patches implements a separate module for hostdev passthrough so that it
could be shared by different drivers and can maintain a global state of a host
device. Plus, add passthrough to libxl driver, and change qemu driver and lxc
driver to use hostdev common library instead of their own hostdev APIs.
---
Changes to v3:
* fix Jim's comments
v3 is here:
https://www.redhat.com/archives/libvir-list/2013-August/msg00019.html
Changes to v2:
* add patches for qemu driver and lxc driver, use common library APIs instead
of their own hostdev APIs.
* add APIs for nodedev-detach and nodedev-reattach calling.
* rename functions to use unified prefix 'virHostdev'
* use VIR_ONCE_GLOBAL_INIT() as others instead of previous Init and Cleanup.
* use VIR_STRDUP instead of strdup
* rebase to latest code
v2 is here:
https://www.redhat.com/archives/libvir-list/2013-June/msg00263.html
root (4):
add hostdev passthrough common library
add pci passthrough to libxl driver
change qemu driver to use hostdev common library
change lxc driver to use common library
po/POTFILES.in | 3 +-
src/Makefile.am | 3 +-
src/libvirt_private.syms | 22 +
src/libxl/libxl_conf.c | 63 ++
src/libxl/libxl_conf.h | 4 +
src/libxl/libxl_driver.c | 262 +++++++-
src/lxc/lxc_conf.h | 4 -
src/lxc/lxc_driver.c | 45 +-
src/lxc/lxc_hostdev.c | 413 ------------
src/lxc/lxc_hostdev.h | 43 --
src/lxc/lxc_process.c | 21 +-
src/qemu/qemu_command.c | 1 -
src/qemu/qemu_conf.h | 9 +-
src/qemu/qemu_driver.c | 72 +--
src/qemu/qemu_hostdev.c | 1289 -----------------------------------
src/qemu/qemu_hostdev.h | 72 --
src/qemu/qemu_hotplug.c | 126 ++--
src/qemu/qemu_process.c | 34 +-
src/util/virhostdev.c | 1679 ++++++++++++++++++++++++++++++++++++++++++++++
src/util/virhostdev.h | 129 ++++
src/util/virpci.c | 21 +-
src/util/virpci.h | 7 +-
src/util/virscsi.c | 22 +-
src/util/virscsi.h | 8 +-
src/util/virusb.c | 23 +-
src/util/virusb.h | 8 +-
26 files changed, 2355 insertions(+), 2028 deletions(-)
delete mode 100644 src/lxc/lxc_hostdev.c
delete mode 100644 src/lxc/lxc_hostdev.h
delete mode 100644 src/qemu/qemu_hostdev.c
delete mode 100644 src/qemu/qemu_hostdev.h
create mode 100644 src/util/virhostdev.c
create mode 100644 src/util/virhostdev.h
11 years, 2 months
[libvirt] [PATCH v4 3/3] python: Use RELRO_LDFLAGS and NO_INDIRECT_LDFLAGS
by Guido Günther
A readonly GOT and detecting indirect linkage is useful here too.
---
python/Makefile.am | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/python/Makefile.am b/python/Makefile.am
index 925e1f4..3f967a9 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -28,6 +28,10 @@ INCLUDES = \
$(GETTEXT_CPPFLAGS)
AM_CFLAGS = $(WARN_CFLAGS)
+AM_LDFLAGS = \
+ $(RELRO_LDFLAGS) \
+ $(NO_INDIRECT_LDFLAGS) \
+ $(NULL)
CLASSES_EXTRA = \
libvirt-override-virConnect.py \
@@ -74,6 +78,7 @@ libvirtmod_la_CFLAGS = $(WARN_CFLAGS) $(WARN_PYTHON_CFLAGS)
libvirtmod_la_LDFLAGS = -module -avoid-version -shared \
-L$(top_builddir)/src/.libs \
+ $(AM_LDFLAGS) \
$(CYGWIN_EXTRA_LDFLAGS)
libvirtmod_la_LIBADD = $(mylibs) \
$(CYGWIN_EXTRA_LIBADD) $(CYGWIN_EXTRA_PYTHON_LIBADD)
@@ -86,6 +91,7 @@ libvirtmod_qemu_la_CFLAGS = $(WARN_PYTHON_CFLAGS)
libvirtmod_qemu_la_LDFLAGS = -module -avoid-version -shared \
-L$(top_builddir)/src/.libs \
+ $(AM_LDFLAGS) \
$(CYGWIN_EXTRA_LDFLAGS)
libvirtmod_qemu_la_LIBADD = $(myqemulibs) \
$(CYGWIN_EXTRA_LIBADD) $(CYGWIN_EXTRA_PYTHON_LIBADD)
@@ -98,6 +104,7 @@ libvirtmod_lxc_la_CFLAGS = $(WARN_PYTHON_CFLAGS)
libvirtmod_lxc_la_LDFLAGS = -module -avoid-version -shared \
-L$(top_builddir)/src/.libs \
+ $(AM_LDFLAGS) \
$(CYGWIN_EXTRA_LDFLAGS)
libvirtmod_lxc_la_LIBADD = $(mylxclibs) \
$(CYGWIN_EXTRA_LIBADD) $(CYGWIN_EXTRA_PYTHON_LIBADD)
--
1.8.4.rc3
11 years, 2 months
[libvirt] [PATCH v3] BSD: implement virNetDev(Set|Clear)IPv4Address
by Roman Bogorodskiy
Provide an implementation of virNetDev(Set|Clear)IPv4Address based on
BSD ifconfig tool in addition to 'ip' from Linux iproute2 package.
---
configure.ac | 15 +++++++++++++++
src/util/virnetdev.c | 24 ++++++++++++++++++++++++
2 files changed, 39 insertions(+)
diff --git a/configure.ac b/configure.ac
index cc2213d..7667430 100644
--- a/configure.ac
+++ b/configure.ac
@@ -387,6 +387,10 @@ if test "$prefix" = "/usr" && test "$sysconfdir" = '${prefix}/etc' ; then
sysconfdir='/etc'
fi
+dnl Specify if we rely on ifconfig instead of iproute2 (e.g. in case
+dnl we're working on BSD)
+want_ifconfig=no
+
dnl Make some notes about which OS we're compiling for, as the lxc and qemu
dnl drivers require linux headers, and storage_mpath, dtrace, and nwfilter
dnl are also linux specific. The "network" and storage_fs drivers are known
@@ -409,6 +413,8 @@ if test $with_linux = no; then
fi
if test $with_freebsd = yes; then
+ want_ifconfig=yes
+
with_firewalld=no
fi
@@ -2429,6 +2435,15 @@ AC_CHECK_DECLS([BRDGSFD, BRDGADD, BRDGDEL],
#include <net/if_bridgevar.h>
])
+# Check if we need to look for ifconfig
+if test "$want_ifconfig" = "yes"; then
+ AC_PATH_PROG([IFCONFIG_PATH], [ifconfig])
+ if test -z "$IFCONFIG_PATH"; then
+ AC_MSG_ERROR([Failed to find ifconfig.])
+ fi
+ AC_DEFINE_UNQUOTED([IFCONFIG_PATH], "$IFCONFIG_PATH", [path to ifconfig binary])
+fi
+
# Detect when running under the clang static analyzer's scan-build driver
# or Coverity-prevent's cov-build. Define STATIC_ANALYSIS accordingly.
AC_CACHE_CHECK([whether this build is done by a static analysis tool],
diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index 30df7a6..8eb4d4c 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -810,12 +810,25 @@ int virNetDevSetIPv4Address(const char *ifname,
!(bcaststr = virSocketAddrFormat(&broadcast)))) {
goto cleanup;
}
+#ifdef IFCONFIG_PATH
+ cmd = virCommandNew(IFCONFIG_PATH);
+ virCommandAddArg(cmd, ifname);
+ if (VIR_SOCKET_ADDR_IS_FAMILY(addr, AF_INET6))
+ virCommandAddArg(cmd, "inet6");
+ else
+ virCommandAddArg(cmd, "inet");
+ virCommandAddArgFormat(cmd, "%s/%u", addrstr, prefix);
+ if (bcaststr)
+ virCommandAddArgList(cmd, "broadcast", bcaststr, NULL);
+ virCommandAddArg(cmd, "alias");
+#else
cmd = virCommandNew(IP_PATH);
virCommandAddArgList(cmd, "addr", "add", NULL);
virCommandAddArgFormat(cmd, "%s/%u", addrstr, prefix);
if (bcaststr)
virCommandAddArgList(cmd, "broadcast", bcaststr, NULL);
virCommandAddArgList(cmd, "dev", ifname, NULL);
+#endif
if (virCommandRun(cmd, NULL) < 0)
goto cleanup;
@@ -895,10 +908,21 @@ int virNetDevClearIPv4Address(const char *ifname,
if (!(addrstr = virSocketAddrFormat(addr)))
goto cleanup;
+#ifdef IFCONFIG_PATH
+ cmd = virCommandNew(IFCONFIG_PATH);
+ virCommandAddArg(cmd, ifname);
+ if (VIR_SOCKET_ADDR_IS_FAMILY(addr, AF_INET6))
+ virCommandAddArg(cmd, "inet6");
+ else
+ virCommandAddArg(cmd, "inet");
+ virCommandAddArgFormat(cmd, "%s/%u", addrstr, prefix);
+ virCommandAddArg(cmd, "-alias");
+#else
cmd = virCommandNew(IP_PATH);
virCommandAddArgList(cmd, "addr", "del", NULL);
virCommandAddArgFormat(cmd, "%s/%u", addrstr, prefix);
virCommandAddArgList(cmd, "dev", ifname, NULL);
+#endif
if (virCommandRun(cmd, NULL) < 0)
goto cleanup;
--
1.8.2.3
11 years, 2 months
[libvirt] [PATCH v2] tests: Add URI precedence checking
by Martin Kletzander
Commit a0b6a36f is fixing what commit abfff210 broke, so to avoid having
to deal with this issue again, herec comes "virsh-uriprecedence".
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
Notes:
v2:
- Changed the name to virsh-uriprecedence
- Using $PWD instead of temporary dir
tests/Makefile.am | 2 ++
tests/virsh-uriprecedence | 76 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 78 insertions(+)
create mode 100755 tests/virsh-uriprecedence
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 09144d6..2fb8f37 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -98,6 +98,7 @@ EXTRA_DIST = \
storagevolxml2xmlout \
sysinfodata \
test-lib.sh \
+ virsh-uriprecedence \
vmx2xmldata \
xencapsdata \
xmconfigdata \
@@ -235,6 +236,7 @@ test_scripts += \
read-bufsiz \
read-non-seekable \
start \
+ virsh-uriprecedence \
vcpupin \
virsh-all \
virsh-optparse \
diff --git a/tests/virsh-uriprecedence b/tests/virsh-uriprecedence
new file mode 100755
index 0000000..f4d84a4
--- /dev/null
+++ b/tests/virsh-uriprecedence
@@ -0,0 +1,76 @@
+#!/bin/sh
+
+: ${srcdir=.}
+. $srcdir/test-lib.sh
+
+# This test checks if virsh obeys the proper precedence of different
+# URI settings
+test_intro "virsh-uriprecedence"
+
+virsh_bin="$abs_top_builddir/tools/virsh"
+counter=1
+ret=0
+
+cleanup_() { rm -rf "$tmphome"; }
+
+# Create all mock files/directories to avoid permission problems
+tmphome="$PWD/tmp_home"
+export XDG_CONFIG_HOME="$tmphome/.config"
+export XDG_CACHE_HOME="$tmphome/.cache"
+export XDG_RUNTIME_HOME="XDG_CACHE_HOME"
+
+mkdir -p "$XDG_CONFIG_HOME/libvirt" "$XDG_CONFIG_HOME/virsh"
+mkdir -p "$XDG_CACHE_HOME/libvirt" "$XDG_CACHE_HOME/virsh"
+mkdir -p "$XDG_RUNTIME_HOME/libvirt" "$XDG_RUNTIME_HOME/virsh"
+
+# Main function checking for the proper uri being returned
+test_uri()
+{
+ result=0
+ if [ "$($virsh_bin uri)" != "$good_uri" ]; then
+ result=1
+ ret=1
+ fi
+ test_result "$counter" "$1" "$result"
+ counter="$((counter+1))"
+}
+
+# Precedence is the following (lowest priority first):
+#
+# 1) if run as root, 'uri_default' from /etc/libvirtd/libvirt.conf,
+# otherwise qemu:///session. There is no way to mock this file for
+# virsh/libvirt.so and the user may have set anything in there that
+# would spoil the test, so we don't test this
+#
+# 2) 'uri_default' from $XDG_CONFIG_HOME/libvirt/libvirt.conf
+#
+# 3) LIBVIRT_DEFAULT_URI
+#
+# 4) VIRSH_DEFAULT_CONNECT_URI
+#
+# 5) parameter -c (--connect)
+
+unset LIBVIRT_DEFAULT_URI
+unset VIRSH_DEFAULT_CONNECT_URI
+bad_uri="test:///default?bad_uri"
+good_uri="test:///default?good_uri"
+
+printf "uri_default=\"%s\"\n" "$good_uri" >"$XDG_CONFIG_HOME/libvirt/libvirt.conf"
+test_uri "User config file"
+
+printf "uri_default=\"%s\"\n" "$bad_uri" >"$XDG_CONFIG_HOME/libvirt/libvirt.conf"
+export LIBVIRT_DEFAULT_URI="$good_uri"
+test_uri "LIBVIRT_DEFAULT_URI"
+
+export LIBVIRT_DEFAULT_URI="$bad_uri"
+export VIRSH_DEFAULT_CONNECT_URI="$good_uri"
+test_uri "VIRSH_DEFAULT_CONNECT_URI"
+
+export VIRSH_DEFAULT_CONNECT_URI="$bad_uri"
+virsh_bin="$virsh_bin --connect $good_uri"
+test_uri "Parameter"
+
+# test_uri() increases $counter even for the last test, so we must
+# decrement it
+test_final "$((counter-1))" "$ret"
+(exit "$ret"); exit "$ret"
--
1.8.3.2
11 years, 2 months
[libvirt] [PATCH] Set security label on FD for virDomainOpenGraphics
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
The virDomainOpenGraphics method accepts a UNIX socket FD from
the client app. It must set the label on this FD otherwise QEMU
will be prevented from receiving it with recvmsg.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/qemu/qemu_driver.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 5124f27..0a8e518 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -14777,6 +14777,10 @@ qemuDomainOpenGraphics(virDomainPtr dom,
goto cleanup;
}
+ if (virSecurityManagerSetImageFDLabel(driver->securityManager, vm->def,
+ fd) < 0)
+ goto cleanup;
+
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
goto cleanup;
qemuDomainObjEnterMonitor(driver, vm);
--
1.8.3.1
11 years, 2 months
[libvirt] [PATCH v2 0/9] virsh: More intelligent auto-completion
by Tomas Meszaros
Original series + some fixes/improvements.
Tomas Meszaros (9):
virsh: C99 style for info_domfstrim and opts_lxc_enter_namespace
virsh: Add vshCmdCompleter and vshOptCompleter
virsh: Improve readline generators and readline completion
virsh: Add vshDomainCompleter
virsh: Add vshSuspendTargetCompleter
virsh: Add vshRebootShutdownModeCompleter
virsh: Add completer functions to domManaggementCmds
virsh: Add completer functions to snapshotCmds
virsh: Add completer functions to domMonitoringCmds
tools/virsh-domain-monitor.c | 32 ++-
tools/virsh-domain.c | 248 ++++++++++++++++-----
tools/virsh-snapshot.c | 45 +++-
tools/virsh.c | 504 +++++++++++++++++++++++++++++++++++++++++--
tools/virsh.h | 11 +
5 files changed, 748 insertions(+), 92 deletions(-)
--
1.8.3.1
11 years, 2 months