[libvirt] RFC: should we mandate use of VPATH builds ?
by Daniel P. Berrangé
One of the things we (well I) constantly screw up is VPATH builds. I've
always tended to just build in the source tree, and as a result I'll
often miss changes which break VPATH builds.
Now our Jenkins CI catches this because it does VPATH builds only, so we
don't bit-rot for very long. Unfortunately Travis CI does source tree
builds only so I don't notice my mistakes when I test branches on Travis
before pushing. I'll fix Travis to do VPATH builds too, but....
I notice that most modern build systems will refuse to ever do in source
tree builds. eg Ninja/Meson/Perl/Python/Go/etc all put build artifacts in
a separate directory from source.
We could if we wanted to simply put a check right at the start of the
configure.ac script to reject any attempt at doing a source tree build
to force VPATH builds. This would mean we only ever have to care about
one execution path instead of two execution paths.
We could even make it such that autogen.sh will actually create a subdir
"build" and change into it automatically before running configure, to
help devs do the "right thing" by default.
Essentially we're talking the difference between
Today:
- Source tree build
./autogen.sh && make
- VPATH build
mkdir build && cd build && ../autogen.sh && make
Possible future
- Source tree build
No.
- VPATH build
./autogen.sh && cd build && make
Any opinions ?
Do people really like source tree builds, or are they (like me) just doing
them because its the easy/lazy option ?
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
6 years, 9 months
[libvirt] [PATCH] src: Clean *.logrotate, .aug and libvirtd.policy files on 'make clean'
by Michal Privoznik
Before 3f055b5997c we were doing that. However after the commit
we are leaving the files behind.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
Pushed under build breaker rule.
src/Makefile.am | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index 41a3cb262..2166e17db 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1376,7 +1376,7 @@ augeastest_DATA += test_libvirtd.aug
conf_DATA += remote/libvirtd.conf
-CLEANFILES += tets_libvirtd.aug
+CLEANFILES += test_libvirtd.aug
if WITH_POLKIT
if WITH_POLKIT0
@@ -1389,6 +1389,7 @@ endif ! WITH_POLKIT0
endif WITH_POLKIT
BUILT_SOURCES += libvirtd.policy
+CLEANFILES += libvirtd.policy
libvirtd.policy: remote/libvirtd.policy.in $(top_builddir)/config.status
$(AM_V_GEN) sed \
@@ -2868,6 +2869,7 @@ if WITH_LIBVIRTD
LOGROTATE_FILES := $(LOGROTATE_FILES_IN:remote/%.in=%)
BUILT_SOURCES += $(LOGROTATE_FILES)
+CLEANFILES += $(LOGROTATE_FILES)
%.logrotate: remote/%.logrotate.in
$(AM_V_GEN)sed \
--
2.16.1
6 years, 9 months
[libvirt] [PATCH] make: fix VPATH build for libvirtd augeas check
by Daniel P. Berrangé
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index b8e2cbf139..41a3cb2628 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -2297,7 +2297,7 @@ check-augeas-virtlogd: test_virtlogd.aug
if WITH_LIBVIRTD
test_libvirtd.aug: remote/test_libvirtd.aug.in \
remote/libvirtd.conf $(AUG_GENTEST)
- $(AM_V_GEN)$(AUG_GENTEST) remote/libvirtd.conf $< $@
+ $(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/remote/libvirtd.conf $< $@
check-augeas-libvirtd: test_libvirtd.aug
$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
--
2.14.3
6 years, 9 months
[libvirt] [PATCH] virLogGetOutputs: remove unnecessary braces
by Ján Tomko
Commit 9275def reduced the if block to one line without removing the
braces.
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
I pushed this yesterday as a build fix, but forgot to send an e-mail.
src/util/virlog.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/util/virlog.c b/src/util/virlog.c
index c03f4fb14..dd927f0ba 100644
--- a/src/util/virlog.c
+++ b/src/util/virlog.c
@@ -1219,9 +1219,8 @@ virLogGetOutputs(void)
}
}
- if (virBufferError(&outputbuf)) {
+ if (virBufferError(&outputbuf))
goto error;
- }
virLogUnlock();
return virBufferContentAndReset(&outputbuf);
--
2.13.6
6 years, 9 months
[libvirt] [PATCH v2 0/6] port allocator: make used port bitmap global etc
by Nikolay Shirokovskiy
This patch set addresses issue(s) described in [1] and the core of
changes go to the first patch. The others are cleanups and
refactorings.
Diff from v1:
- rename virPortRange to virPortAllocatorRange (virPortRange is occupied)
- release ports in libxl and bhyve tests
- overload bind syscall for libxl and bhyve tests
- fix undefined behaviour on port release on error paths in qemu test
WARNING! I did not compile with bhyve.
[1] https://www.redhat.com/archives/libvir-list/2017-December/msg00600.html
Nikolay Shirokovskiy (6):
port allocator: make used port bitmap global
port allocator: remove range on manual port reserving
port allocator: remove range check in release function
port allocator: drop skip bind check flag
port allocator: remove release functionality from set used
port allocator: make port range constant object
src/bhyve/bhyve_command.c | 4 +-
src/bhyve/bhyve_driver.c | 5 +-
src/bhyve/bhyve_process.c | 7 +-
src/bhyve/bhyve_utils.h | 2 +-
src/libvirt_private.syms | 3 +-
src/libxl/libxl_conf.c | 8 +-
src/libxl/libxl_conf.h | 12 +--
src/libxl/libxl_domain.c | 3 +-
src/libxl/libxl_driver.c | 17 ++---
src/libxl/libxl_migration.c | 4 +-
src/qemu/qemu_conf.h | 12 +--
src/qemu/qemu_driver.c | 27 +++----
src/qemu/qemu_migration.c | 12 +--
src/qemu/qemu_process.c | 55 ++++----------
src/util/virportallocator.c | 166 ++++++++++++++++++++++++-----------------
src/util/virportallocator.h | 25 +++----
tests/bhyvexml2argvmock.c | 7 ++
tests/bhyvexml2argvtest.c | 10 ++-
tests/libxlxml2domconfigtest.c | 12 ++-
tests/virmocklibxl.c | 7 ++
tests/virportallocatortest.c | 53 +++++++------
21 files changed, 237 insertions(+), 214 deletions(-)
--
1.8.3.1
6 years, 9 months
[libvirt] [PATCH] rpm: don't enable fuse on RHEL-6
by Daniel P. Berrangé
Fuse was recently enabled whereever LXC is enabled:
commit 34783a9e6b9c3d8850db878fc323c1ff40703ea6
Author: Jiri Denemark <jdenemar(a)redhat.com>
Date: Fri Feb 9 13:42:50 2018 +0100
spec: Enable fuse only if LXC is enabled
Unfortunately the version of Fuse in RHEL-6 is too old for libvirt's
needs, but we still have LXC enabled there.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
Pushed as a CI build fix
libvirt.spec.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index e1e902c5e4..1eca4e39d4 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -167,7 +167,7 @@
%endif
# fuse is used to provide virtualized /proc for LXC
-%if %{with_lxc}
+%if %{with_lxc} && 0%{?rhel} != 6
%define with_fuse 0%{!?_without_fuse:1}
%endif
--
2.14.3
6 years, 9 months
[libvirt] [PATCH 00/10] Move the libvirtd daemon into src/remote/
by Daniel P. Berrangé
Having a daemon/ directory makes little sense from a code structure
point of view, as 90% of the code that is built into libvirtd already
lives in the src/ directory. The virtlockd and virlogd daemons also live
entirely in src/{locking,logging} directories. This series thus moves it
all into the src/remote/ directory. This will make even more sense when
we introduce further modular daemons for various drivers.
Daniel P. Berrangé (10):
src: simplify systemd unit file handling in make rules
src: simplify sysv init file handling in make rules
src: simplify sysconfig file handling in make rules
daemon: remove obsolete doc describing daemon threading
daemon: move libvirtd code into src/remote/ directory
daemon: move libvirtd POD manpage into src/remote/
daemon: move init system files into src/remote/
daemon: move configuration files to src/remote
daemon: move misc libvirtd policy files to src/remote/
daemon: move logrotate files to src/remote/
.gitignore | 3 +
Makefile.am | 2 +-
configure.ac | 1 -
daemon/Makefile.am | 465 ---------------------
daemon/THREADS.txt | 52 ---
src/Makefile.am | 420 ++++++++++++++++---
{daemon => src/remote}/libvirtd.aug | 0
{daemon => src/remote}/libvirtd.conf | 0
{daemon => src/remote}/libvirtd.init.in | 0
{daemon => src/remote}/libvirtd.libxl.logrotate.in | 0
{daemon => src/remote}/libvirtd.logrotate.in | 0
{daemon => src/remote}/libvirtd.lxc.logrotate.in | 0
{daemon => src/remote}/libvirtd.pod | 0
{daemon => src/remote}/libvirtd.policy.in | 0
{daemon => src/remote}/libvirtd.qemu.logrotate.in | 0
daemon/libvirt.rules => src/remote/libvirtd.rules | 0
{daemon => src/remote}/libvirtd.sasl | 0
{daemon => src/remote}/libvirtd.service.in | 0
{daemon => src/remote}/libvirtd.sysconf | 0
{daemon => src/remote}/libvirtd.sysctl | 0
{daemon => src/remote}/libvirtd.uml.logrotate.in | 0
{daemon => src/remote}/libvirtd.upstart | 0
daemon/libvirtd.c => src/remote/remote_daemon.c | 10 +-
daemon/libvirtd.h => src/remote/remote_daemon.h | 10 +-
.../remote/remote_daemon_config.c | 10 +-
.../remote/remote_daemon_config.h | 10 +-
.../remote/remote_daemon_dispatch.c | 16 +-
.../remote/remote_daemon_dispatch.h | 10 +-
.../stream.c => src/remote/remote_daemon_stream.c | 8 +-
.../stream.h => src/remote/remote_daemon_stream.h | 12 +-
{daemon => src/remote}/test_libvirtd.aug.in | 0
.../remote/virt-guest-shutdown.target.in | 0
32 files changed, 410 insertions(+), 619 deletions(-)
delete mode 100644 daemon/Makefile.am
delete mode 100644 daemon/THREADS.txt
rename {daemon => src/remote}/libvirtd.aug (100%)
rename {daemon => src/remote}/libvirtd.conf (100%)
rename {daemon => src/remote}/libvirtd.init.in (100%)
rename {daemon => src/remote}/libvirtd.libxl.logrotate.in (100%)
rename {daemon => src/remote}/libvirtd.logrotate.in (100%)
rename {daemon => src/remote}/libvirtd.lxc.logrotate.in (100%)
rename {daemon => src/remote}/libvirtd.pod (100%)
rename {daemon => src/remote}/libvirtd.policy.in (100%)
rename {daemon => src/remote}/libvirtd.qemu.logrotate.in (100%)
rename daemon/libvirt.rules => src/remote/libvirtd.rules (100%)
rename {daemon => src/remote}/libvirtd.sasl (100%)
rename {daemon => src/remote}/libvirtd.service.in (100%)
rename {daemon => src/remote}/libvirtd.sysconf (100%)
rename {daemon => src/remote}/libvirtd.sysctl (100%)
rename {daemon => src/remote}/libvirtd.uml.logrotate.in (100%)
rename {daemon => src/remote}/libvirtd.upstart (100%)
rename daemon/libvirtd.c => src/remote/remote_daemon.c (99%)
rename daemon/libvirtd.h => src/remote/remote_daemon.h (93%)
rename daemon/libvirtd-config.c => src/remote/remote_daemon_config.c (98%)
rename daemon/libvirtd-config.h => src/remote/remote_daemon_config.h (92%)
rename daemon/remote.c => src/remote/remote_daemon_dispatch.c (99%)
rename daemon/remote.h => src/remote/remote_daemon_dispatch.h (85%)
rename daemon/stream.c => src/remote/remote_daemon_stream.c (99%)
rename daemon/stream.h => src/remote/remote_daemon_stream.h (85%)
rename {daemon => src/remote}/test_libvirtd.aug.in (100%)
rename daemon/virt-guest-shutdown.target => src/remote/virt-guest-shutdown.target.in (100%)
--
2.14.3
6 years, 9 months
[libvirt] [PATCH] news: libxl now supports setting clock offset and adjustment
by Jim Fehlig
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
docs/news.xml | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/docs/news.xml b/docs/news.xml
index b60cb2d98..86a0c8d18 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -77,6 +77,11 @@
conf: add support for setting Chassis SMBIOS data fields
</summary>
</change>
+ <change>
+ <summary>
+ libxl: add support for setting clock offset and adjustment
+ </summary>
+ </change>
</section>
<section title="Bug fixes">
</section>
--
2.16.1
6 years, 9 months
[libvirt] [PATCH] bhyve: add missing cases for graphics listen type
by Daniel P. Berrangé
Address warning from -Wswitch-enum by adding missing cases
for graphics listen types that are not supported.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
Pushed as a CI build fix
src/bhyve/bhyve_command.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c
index fd738b42c..5e309c3a2 100644
--- a/src/bhyve/bhyve_command.c
+++ b/src/bhyve/bhyve_command.c
@@ -419,9 +419,15 @@ bhyveBuildGraphicsArgStr(const virDomainDef *def,
virBufferAsprintf(&opt, ":%d", graphics->data.vnc.port);
break;
- default:
+ case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_SOCKET:
+ case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NONE:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Unsupported listen type"));
+ goto error;
+ case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_LAST:
+ default:
+ virReportEnumRangeError(virDomainGraphicsListenType, glisten->type);
+ goto error;
}
if (video->driver)
--
2.14.3
6 years, 9 months
[libvirt] [PATCH] src: remove WITH_LIBVIRTD condition around hal/udev build
by Daniel P. Berrangé
Currently building --without-libvirtd causes a failure to link the node
device driver:
node_device/.libs/libvirt_driver_nodedev_la-node_device_driver.o: In function `nodedevRegister':
/home/berrange/src/virt/libvirt/src/node_device/node_device_driver.c:649: undefined reference to `udevNodeRegister'
collect2: error: ld returned 1 exit status
because it causes us to build the core nodedev driver, but then skip the
implementations, despite udev being available.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/Makefile.am | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index db68e01db4..38fa1e3393 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1863,7 +1863,6 @@ libvirt_driver_nodedev_la_CFLAGS = \
libvirt_driver_nodedev_la_LDFLAGS = $(AM_LDFLAGS_MOD_NOUNDEF)
libvirt_driver_nodedev_la_LIBADD =
-if WITH_LIBVIRTD
if WITH_HAL
libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_HAL_SOURCES)
libvirt_driver_nodedev_la_CFLAGS += $(HAL_CFLAGS)
@@ -1874,7 +1873,6 @@ libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_UDEV_SOURCES)
libvirt_driver_nodedev_la_CFLAGS += $(UDEV_CFLAGS) $(PCIACCESS_CFLAGS)
libvirt_driver_nodedev_la_LIBADD += $(UDEV_LIBS) $(PCIACCESS_LIBS)
endif WITH_UDEV
-endif WITH_LIBVIRTD
libvirt_driver_nodedev_la_LIBADD += libvirt.la ../gnulib/lib/libgnu.la
endif WITH_NODE_DEVICES
--
2.14.3
6 years, 9 months