Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Feb 2014 17:16:15 +0200
From:      Shteryana Shopova <syrinx@FreeBSD.org>
To:        freebsd-virtualization@freebsd.org
Cc:        nox@FreeBSD.org
Subject:   kqemu patch for CURRENT/10-STABLE (was Re: Linux on BHyVe in 10.0-RELEASE )
Message-ID:  <CAExw994ngYbqgzqxWfBraE8Fnm8Zw-qb2FqRhEpD-ENtLxvkfQ@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
--001a1139b126bd9b0304f1be5a0a
Content-Type: text/plain; charset=UTF-8

Hi all,

Sorry for top posting but I'm new to the list and came across this
thread while playing with bhyve these days. To apply the patch -

#cp patch-unit3minorfix /usr/ports/emulators/kqemu-kmod/files/

compile and install the module.

I've been running kqemu under current with the attached patch (plain
text below in case the attachment is removed) for a couple of months
now and the module is loaded successfully -

root@demetra:/usr/ports/emulators/kqemu-kmod # dmesg | tail -n 10 | grep kqemu
kqemu version 0x00010300
kqemu: KQEMU installed, max_locked_mem=4120624kB.
root@demetra:/usr/ports/emulators/kqemu-kmod # uname -v
FreeBSD 11.0-CURRENT #6 r260863: Sun Jan 19 02:57:49 EET 2014

The original commit that broke kqemu-kmod is from March 9th, 2013, so
the patch should be applicable to 10-STABLE too. Reports on
success/failures welcome.

cheers,
Shteryana

P.S. Example on getting a headless VM with vbox -

#VBoxManage createvm --name MyServer --ostype Windows7 --register
#VBoxManage createhd --filename "MyServer.vdi" --size 200000
#VBoxManage storagectl MyServer --name "IDE Controller" --add ide
--controller PIIX3
#VBoxManage storageattach MyServer --storagectl "IDE Controller"
--port 0 --device 1 --type hdd --medium "MyServer.vdi"
#VBoxManage storageattach MyServer --storagectl "IDE Controller"
--port 1 --device 0 --type dvddrive --medium
/home/myserver/install.iso
#VBoxManage modifyvm MyServer --nic1 bridged --cableconnected1 on
--bridgeadapter1 em0 --nictype1 82540EM
#VBoxManage modifyvm MyServer --memory 1024 --acpi on --boot1 dvd
#VBoxHeadless -n -m 5901 -s "MyServer"

The VM is then accessible via vncviewer to the IP of the original
machine port 5901

--- kqemu-freebsd.c.orig    2014-02-06 16:03:15.881335406 +0200
+++ kqemu-freebsd.c    2014-02-06 16:04:25.951329106 +0200
@@ -109,7 +109,12 @@
     vm_offset_t va;
     vm_paddr_t pa;

+#if __FreeBSD_version >= 1000030
+    va = kmem_malloc(kernel_map, PAGE_SIZE, M_WAITOK);
+#else
     va = kmem_alloc(kernel_map, PAGE_SIZE);
+#endif
+
     if (va == 0) {
     kqemu_log("kqemu_alloc_zeroed_page: NULL\n");
     return NULL;

--001a1139b126bd9b0304f1be5a0a
Content-Type: application/octet-stream; name=patch-unit3minorfix
Content-Disposition: attachment; filename=patch-unit3minorfix
Content-Transfer-Encoding: base64
X-Attachment-Id: f_hrc5g75v0

LS0tIGtxZW11LWZyZWVic2QuYy5vcmlnCTIwMTQtMDItMDYgMTY6MDM6MTUuODgxMzM1NDA2ICsw
MjAwCisrKyBrcWVtdS1mcmVlYnNkLmMJMjAxNC0wMi0wNiAxNjowNDoyNS45NTEzMjkxMDYgKzAy
MDAKQEAgLTEwOSw3ICsxMDksMTIgQEAKICAgICB2bV9vZmZzZXRfdCB2YTsKICAgICB2bV9wYWRk
cl90IHBhOwogCisjaWYgX19GcmVlQlNEX3ZlcnNpb24gPj0gMTAwMDAzMAorICAgIHZhID0ga21l
bV9tYWxsb2Moa2VybmVsX21hcCwgUEFHRV9TSVpFLCBNX1dBSVRPSyk7CisjZWxzZQogICAgIHZh
ID0ga21lbV9hbGxvYyhrZXJuZWxfbWFwLCBQQUdFX1NJWkUpOworI2VuZGlmCisKICAgICBpZiAo
dmEgPT0gMCkgewogCWtxZW11X2xvZygia3FlbXVfYWxsb2NfemVyb2VkX3BhZ2U6IE5VTExcbiIp
OwogCXJldHVybiBOVUxMOwo=
--001a1139b126bd9b0304f1be5a0a--



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