Request for Testers: libvirt and bhyve

Jacques Cale jacquescale at gmail.com
Thu Jun 26 10:43:19 UTC 2014


Hi,

I've updated the patch to use /var as localstatedir instead of 
/usr/local/var

Without this patch, I can't connect to a Linux box with virt-manager 
because I need the ?socket=/var/run/libvirt/libvirt-sock parameter in 
libvirt uri
-------------- next part --------------
Index: Makefile
===================================================================
--- Makefile	(revision 358722)
+++ Makefile	(working copy)
@@ -3,6 +3,7 @@
 
 PORTNAME=	libvirt
 PORTVERSION=	1.2.5
+PORTREVISION=	1
 CATEGORIES=	devel
 MASTER_SITES=	http://libvirt.org/sources/ \
 		ftp://libvirt.org/libvirt/
@@ -17,6 +18,8 @@
 		libxml2.so:${PORTSDIR}/textproc/libxml2 \
 		libgnutls.so:${PORTSDIR}/security/gnutls \
 		libssh2.so:${PORTSDIR}/security/libssh2
+BUILD_DEPENDS=	dnsmasq:${PORTSDIR}/dns/dnsmasq
+RUN_DEPENDS=	dnsmasq:${PORTSDIR}/dns/dnsmasq
 
 OPTIONS_DEFINE=	DOCS NLS QEMU
 OPTIONS_DEFINE_amd64=	BHYVE
@@ -40,16 +43,17 @@
 USE_RC_SUBR=	libvirtd
 
 GNU_CONFIGURE=	yes
-CONFIGURE_ARGS=	--without-sasl \
+CONFIGURE_ARGS=	--localstatedir=/var \
+		--without-sasl \
 		--without-avahi \
 		--without-polkit \
 		--without-hal \
 		--without-udev \
 		--without-netcf \
-		--without-network \
 		--without-sysctl \
 		--without-lxc \
-		--with-ssh2
+		--with-ssh2 \
+		--without-uml
 
 # workaround to override pkg-config calls
 # random_data fix can be removed when 8.x is eol
@@ -79,6 +83,10 @@
 
 .include <bsd.port.options.mk>
 
+.if ${OSVERSION} >= 1000000
+OPTIONS_DEFAULT_amd64=	BHYVE
+.endif
+
 #work around an options bug (thanks mat@)
 .if ${ARCH} != amd64
 PLIST_SUB+=	BHYVE="@comment "
@@ -103,15 +111,10 @@
 	@${REINPLACE_CMD} -e 's|qemu.conf$$|qemu.conf.sample|' \
 		${WRKSRC}/src/Makefile.in
 
+	@${REINPLACE_CMD} -e 's|cp $$(DESTDIR)|cp -f $$(DESTDIR)|' \
+		${WRKSRC}/src/Makefile.in
+
 post-install:
-	@for configuration in libvirt libvirtd ${QEMU_CONFIG}; do \
-	if [ ! -e "${STAGEDIR}${ETCDIR}/$${configuration}.conf" ]; then \
-			${ECHO_MSG} "	Installing local configuration file: ${STAGEDIR}${ETCDIR}/$${configuration}.conf"; \
-			${CP} ${STAGEDIR}${ETCDIR}/$${configuration}.conf.sample ${STAGEDIR}${ETCDIR}/$${configuration}.conf; \
-		else \
-			${ECHO_MSG} "	Preserving local configuration file: ${STAGEDIR}${ETCDIR}/$${configuration}.conf"; \
-	fi; \
-	done
 	@${MKDIR} ${STAGEDIR}${DOCSDIR}
 .for doc in AUTHORS ChangeLog INSTALL NEWS README TODO
 	${INSTALL_DATA} ${WRKSRC}/${doc} ${STAGEDIR}${DOCSDIR}
Index: files/patch-configure
===================================================================
--- files/patch-configure	(revision 0)
+++ files/patch-configure	(working copy)
@@ -0,0 +1,11 @@
+--- configure.orig      2014-06-07 18:27:57.809669553 -0700
++++ configure   2014-06-07 18:59:16.891541812 -0700
+@@ -62467,7 +62467,7 @@
+ 
+ 
+ 
+-        if test -z "$BHYVE" || test -z "$BHYVECTL" \
++        if test -z "$BHYVE" || test -z "$BHYVECTL" || \
+             test -z "$BHYVELOAD" || test "$with_freebsd" = "no"; then
+             if test "$with_bhyve" = "check"; then
+                 with_bhyve="no"

Property changes on: files/patch-configure
___________________________________________________________________
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: files/patch-libvirt_no_bridge.diff
===================================================================
--- files/patch-libvirt_no_bridge.diff	(revision 0)
+++ files/patch-libvirt_no_bridge.diff	(working copy)
@@ -0,0 +1,38 @@
+--- src/bhyve/bhyve_command.c.orig	2014-05-19 05:20:24.000000000 +0400
++++ src/bhyve/bhyve_command.c	2014-06-12 11:50:48.000000000 +0400
+@@ -44,7 +44,6 @@
+     virDomainNetDefPtr net = NULL;
+     char *brname = NULL;
+     char *realifname = NULL;
+-    int *tapfd = NULL;
+     char macaddr[VIR_MAC_STRING_BUFLEN];
+ 
+     if (def->nnets != 1) {
+@@ -80,7 +79,7 @@
+ 
+         if (!dryRun)
+             if (virNetDevTapCreateInBridgePort(brname, &net->ifname, &net->mac,
+-                                               def->uuid, tapfd, 1,
++                                               def->uuid, NULL, 0,
+                                                virDomainNetGetActualVirtPortProfile(net),
+                                                virDomainNetGetActualVlan(net),
+                                                VIR_NETDEV_TAP_CREATE_IFUP | VIR_NETDEV_TAP_CREATE_PERSIST) < 0) {
+--- src/bhyve/bhyve_process.c.orig	2014-05-19 05:20:24.000000000 +0400
++++ src/bhyve/bhyve_process.c	2014-06-12 11:50:12.000000000 +0400
+@@ -77,10 +77,12 @@
+         int actualType = virDomainNetGetActualType(net);
+ 
+         if (actualType == VIR_DOMAIN_NET_TYPE_BRIDGE) {
+-            ignore_value(virNetDevBridgeRemovePort(
+-                            virDomainNetGetActualBridgeName(net),
+-                            net->ifname));
+-            ignore_value(virNetDevTapDelete(net->ifname));
++            if (net->ifname) {
++                ignore_value(virNetDevBridgeRemovePort(
++                                virDomainNetGetActualBridgeName(net),
++                                net->ifname));
++                ignore_value(virNetDevTapDelete(net->ifname));
++            }
+         }
+     }
+ }

Property changes on: files/patch-libvirt_no_bridge.diff
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Index: pkg-plist
===================================================================
--- pkg-plist	(revision 358722)
+++ pkg-plist	(working copy)
@@ -8,16 +8,12 @@
 man/man1/virt-host-validate.1.gz
 man/man8/libvirtd.8.gz
 man/man8/virtlockd.8.gz
- at unexec if cmp -s %D/%%ETCDIR%%/libvirtd.conf.sample %D/%%ETCDIR%%/libvirtd.conf; then rm -f %D/%%ETCDIR%%/libvirtd.conf; fi
-%%ETCDIR%%/libvirtd.conf.sample
- at exec if [ ! -f %D/%%ETCDIR%%/libvirtd.conf ] ; then cp -p %D/%%ETCDIR%%/libvirtd.conf.sample %D/%%ETCDIR%%/libvirtd.conf; fi
- at unexec if cmp -s %D/%%ETCDIR%%/libvirt.conf.sample %D/%%ETCDIR%%/libvirt.conf; then rm -f %D/%%ETCDIR%%/libvirt.conf; fi
-%%ETCDIR%%/libvirt.conf.sample
- at exec if [ ! -f %D/%%ETCDIR%%/libvirt.conf ] ; then cp -p %D/%%ETCDIR%%/libvirt.conf.sample %D/%%ETCDIR%%/libvirt.conf; fi
+ at sample %%ETCDIR%%/libvirtd.conf.sample
+ at sample %%ETCDIR%%/libvirt.conf.sample
+%%QEMU%%@sample %%ETCDIR%%/qemu.conf.sample
 %%ETCDIR%%/virtlockd.conf
-%%QEMU%%@unexec if cmp -s %D/%%ETCDIR%%/qemu.conf.sample %D/%%ETCDIR%%/qemu.conf; then rm -f %D/%%ETCDIR%%/qemu.conf; fi
-%%QEMU%%%%ETCDIR%%/qemu.conf.sample
-%%QEMU%%@exec if [ ! -f %D/%%ETCDIR%%/qemu.conf ] ; then cp -p %D/%%ETCDIR%%/qemu.conf.sample %D/%%ETCDIR%%/qemu.conf; fi
+%%ETCDIR%%/qemu/networks/default.xml
+%%ETCDIR%%/qemu/networks/autostart/default.xml
 %%QEMU%%%%ETCDIR%%/qemu-lockd.conf
 etc/logrotate.d/libvirtd
 etc/logrotate.d/libvirtd.lxc
@@ -47,6 +43,7 @@
 share/augeas/lenses/libvirtd.aug
 share/augeas/lenses/virtlockd.aug
 %%QEMU%%share/augeas/lenses/libvirtd_qemu.aug
+%%QEMU%%share/augeas/lenses/tests/test_libvirt_lockd.aug
 share/augeas/lenses/tests/test_libvirtd.aug
 share/augeas/lenses/tests/test_virtlockd.aug
 %%QEMU%%share/augeas/lenses/tests/test_libvirtd_qemu.aug
@@ -189,6 +186,7 @@
 %%DATADIR%%/schemas/nodedev.rng
 %%DATADIR%%/schemas/nwfilter.rng
 %%DATADIR%%/schemas/secret.rng
+%%DATADIR%%/schemas/storagecommon.rng
 %%DATADIR%%/schemas/storagepool.rng
 %%DATADIR%%/schemas/storagevol.rng
 %%NLS%%share/locale/af/LC_MESSAGES/libvirt.mo
@@ -270,6 +268,8 @@
 %%QEMU%%lib/libvirt/connection-driver/libvirt_driver_qemu.la
 %%BHYVE%%lib/libvirt/connection-driver/libvirt_driver_bhyve.la
 %%BHYVE%%lib/libvirt/connection-driver/libvirt_driver_bhyve.so
+lib/libvirt/connection-driver/libvirt_driver_network.so
+lib/libvirt/connection-driver/libvirt_driver_network.la
 lib/libvirt/connection-driver/libvirt_driver_secret.so
 lib/libvirt/connection-driver/libvirt_driver_secret.la
 lib/libvirt/connection-driver/libvirt_driver_storage.so
@@ -326,22 +326,29 @@
 %%NLS%%@dirrmtry share/locale/bo
 %%NLS%%@dirrmtry share/locale/as/LC_MESSAGES
 %%NLS%%@dirrmtry share/locale/as
+ at dirrmtry %%ETCDIR%%/qemu/networks/autostart
+ at dirrmtry %%ETCDIR%%/qemu/networks
+ at dirrmtry %%ETCDIR%%/qemu
 @dirrm %%ETCDIR%%
- at dirrmtry var/run/libvirt/lockd
- at dirrmtry var/run/libvirt
- at dirrmtry var/run
- at dirrmtry var/log/libvirt/uml
- at dirrmtry var/log/libvirt/qemu
- at dirrmtry var/log/libvirt/lxc
- at dirrmtry var/log/libvirt
- at dirrmtry var/log
- at dirrmtry var/lib/libvirt/lockd/files
- at dirrmtry var/lib/libvirt/lockd
- at dirrmtry var/lib/libvirt/images
- at dirrmtry var/lib/libvirt/boot
- at dirrmtry var/lib/libvirt/filesystems
- at dirrmtry var/lib/libvirt
- at dirrmtry var/lib
- at dirrmtry var/cache/libvirt
- at dirrmtry var/cache
- at dirrmtry var
+ at dirrmtry /var/run/libvirt/network
+%%QEMU%%@dirrmtry /var/run/libvirt/qemu
+ at dirrmtry /var/run/libvirt/lockd
+ at dirrmtry /var/run/libvirt
+ at dirrmtry /var/log/libvirt/uml
+ at dirrmtry /var/log/libvirt/qemu
+ at dirrmtry /var/log/libvirt/lxc
+ at dirrmtry /var/log/libvirt
+ at dirrmtry /var/lib/libvirt/lockd/files
+ at dirrmtry /var/lib/libvirt/lockd
+ at dirrmtry /var/lib/libvirt/images
+ at dirrmtry /var/lib/libvirt/boot
+ at dirrmtry /var/lib/libvirt/dnsmasq
+ at dirrmtry /var/lib/libvirt/filesystems
+ at dirrmtry /var/lib/libvirt/network
+%%QEMU%%@dirrmtry /var/lib/libvirt/qemu/channel/target
+%%QEMU%%@dirrmtry /var/lib/libvirt/qemu/channel
+%%QEMU%%@dirrmtry /var/lib/libvirt/qemu
+ at dirrmtry /var/lib/libvirt
+%%QEMU%%@dirrmtry /var/cache/libvirt/qemu
+ at dirrmtry /var/cache/libvirt
+ at dirrmtry /var/cache


More information about the freebsd-virtualization mailing list