From owner-freebsd-ports@FreeBSD.ORG Wed Mar 4 00:03:11 2015 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3F45D734 for ; Wed, 4 Mar 2015 00:03:11 +0000 (UTC) Received: from mail-ie0-x235.google.com (mail-ie0-x235.google.com [IPv6:2607:f8b0:4001:c03::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 01EF4F83 for ; Wed, 4 Mar 2015 00:03:11 +0000 (UTC) Received: by iery20 with SMTP id y20so9831371ier.12 for ; Tue, 03 Mar 2015 16:03:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=CjnJVTU3+MXOP79AixPVuzN81P74GHNmhbCxxAJFnw8=; b=m6f62WxFZATDGarDrX52/O+N0XyNGZnkO/aj6n743jsPFeHzdKcT8loZIlcwzXt19j O8kURw4Rk3sAO8o7NmJ5TuRdcpjeL21FwhprG2VMO/au77MRmcenv8Fg0bEql4R3Dzy1 BJNXdoZlLW5YA4BOrpi716Y399QOdOp3wCtEUQwMvbMMoesJCoFh6vNxo0NUI62nu5K/ jR7sw9rUJR+p5Y2B4bXd63QWI63cVcyWqhTQ+mO9eFVH/mvaXTt4TJ0fDxmP/QfTcq4R khL3vlf1Yyu0jF87hoLuo0sZ4iQBYb4tCaN48WNs36wu3JSFooo75MaGFX6+esoM9NPr 8AFw== X-Received: by 10.107.165.21 with SMTP id o21mr6086206ioe.84.1425427390406; Tue, 03 Mar 2015 16:03:10 -0800 (PST) Received: from [10.0.1.155] (d205-206-84-235.abhsia.telus.net. [205.206.84.235]) by mx.google.com with ESMTPSA id c4sm1890016igt.19.2015.03.03.16.03.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Mar 2015 16:03:09 -0800 (PST) Message-ID: <54F64BBC.4060502@gmail.com> Date: Tue, 03 Mar 2015 17:03:08 -0700 From: Scott Furry User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: freebsd-ports@freebsd.org Subject: qemu-devel usage Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2015 00:03:11 -0000 Yeah! I was able to setup qemu-devel(ver 2.20) to use existing qcow2 images from linux. Sort of... The biggest pain I had was getting networking to play along. No matter what settings, modules or otherwise I tried, I could not get the VM image to use an existing tap interface accepting DHCP from my server. Turns out the problem was rather undocumented and buried in installed files. The files "/usr/local/etc/qemu-if[up|down]" are two lines each. One is the sh-bang, the other is a line saying "exec true". And this is the default installed to the system by the port files. The qemu-ifXXXX.sample files are not much help either as they contain the exact same content. Link(1)(see refs below) makes no mention of the default ifup|down script files. Would it be prudent to setup an /etc/qemu folder so users can place their local networking scripts there? Is this the correct location? FWIW, my solution was to "edit" the scripts. I replaced the "exec true" in qemu-ifup with "/sbin/ifconfig bridge0 addm ${1} up" to add a tap to the existing bridge. In the qemu-ifdown, "exec true" was replaced with "/sbin/ifconfig ${1} destroy". End result - still need root access to start VM because of networking. I didn't have to go to this extreme when I setup qemu networking on a linux box. However, new OS. :) From my original setup files for qemu, I had used the -enable-kvm and -cpu host flags (see 2 below). Qemu on BSD just didn't want to accept "host" as a cpu option. The reference did point out how the flag worked, something I didn't realize. However, it would be really good to have the "host" flag to pass along the cpu accelerators to the VM without having to call them individually. Is anyone working on this? And on the topic of cpu's, when I get a listing of the supported cpu's ( qemu -cpu help ), it seems the listing is abbreviated. There is no mention of later cpu types (either intel or AMD). Am I missing something? Ref (3) talks about using kqemu-kmod. A kqemu-kmod-devel exists in the ports tree. However, I saw a reference on the KVM page (which I can't find again :< ) talking about how kvm aspects including kqemu were being absorbed into qemu mainline. Can someone clarify, please. Are there any kernel modules required for normal usage? Documentation seems a little sparse for FreeBSD/qemu hosts. Is the -enable-kvm flag mentioned earlier still required here? Appreciated!!! (1) https://wiki.freebsd.org/qemu (2) http://www.linux-kvm.org/page/Tuning_KVM (3) http://www.linux-kvm.org/page/BSD