From 876454f1ae5fe7aec68705163424fe2fe4c9903a Mon Sep 17 00:00:00 2001 From: Jason Mehring Date: Sun, 2 Aug 2020 11:53:01 -0400 Subject: [PATCH 1/6] Makefile: Fix formatting --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0dff16f..fed55b0 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ VERSION = $(file Date: Sun, 2 Aug 2020 11:53:11 -0400 Subject: [PATCH 2/6] kvm: Initial KVM configuration updates --- debian/control | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/control b/debian/control index 98b8b24..c53b502 100644 --- a/debian/control +++ b/debian/control @@ -10,7 +10,7 @@ Build-Depends: python3-all-dev, python-setuptools, quilt, - libvchan-xen-dev, + libvchan-xen-dev|libvchan-kvm-dev, pkg-config Standards-Version: 4.4.0.1 Homepage: http://www.qubes-os.org @@ -18,7 +18,7 @@ Homepage: http://www.qubes-os.org Package: qubesdb Section: admin Architecture: amd64 -Depends: libqubesdb, libvchan-xen, ${shlibs:Depends}, ${misc:Depends} +Depends: libqubesdb, libvchan-xen|libvchan-kvm, ${shlibs:Depends}, ${misc:Depends} Description: QubesDB management tools and daemon. Package: qubesdb-vm From cb97e960acc64399082d9b35fb8f35e2213cc079 Mon Sep 17 00:00:00 2001 From: Jason Mehring Date: Fri, 21 Aug 2020 11:47:41 -0400 Subject: [PATCH 3/6] qubes-db-vm: Added systemd unit file dropin --- daemon/qubes-db.service.d/30_qubes-kvm.conf | 4 ++++ rpm_spec/qubes-db-vm.spec.in | 5 +++++ 2 files changed, 9 insertions(+) create mode 100644 daemon/qubes-db.service.d/30_qubes-kvm.conf diff --git a/daemon/qubes-db.service.d/30_qubes-kvm.conf b/daemon/qubes-db.service.d/30_qubes-kvm.conf new file mode 100644 index 0000000..53097e6 --- /dev/null +++ b/daemon/qubes-db.service.d/30_qubes-kvm.conf @@ -0,0 +1,4 @@ +[Unit] +ConditionPathExists=/var/run/qubes-service/hypervisor-kvm +After=kvmchand.service +Requires=kvmchand.service diff --git a/rpm_spec/qubes-db-vm.spec.in b/rpm_spec/qubes-db-vm.spec.in index a68278b..0c65712 100644 --- a/rpm_spec/qubes-db-vm.spec.in +++ b/rpm_spec/qubes-db-vm.spec.in @@ -52,6 +52,8 @@ QubesDB daemon service. %install install -d %{buildroot}%{_unitdir} install -p -m 644 daemon/qubes-db.service %{buildroot}%{_unitdir}/ +install -d %{buildroot}%{_unitdir}/qubes-db.service.d/ +install -p -m 644 daemon/qubes-db.service.d/*.conf %{buildroot}%{_unitdir}/qubes-db.service.d/ %post %systemd_post qubes-db.service @@ -66,5 +68,8 @@ install -p -m 644 daemon/qubes-db.service %{buildroot}%{_unitdir}/ %doc %{_unitdir}/qubes-db.service +%dir %{_unitdir}/qubes-db.service.d +%{_unitdir}/qubes-db.service.d/30_qubes-kvm.conf + %changelog @CHANGELOG@ From bff713fd6321288dcd1b940cc07d3e10c5159b35 Mon Sep 17 00:00:00 2001 From: Jason Mehring Date: Fri, 21 Aug 2020 12:10:10 -0400 Subject: [PATCH 4/6] daemon/db-daemon.c: XXX: FIX: Hardcoded 'daemon/db-daemon.c' to use 'libvchan_client_init' instead of hardcoded 'VchanInitServer --- daemon/db-daemon.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/daemon/db-daemon.c b/daemon/db-daemon.c index aa660d0..1557d34 100644 --- a/daemon/db-daemon.c +++ b/daemon/db-daemon.c @@ -559,7 +559,8 @@ int init_vchan(struct db_daemon_data *d) { #else // We give a 5 minute timeout here because xeniface can take some time // to load the first time after reboot after pvdrivers installation. - d->vchan = VchanInitServer(d->remote_domid, QUBESDB_VCHAN_PORT, 4096, 5 * 60 * 1000); + ////d->vchan = VchanInitServer(d->remote_domid, QUBESDB_VCHAN_PORT, 4096, 5 * 60 * 1000); + d->vchan = libvchan_server_init(d->remote_domid, QUBESDB_VCHAN_PORT, 4096, 4096); #endif if (!d->vchan) return 0; @@ -571,7 +572,8 @@ int init_vchan(struct db_daemon_data *d) { #else // We give a 5 minute timeout here because xeniface can take some time // to load the first time after reboot after pvdrivers installation. - d->vchan = VchanInitClient(d->remote_domid, QUBESDB_VCHAN_PORT, 5 * 60 * 1000); + ////d->vchan = VchanInitClient(d->remote_domid, QUBESDB_VCHAN_PORT, 5 * 60 * 1000); + d->vchan = libvchan_client_init(d->remote_domid, QUBESDB_VCHAN_PORT); #endif if (!d->vchan) return 0; From 3290ff69664966b511231052b2cb758e3d60c66a Mon Sep 17 00:00:00 2001 From: Shawn Anastasio Date: Thu, 4 Feb 2021 20:12:34 -0600 Subject: [PATCH 5/6] HACK: DONTMERGE: rpm: Use qubes-libvchan-kvm-devel build dependency --- rpm_spec/qubes-db.spec.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpm_spec/qubes-db.spec.in b/rpm_spec/qubes-db.spec.in index d7411ac..aefc992 100644 --- a/rpm_spec/qubes-db.spec.in +++ b/rpm_spec/qubes-db.spec.in @@ -34,7 +34,8 @@ License: GPL URL: http://www.qubes-os.org/ BuildRequires: gcc -BuildRequires: qubes-libvchan-devel +#BuildRequires: qubes-libvchan-devel +BuildRequires: qubes-libvchan-kvm-devel BuildRequires: systemd-devel BuildRequires: python%{python3_pkgversion}-devel Requires: qubes-libvchan From 698d3c6f05980ba5f1fbb3849673e56feca2f946 Mon Sep 17 00:00:00 2001 From: Shawn Anastasio Date: Wed, 10 Feb 2021 18:19:51 -0600 Subject: [PATCH 6/6] HACK: DONTMERGE: Sleep before vchan_server_init to give libkvmchan extra time --- daemon/db-daemon.c | 1 + 1 file changed, 1 insertion(+) diff --git a/daemon/db-daemon.c b/daemon/db-daemon.c index 1557d34..8fc973b 100644 --- a/daemon/db-daemon.c +++ b/daemon/db-daemon.c @@ -557,6 +557,7 @@ int init_vchan(struct db_daemon_data *d) { #ifndef WIN32 d->vchan = libvchan_server_init(d->remote_domid, QUBESDB_VCHAN_PORT, 4096, 4096); #else + usleep(5 * 1000 * 1000); // Hack: give libkvmchan some time to acknowledge the new domain // We give a 5 minute timeout here because xeniface can take some time // to load the first time after reboot after pvdrivers installation. ////d->vchan = VchanInitServer(d->remote_domid, QUBESDB_VCHAN_PORT, 4096, 5 * 60 * 1000);