Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Dec 2006 20:53:45 +0100 (CET)
From:      Juergen Lock <nox@jelal.kn-bremen.de>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/106728: fix emulators/kqemu-kmod for -current, add rcscript
Message-ID:  <200612141953.kBEJrjAJ034971@saturn.kn-bremen.de>
Resent-Message-ID: <200612142000.kBEK0cwg021873@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         106728
>Category:       ports
>Synopsis:       fix emulators/kqemu-kmod for -current, add rcscript
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Thu Dec 14 20:00:37 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Juergen Lock
>Release:        FreeBSD 6.1-RELEASE-p5 i386
>Organization:
me?  organized??
>Environment:
System: FreeBSD saturn 6.1-RELEASE-p5 FreeBSD 6.1-RELEASE-p5 #0: Mon Sep 4 15:37:14 CEST 2006 nox@saturn:/ad4/usr/home/nox/src61/src/sys/i386/compile/GENERICua i386


>Description:
	- add fix for -current
	- add rcscript
	(both submitted by Bakul Shah, thanx!)

>How-To-Repeat:
	n/a
>Fix:

New file: files/kqemu.in	

Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/emulators/kqemu-kmod/Makefile,v
retrieving revision 1.8
diff -u -r1.8 Makefile
--- Makefile	28 Aug 2006 22:52:42 -0000	1.8
+++ Makefile	14 Dec 2006 19:43:44 -0000
@@ -7,7 +7,7 @@
 
 PORTNAME=	kqemu
 PORTVERSION=	1.3.0.p9
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	emulators
 MASTER_SITES=	http://qemu.org/
 PKGNAMESUFFIX=	-kmod
@@ -20,6 +20,8 @@
 ONLY_FOR_ARCHS=	i386 amd64
 NO_PACKAGE=	Depends on kernel, and module not redistributable
 
+USE_RC_SUBR=	kqemu
+
 .include <bsd.port.pre.mk>
 
 PLIST_FILES=	"include/kqemu/kqemu.h"
Index: files/patch-kqemu-freebsd.c
===================================================================
RCS file: /home/ncvs/ports/emulators/kqemu-kmod/files/patch-kqemu-freebsd.c,v
retrieving revision 1.3
diff -u -r1.3 patch-kqemu-freebsd.c
--- files/patch-kqemu-freebsd.c	9 Apr 2006 16:57:59 -0000	1.3
+++ files/patch-kqemu-freebsd.c	14 Dec 2006 19:33:37 -0000
@@ -7,3 +7,14 @@
  static struct kqemu_global_state *kqemu_gs = NULL;
  
  #if __FreeBSD_version < 500000
+@@ -321,6 +321,9 @@
+ #if __FreeBSD_version >= 500000
+     dev->si_drv1 = NULL;
+     TAILQ_REMOVE(&kqemuhead, ks, kqemu_ent);
++#if __FreeBSD_version >= 700024
++    dev_relthread(dev); 
++#endif
+     destroy_dev(dev);
+ #endif
+     free(ks, M_KQEMU);
+
Index: files/kqemu.in
@@ -0,0 +1,49 @@
+#!/bin/sh
+# $FreeBSD: $
+#
+# PROVIDE: kqemu
+# KEYWORD: nojail
+#
+# Add the following line to /etc/rc.conf[.local] to enable kqemu
+#
+# kqemu_enable="YES"
+#
+
+. /etc/rc.subr
+
+name="kqemu"
+load_rc_config $name
+rcvar=`set_rcvar`
+start_cmd=kqemu_start
+stop_cmd=kqemu_stop
+
+kqemu_start()
+{
+	# load aio if needed
+	if ! kldstat -qm aio; then
+		if kldload aio; then
+			info 'aio module loaded.'
+		else
+			warn 'aio module failed to load.'
+			return 1
+		fi
+	fi
+	if ! kldstat -qm kqemu; then
+		if kldload kqemu; then
+			echo 'kqemu module loaded.'
+		else
+			warn 'kqemu module failed to load.'
+			return 1
+		fi
+	fi
+	return 0
+}
+
+kqemu_stop()
+{
+	if kldstat -qm kqemu && kldunload kqemu; then
+		echo 'kqemu module unloaded.'
+	fi
+}
+
+run_rc_command "$1"
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200612141953.kBEJrjAJ034971>