Git Product home page Git Product logo

novm's Introduction

This is not an official Google product.

novm

novm is a legacy-free, type 2 hypervisor written in Go. Its goal is to provide an alternate, high-performance Linux hypervisor for cloud workloads.

novm is unique because it exposes a filesystem-device as a primary mechanism for running guests. This allows you to easily manage independent software and data bundles independently and combine them into a single virtual machine instance.

novm leverages the excellent Linux Kernel Virtual Machine (KVM) interface to run guest instances.

Why novm?

novm changes the rules of virtualization by principally exposing a flexible filesystem interface instead of virtual block devices. This eliminates the pain of managing virtual disk images and allows much greater flexibility to how software is bundled and deployed. A virtual machine is no longer a heavyweight instance, but rather a hardware-enforced container around a collection of files and services defined on-the-fly.

novm also focuses only on high-performance paravirtualized devices, and drops support for legacy hardware and most emulation. This makes it inappropriate for running legacy applications, but ideal for modern cloud-based virtualization use cases. novm was originally called pervirt, but this name was changed after it was suggested that this name could be misconstrued.

novm aims to provide the best of both containers and hardware virtualization.

What are the advantages over containers?

  • You can run any compatible kernel.

You have much more freedom as a result of the fact that the guest kernel is decoupled from the host.

For example: You can hold back your guest kernel if necessary, or upgrade to the latest and greatest. Combined with migration, you can have a stable, long-running guest while still applying critical fixes and updates to the hosts. If you need filesystem or networking modules, you can freely load them in a guest. If a particular application requires a specific kernel, it's very straight-forward to use it.

  • You have real, hardware-enforced isolation.

The only interface exposed is the x86 ABI and the hypervisor. Containers are more likely to suffer from security holes as the guest can access the entire kernel system call interface.

In multi-tenant environments, strong isolation is very important. Beyond security holes, containers likely present countless opportunities for subtle information leaks between guest instances.

  • You can mix and match technologies.

Want a docker-style novm? Want a disk-based novm? Sure. Both co-exist easily and use resources in the same way. There's no need to manage two separate networking systems, bridges, management daemons, etc. Everything is managed in one way.

What are the disadvantages over containers?

  • Performance.

Okay, so there's a non-trivial hit. If your workload is very I/O intensive (massive disk or network usage), you will see a small but measurable drop in performance. But most workloads will not see a difference.

(Note that this project is still experimental, and there's plenty of performance work still to be done. The above should be considered a forward-looking statement.)

What are the advantages over traditional virtualization?

  • File-based provisioning.

Instead of opaque disk images, novm allows you to easily combine directory trees to create a VM in real-time. This allows an administrator to very easily tweak files and fire up VMs without dealing with the headaches of converting disk images or using proprietary tools.

What are the disadvantages over traditional virtualization?

  • Legacy hardware support.

We only support a very limited number of devices. This means that guests must be VirtIO-aware and not depend on the presence of any BIOS functionality post-boot.

For new workloads, this isn't a problem. But it means you can't migrate your untouchable, ancient IT system over to novm.

  • Arbitrary guest OS support.

novm only supports the guests we know how to boot. For the time being, that means Linux only. It would be straight forward to add support for multiboot guests, like FreeBSD.

Requirements

novm requires at least go 1.1 in order to build.

novm also requires at least Linux 3.8, with appropriate headers. If your headers are not recent enough, you may see compilation errors related to KVM_SIGNAL_MSI or KVM_CAP_SIGNAL_MSI.

You also need Python 2.6+ or Python 3+, plus the Python six module.

Building

To build novm, simply clone the repo and run make.

Optionally, you can build packages by running make deb or make rpm.

To run novm, use scripts/novm, or if you've installed packages, just type novm.

For information on using the command line, just type novm. You may use novm <command> --help for detailed information on any specific command.

The first thing you'll need is a kernel. You can create a kernel bundle using the running kernel by running novm-import-kernel.

To create a novm instance, try using novm create --com1 /bin/ls.

Technical Details

Bootloader

Currently, the in-built bootloader supports only modern Linux kernels.

It follows the Linux boot convention by setting the vcpu directly into 32-bit protected mode and jumping to the ELF entry point. Or, if it finds a 64-bit kernel, it will do a bit of additional setup (creating an identity-mapped page table) and then jumps directly into 64-bit long mode at the entry point.

For full details on this convention see: https://www.kernel.org/doc/Documentation/x86/boot.txt

How does it work?

The embedded bootloader works different than traditional bootloaders, such as GRUB or LILO. Unlike other bootloaders, the embedded bootloader requires the ELF kernel binary (vmlinux), not the compressed image (bzImage).

This is because the compressed image (bzImage) contains a compressed version of the ELF kernel binary, real-mode setup code, and a small setup sector. Traditional bootloaders typically lay these components out in memory and execute the real-mode code. The real-mode setup code will construct a few basic data structures via BIOS calls, extract the vmlinux binary into memory and finally jump into 32-bit protected mode in the newly uncompressed code.

This is a sensible approach, as the real-mode kernel code will be able to execute arbitrary BIOS calls and probe the hardware in arbitrary ways before finally switching to protected mode. However, for a virtualized environment where the hardware is fixed and known to the hypervisor, the bootloader itself can lay out the necessary data structures in memory and start directly in 32-bit protected mode. In addition to skipping a batch of real-mode execution and emulation, this allows us to avoid having to build a BIOS at all.

If a bzImage is provided, the ELF binary will be extracted and cached using a simple script derived from the script found in the Linux tree.

Given a vmlinux binary file, we load the file directly into memory as specified by the ELF program headers. For example:

Type           Offset             VirtAddr           PhysAddr
               FileSiz            MemSiz              Flags  Align
LOAD           0x0000000000200000 0xffffffff81000000 0x0000000001000000
               0x0000000000585000 0x0000000000585000  R E    200000
LOAD           0x0000000000800000 0xffffffff81600000 0x0000000001600000
               0x000000000009d0f0 0x000000000009d0f0  RW     200000
LOAD           0x0000000000a00000 0x0000000000000000 0x000000000169e000
               0x0000000000014bc0 0x0000000000014bc0  RW     200000
LOAD           0x0000000000ab3000 0xffffffff816b3000 0x00000000016b3000
               0x00000000000d5000 0x00000000005dd000  RWE    200000
NOTE           0x000000000058efd0 0xffffffff8138efd0 0x000000000138efd0
               0x000000000000017c 0x000000000000017c         4

We also note the entry point for the binary (here it happens to be 0x1000000).

Before we are able to jump to the entry point, we need to setup some basic requirements that would normally be done by the real-mode setup code:

  • Need a simple GDT and BOOT_CS and BOOT_DS.
  • An empty IDT is fine.
  • Interrupts need to be disabled.
  • CR0 is set appropriately to enable protected mode.
  • Registers are cleared appropriately (per boot convention).
  • Boot params structure is initialized and pointed to (see below).

As part of this setup process, any provided initial ram disk is also loaded into memory. This is pointed to as part of the boot parameters, and decompression is handled by the kernel.

Devices

The device model implemented by this kernel is substantially different from most VMs. Instead of attemping to emulate a legacy machine, we instead to support only the mechanisms which make sense for a next generation purpose-built Virtual Machine.

novm's People

Contributors

amscanne avatar attilaolah avatar davidkuridza avatar hamo avatar mrahatm avatar rmahmood avatar tdubrownik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

novm's Issues

Exception IOError: (9, 'Bad file descriptor')

go 1.3.3 linux/amd64 python 2.7.8.

On exit, novm create spits out lots of errors.

$ novm create --name test --nofork --terminal --com1 --nic tapname=pw-tap,ip=192.168.32.5/24
[... snip ...]
Exception IOError: (9, 'Bad file descriptor') in <bound method _TemporaryFileWrapper.__del__ of <closed file '<fdopen>', mode 'w' at 0x7fc81c4a8d20>> ignored
close failed in file object destructor:
close failed in file object destructor:
IOError: [Errno 9] Bad file descriptor
IOErrorclose failed in file object destructor:
IOError: [Errno 9] Bad file descriptor: 
[Errno 9] Bad file descriptor
close failed in file object destructor:
close failed in file object destructor:
IOError: [Errno 9] Bad file descriptor
IOError: [Errno 9] Bad file descriptor
close failed in file object destructor:
IOError: [Errno 9] Bad file descriptor
close failed in file object destructor:
IOError: [Errno 9] Bad file descriptor
close failed in file object destructor:
IOError: [Errno 9] Bad file descriptor
close failed in file object destructor:
IOError: [Errno 9] Bad file descriptor

VM freezes when I try to run anything

I had this working earlier, but now it reliably freezes and I can't get anything to work.

Steps taken:

# novm-import-kernel
# novm create
# novm list
# novm run --id <output from novm list> echo hi

I then observe the CPU get pegged in novmm. stracing reveals it's stuck on the KVM_RUN ioctl. I sent sigquit to the binary consuming 100% CPU, here's the trace. Do we expect so many IoHandlers in particular?

https://gist.github.com/pwaller/78271959acac8d97adcc

excerpt:

SIGQUIT: quit
PC=0x7ff2bdaaa867
signal arrived during cgo execution

goroutine 54 [syscall]:
runtime.cgocall(0x4049a0, 0x7ff2bc0c4e50)
    /usr/lib/go/src/pkg/runtime/cgocall.c:143 +0xe5 fp=0x7ff2bc0c4e38 sp=0x7ff2bc0c4df0
novmm/platform._Cfunc_kvm_run(0xa00000004, 0xc208026a78, 0x0)
    novmm/platform/_obj/_cgo_defun.c:443 +0x31 fp=0x7ff2bc0c4e50 sp=0x7ff2bc0c4e38
novmm/platform.(*Vcpu).Run(0xc208026840, 0x0, 0x0)
    /home/pwaller/.local/src/github.com/google/novm/src/novmm/platform/kvm_run.go:107 +0x12c fp=0x7ff2bc0c4e98 sp=0x7ff2bc0c4e50
main.Loop(0xc2080281c0, 0xc208026840, 0xc20801ad70, 0xc2093f4980, 0x0, 0x0)
    /home/pwaller/.local/src/github.com/google/novm/src/novmm/loop.go:34 +0xd2 fp=0x7ff2bc0c4f40 sp=0x7ff2bc0c4e98
main.func·001(0xc208026840)
    /home/pwaller/.local/src/github.com/google/novm/src/novmm/main.go:286 +0x55 fp=0x7ff2bc0c4fa0 sp=0x7ff2bc0c4f40
runtime.goexit()
    /usr/lib/go/src/pkg/runtime/proc.c:1445 fp=0x7ff2bc0c4fa8 sp=0x7ff2bc0c4fa0
created by main.main
    /home/pwaller/.local/src/github.com/google/novm/src/novmm/main.go:288 +0xd69

Request: support for existing tap devices

I want to run novm as a user (which has access to /dev/kvm). I appreciate that the user may be able to escape, but I want to do it anyway. Apparently, the only thing preventing this from working is this call:

novm/novm/net.py

Lines 159 to 162 in 278237d

# Make sure the interface is up.
subprocess.check_call(
["/sbin/ip", "link", "set", "up", "dev", tapname],
close_fds=True)

It is possible to create tap devices which are owned by a user via, for example ip tuntap add dev pw mode tap user pwaller group pwaller. In this case, only root is able to modify the host side of the device, so root has to set the device up.

Could novm detect that the device is already up and then not bother trying to run ip link set up dev tapN?

bootparam.h path

Not sure if the source is built ok on Ubuntu. but for Fedora(21)
I need to make following change to allow linux_setup.go to be compiled.

[tjyang@fedora21 novm]$ grep bootpara src/novmm/loader/linux_setup.go
//#include <x86_64-linux-gnu/asm/bootparam.h>
#include <asm/bootparam.h>
//#include <i386-linux-gnu/asm/bootparam.h>
#include <asm/bootparam.h>
[tjyang@fedora21 novm]$ 

Will Vagrant file welcome for PR ?

Hello,

I have started to test novm, and I 100% sold into the idea.

I have done a Vagrantfile using Oracle Linux 7 that install golang/git, clone the code, make, make rpm, install.

If a contribution like this is valuable, I can look after create vagrantfiles for several OS so people can test?

alvaro.

Is "gofmt -tabs" supported in go 1.3.3 ?

I had to make following change to allow gofmt in Makefile to work in gofmt 1.3.3(fedora 21).

following is the error log

[tjyang@fedora21 novm]$ !719
gofmt -l=true -w=true -tabs=false -tabwidth=4 src/novmm/*
flag provided but not defined: -tabs
usage: gofmt [flags] [path ...]
  -cpuprofile="": write cpu profile to this file
  -d=false: display diffs instead of rewriting files
  -e=false: report all errors (not just the first 10 on different lines)
  -l=false: list files whose formatting differs from gofmt's
  -r="": rewrite rule (e.g., 'a[b:len(a)] -> a[b:]')
  -s=false: simplify code
  -w=false: write result to (source) file instead of stdout
[tjyang@fedora21 novm]$ 

https://github.com/tjyang/novm/compare/google:master...master#diff-b67911656ef5d18c4ae36cb6741b7965L61

Fedora 21: novm rpm install path conflict with filesystem package

[tjyang@fedora21 novm]$ sudo rpm -ivh novm-0.0-164.gb7c9c78.x86_64.rpm 
Preparing...                          ################################# [100%]
    file /usr from install of novm-0.0-164.gb7c9c78.x86_64 conflicts with file from package filesystem-3.2-28.fc21.x86_64
    file /usr/bin from install of novm-0.0-164.gb7c9c78.x86_64 conflicts with file from package filesystem-3.2-28.fc21.x86_64
    file /usr/lib from install of novm-0.0-164.gb7c9c78.x86_64 conflicts with file from package filesystem-3.2-28.fc21.x86_64
[tjyang@fedora21 novm]$ 

novm command error

root@ubuntu:/home/fox/novm# novm kernels

| id | url | timestamp | release | name |

| e4a4937c6cf0c769af670ebf6df1a2eb2a001995 | file:///tmp/tmpoFu5Jj | Mon Jan 12 00:51:20 2015 | 3.13.0-32-generic | |

root@ubuntu:/home/fox/novm# novm --debug create --kernel e4a4937c6cf0c769af670ebf6df1a2eb2a001995 --name test
20182
root@ubuntu:/home/fox/novm# novm list
root@ubuntu:/home/fox/novm# novm run 20144
error: "{'name': None}"
root@ubuntu:/home/fox/novm#

root@ubuntu:/home/fox/novm# uname -an
Linux ubuntu 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
root@ubuntu:/home/fox/novm# go version
go version go1.2.1 linux/amd64

Links in modules directory cause mkkernel to fail

There's an issue with mkkernel if the /lib/modules/(version) contains symlinks. shutil.copytree() can deal with symlinks to files, but not to directories.

The result is error like this:

shutil.Error: [('/lib/modules/..../extramodules', '/tmp/tmpsea3yv0m/modules/extramodules', "[Errno 21] Is a directory: '/lib/modules/..../extramodules'")]

Where extramodules is a link to another directory.

novm on archlinux

> novm-import-kernel 
Usage: extract-vmlinux <kernel-image>
error: Command '['~/Workspace/novm/lib/novm/libexec/extract-vmlinux', '/boot/vmlinuz-3.18.5-1-ARCH']' returned non-zero exit status 2

Importing Linux Kernel Image on Archlinux yields an error; archlinux is a rolling release and breaks the standard linux name conventions.

For example the actual kernel image named core\linux (representing 3.18.5-1-ARCH kernel) is placed /boot/vmlinuz-linux with modules under /lib/modules/3.18.5-1-ARCH.

If copy vmlinuz-linux to the expected location the error message become:

> novm-import-kernel
[things]
error: [Errno 2] No such file or directory: '/boot/System.map-3.18.5-1-ARCH'

In archlinux the System.map file isn't available in /boot/System.map-${put here the version} but it is easily recoverable from a running kernel with

> sudo cp /proc/kallsyms /boot/System.map-`uname -r`

After these shims novm works.

novm run gets stuck when exiting bash

Edit: accidentally hit ctrl-enter before writing the post... apologies

novm --debug create --name pw-test --nofork --init --nic ip=192.168.1.2/24,gateway=192.168.1.1
foo pwaller # novm run --name pw-test --terminal bash
foo / # exit
^C^C^C

Now I have to go and kill novm run from elsewhere to reclaim my terminal.

Wrong usage of break statement

There is no need for a break statement in the case block in golang.

switch int(event) {
case VirtioConsoleDeviceReady:
vchannel.Debug("device-ready")
device.sendCtrl(0, VirtioConsolePortAdd, 1)
break
case VirtioConsolePortAdd:
vchannel.Debug("port-add?")
break
case VirtioConsolePortRemove:
vchannel.Debug("port-remove?")
break
case VirtioConsolePortReady:
vchannel.Debug("port-ready")
if id == 0 && value == 1 {
// No, this is not a console.
device.sendCtrl(0, VirtioConsolePortConsole, 0)
device.sendCtrl(0, VirtioConsolePortOpen, 1)
if !device.Opened {
device.Opened = true
device.read_lock.Unlock()
device.write_lock.Unlock()
}
}
break
case VirtioConsolePortConsole:
vchannel.Debug("port-console?")
break
case VirtioConsolePortResize:
vchannel.Debug("port-resize")
break
case VirtioConsolePortOpen:
vchannel.Debug("port-open")
break
case VirtioConsolePortName:
vchannel.Debug("port-name")
break
default:
vchannel.Debug("unknown?")
break
}

switch int(cmd_type) {
case VirtioBlockTIn:
_, err := buf.PRead(device.Fd, offset, 16, buf.Length()-17)
if err != nil {
device.Debug(
"read err [%x,%x] -> %s",
offset,
int(offset)+buf.Length()-18,
err.Error())
status.Set8(0, VirtioBlockSIoErr)
} else {
device.Debug(
"read ok [%x,%x]",
offset,
int(offset)+buf.Length()-18)
status.Set8(0, VirtioBlockSOk)
}
break
case VirtioBlockTOut:
_, err := buf.PWrite(device.Fd, offset, 16, buf.Length()-17)
if err != nil {
device.Debug(
"write err [%x,%x] -> %s",
offset,
int(offset)+buf.Length()-18,
err.Error())
status.Set8(0, VirtioBlockSIoErr)
} else {
device.Debug(
"write ok [%x,%x]",
offset,
int(offset)+buf.Length()-18)
status.Set8(0, VirtioBlockSOk)
}
break
default:
device.Debug("unknown command '%d'?", cmd_type)
status.Set8(0, VirtioBlockSUnsupported)
break
}

--read "/home=>/tmp/home" leads to fail boot

Create through command:
python2 /usr/bin/novm create --com1 --nofork --read "/home=>/tmp/home"

and system hangs at
[ 0.784444] switch_root: cannot access /proc/self/fd/3: No such file or directory
[ 0.790306] switch_root: failed to execute /proc/self/fd/3: No such file or directory

Without --read "/home=>/tmp/home" works fine.

Unable to run command

I attempted to create and execute a command with a created container but neither works but fails.

System

Linux darkvoid 4.10.8-1-ARCH #1 SMP PREEMPT Fri Mar 31 16:50:19 CEST 2017 x86_64 GNU/Linux

Error

~/L/r/g/s/g/g/novm (master) [n] ⋊> python2 novm --debug create --nofork --com1
/bin/python2: can't find '__main__' module in 'novm'

~/L/r/g/s/g/g/novm (master) [n] ⋊> python2 scripts/novm --debug create --nofork --com1
2017/05/15 23:44:34 Missing capability: Clock

~/L/r/g/s/g/g/novm (master) [n] ⋊> python2 scripts/novm --debug create 
11469

~/L/r/g/s/g/g/novm (master) [n] ⋊> python2 scripts/novm --debug list
python2 scripts/novm --debug run --id 11469 bin/ls
Traceback (most recent call last):
  File "./novm/cli.py", line 203, in main
    result = fn(*built_args)
  File "./novm/shell.py", line 186, in run
    command=command)
  File "./novm/manager.py", line 404, in run_noguest
    ctrl = control.Control(ctrl_path, bind=False)
  File "./novm/control.py", line 57, in __init__
    self._sock.connect(path)
  File "/usr/lib/python2.7/socket.py", line 228, in meth
    return getattr(self._sock,name)(*args)
error: [Errno 2] No such file or directory

error mount_tag in novm's guest

CentOS 6.5
kernel 3.12.21
qemu-kvm 2.1.2 (enable-virtfs)
go version go1.3.3 linux/amd64
Python 2.6.6

firstly, I run the novm, it print "9pnet_virtio: no channels available", so I modified lib/novm/libexec/init, it can print the mount_tag:

......
echo "~~~ read virtio1 mount_tag ~~~" > /dev/kmsg
cat /sys/bus/virtio/drivers/9pnet_virtio/virtio1/mount_tag > /dev/kmsg
echo "~~~ read virtio2 mount_tag ~~~" > /dev/kmsg
cat /sys/bus/virtio/drivers/9pnet_virtio/virtio2/mount_tag > /dev/kmsg
echo "~~~ read virtio1 status ~~~" > /dev/kmsg
cat /sys/bus/virtio/drivers/9pnet_virtio/virtio1/status > /dev/kmsg
......

I run the novm again, it print the log:
......

�root~~~ read virtio2 mount_tag ~~~

init~~~ read virtio1 status ~~~
0x00000007
......

so, I think the mount_tag are error in guest, the correct mount_tag are "root" and "init" .

examples please

I've looked at the source and the scripts... but I need some examples that show off it's major features. I see some plan9 code embedded and docker too, however, the scripts talk about booting Linux and so the two confuse me. Please elaborate.

vcpu0 unhandled rdmsr

Are these harmful? It's an i7-3770, Debian 8 x64, go 1.4, python 2.7.8.

[431428.919308] kvm [12633]: vcpu0 unhandled rdmsr: 0x1c9
[431428.919511] kvm [12633]: vcpu0 unhandled rdmsr: 0x1a6
[431428.919677] kvm [12633]: vcpu0 unhandled rdmsr: 0x1a7
[431428.919832] kvm [12633]: vcpu0 unhandled rdmsr: 0x3f6
[431428.998631] kvm [12633]: vcpu0 unhandled rdmsr: 0x606

Kernel crash (in ext4?)

Please let me know if you want to receive this kind of report or not.

novm 0.0-187.g62366c6, i7-3770, Debian 8 x64, go 1.4, python 2.7.8, linux 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt2-1 (2014-12-08).

I experienced a kernel crash after leaving this running idle for some time (>45 minutes):

$ novm create --name test --nofork --terminal --com1

The command froze, became a zombie and had a child process stuck in an uninterruptable sleep. I am unsure if the kernel crash is cause or effect of a novm problem.

[435628.006811] ------------[ cut here ]------------
[435628.007149] kernel BUG at /build/linux-CMiYW9/linux-3.16.7-ckt2/fs/ext4/inode.c:1842!
[435628.007507] invalid opcode: 0000 [#1] SMP 
[435628.007872] Modules linked in: iTCO_wdt iTCO_vendor_support eeepc_wmi asus_wmi sparse_keymap rfkill ppdev x86_pkg_temp_thermal evdev intel_powerclamp intel_rapl i915 tpm_infineon tpm_tis tpm mei_me drm_kms_helper drm mei parport_pc coretemp lpc_ich i2c_algo_bit parport shpchp battery mfd_core video processor kvm_intel kvm i2c_i801 serio_raw pcspkr i2c_core wmi button autofs4 ext4 crc16 mbcache jbd2 btrfs algif_skcipher af_alg dm_raid raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx raid10 xor raid1 raid6_pq dm_crypt dm_mod md_mod sg sd_mod crc_t10dif crct10dif_generic crct10dif_pclmul crct10dif_common crc32_pclmul crc32c_intel ghash_clmulni_intel aesni_intel aes_x86_64 lrw ahci gf128mul glue_helper ablk_helper libahci cryptd libata ehci_pci xhci_hcd ehci_hcd scsi_mod r8169 mii usbcore
[435628.011624]  usb_common thermal fan thermal_sys
[435628.012361] CPU: 3 PID: 58 Comm: kswapd0 Not tainted 3.16.0-4-amd64 #1 Debian 3.16.7-ckt2-1
[435628.013127] Hardware name: System manufacturer System Product Name/P8H77-M PRO, BIOS 9002 05/30/2014
[435628.013927] task: ffff88040f382050 ti: ffff88040b88c000 task.ti: ffff88040b88c000
[435628.014689] RIP: 0010:[<ffffffffa039fb37>]  [<ffffffffa039fb37>] ext4_writepage+0x407/0x450 [ext4]
[435628.015494] RSP: 0018:ffff88040b88fa10  EFLAGS: 00010246
[435628.016405] RAX: 02ffff8000040009 RBX: 0000000000001000 RCX: 0000000000000020
[435628.017379] RDX: 0000000000040000 RSI: ffff88040b88fb18 RDI: ffffea000de16930
[435628.018327] RBP: ffffea000de16930 R08: ffff880370795600 R09: 0000000000000000
[435628.019317] R10: 0000000000016258 R11: ffff88041fde8e00 R12: ffff8803707954b0
[435628.020337] R13: ffff88040b88fb18 R14: ffff88040a8671a0 R15: ffff88040b88faf8
[435628.021361] FS:  0000000000000000(0000) GS:ffff88041fac0000(0000) knlGS:0000000000000000
[435628.022321] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[435628.023382] CR2: 00007f7823f24000 CR3: 0000000001813000 CR4: 00000000001427e0
[435628.024553] Stack:
[435628.025638]  ffff88040b88fa0c ffffffff81170c70 0000000000000000 0000000000000000
[435628.026860]  0000000000000000 ffff88040b88fdc0 ffffea000de16950 ffff88040b88fbe8
[435628.027934]  ffffea000de16930 ffff88040a8671a0 ffff88040b88faf8 ffffffff8114d489
[435628.029027] Call Trace:
[435628.030114]  [<ffffffff81170c70>] ? page_referenced_one+0x160/0x160
[435628.031233]  [<ffffffff8114d489>] ? shrink_page_list+0x7d9/0xa60
[435628.032363]  [<ffffffff8114dd42>] ? shrink_inactive_list+0x192/0x500
[435628.033502]  [<ffffffff8114e951>] ? shrink_lruvec+0x511/0x6a0
[435628.034651]  [<ffffffff8114eb54>] ? shrink_zone+0x74/0x1b0
[435628.035798]  [<ffffffff8114fc6e>] ? balance_pgdat+0x38e/0x5c0
[435628.036954]  [<ffffffff8114ffff>] ? kswapd+0x15f/0x400
[435628.038118]  [<ffffffff810a5940>] ? prepare_to_wait_event+0xf0/0xf0
[435628.039324]  [<ffffffff8114fea0>] ? balance_pgdat+0x5c0/0x5c0
[435628.040513]  [<ffffffff81085f1d>] ? kthread+0xbd/0xe0
[435628.041703]  [<ffffffff81085e60>] ? kthread_create_on_node+0x180/0x180
[435628.042929]  [<ffffffff8150d27c>] ? ret_from_fork+0x7c/0xb0
[435628.044147]  [<ffffffff81085e60>] ? kthread_create_on_node+0x180/0x180
[435628.045380] Code: ff e9 66 ff ff ff 45 31 ff e9 72 ff ff ff 48 89 ee 4c 89 ef e8 cb 5b da e0 48 89 ef e8 63 b0 d9 e0 b8 f4 ff ff ff e9 d2 fc ff ff <0f> 0b 0f 0b 0f 0b 41 89 c7 e9 3a ff ff ff 80 3d 08 a9 05 00 00 
[435628.048172] RIP  [<ffffffffa039fb37>] ext4_writepage+0x407/0x450 [ext4]
[435628.049550]  RSP <ffff88040b88fa10>
[435628.055612] ---[ end trace c943039a6a6ac28b ]---

error: 'KVM_SIGNAL_MSI' undeclared here (not in a function) when install

I use CentOS 6.6 x86_64, go1.4.1.linux-amd64

[root@localhost novm]# make rpm
make[1]: Entering directory `/usr/local/novm'
make[1]: Leaving directory `/usr/local/novm'
make[1]: Entering directory `/usr/local/novm'
# novmm/platform
src/novmm/platform/kvm_apic.go:26: error: 'KVM_SIGNAL_MSI' undeclared here (not in a function)
make[1]: *** [go-test] Error 2
make[1]: Leaving directory `/usr/local/novm'
make: *** [dist] Error 2

Does novm support CentOS? Thanks!

Lack of CONTRIBUTING.md

I want to contribute a couple of minor fixes for #9, but you have no instructions on how to do so. Do I just send a pull request? I see a .gitreview file implying that you use gerrit.

--nic instructions do not work

The only instructions I could find for specifying a network device were in the output of novm run -h.

        Network definitions are provided as --nic [opt=val],...

            Available options are:

            mac=00:11:22:33:44:55 Set the MAC address.
            tap=tap1              Set the tap name.
            bridge=br0            Enslave to a bridge.
            ip=192.168.1.2/24     Set the IP address.
            gateway=192.168.1.1   Set the gateway IP.
            debug=true            Enable debugging.

So I tried:

# novm --debug create --nofork --init --nic tap=tap1,ip=192.168.1.2/24,gateway=192.168.1.1,debug=true
Traceback (most recent call last):
  File "/usr/bin/../lib/novm/python/novm/cli.py", line 203, in main
    result = fn(*built_args)
  File "/usr/bin/../lib/novm/python/novm/shell.py", line 118, in create
    command=command)
  File "/usr/bin/../lib/novm/python/novm/manager.py", line 287, in create
    vmmopt=vmmopt)
  File "/usr/bin/../lib/novm/python/novm/manager.py", line 341, in run_novmm
    state_args, metadata = state(state_file)
  File "/usr/bin/../lib/novm/python/novm/manager.py", line 187, in state
    for (index, nic) in zip(range(len(nics)), nics)
  File "/usr/bin/../lib/novm/python/novm/net.py", line 201, in create
    }, **kwargs)
  File "/usr/bin/../lib/novm/python/novm/virtio.py", line 66, in create
    **kwargs)
TypeError: create() got an unexpected keyword argument 'tap'

And:

# novm --debug create --nofork --init --nic ip=192.168.1.2/24,gateway=192.168.1.1,debug=true
20`15/01/10 13:43:00 json: cannot unmarshal string into Go value of type bool

Can't build on Ubuntu 20.04 x86_64 (with gollvm)

Hi.
Can't build your project:

$ make
make[1]: Entering directory '/home/oceanfish81/go_projects/novm'
make[1]: Leaving directory '/home/oceanfish81/go_projects/novm'
make[1]: Entering directory '/home/oceanfish81/go_projects/novm'

novmm/platform

kvm_run.c:133:1: warning: non-void function does not return a value [-Wreturn-type]

novmm/platform

src/novmm/platform/kvm_apic.go:186:4: error: integer constant overflow
src/novmm/platform/kvm_apic.go:246:4: error: integer constant overflow
src/novmm/platform/kvm_apic.go:264:3: error: integer constant overflow
src/novmm/platform/kvm_clock.go:46:3: error: integer constant overflow
src/novmm/platform/kvm_cpuid.go:54:4: error: integer constant overflow
src/novmm/platform/kvm_events.go:63:3: error: integer constant overflow
src/novmm/platform/kvm_fpu.go:54:3: error: integer constant overflow
src/novmm/platform/kvm_memory.go:84:3: error: integer constant overflow
src/novmm/platform/kvm_mpstate.go:74:3: error: integer constant overflow
src/novmm/platform/kvm_msrs.go:51:4: error: integer constant overflow
src/novmm/platform/kvm_msrs.go:95:3: error: integer constant overflow
src/novmm/platform/kvm_pit.go:79:3: error: integer constant overflow
src/novmm/platform/kvm_x86.go:57:4: error: integer constant overflow
src/novmm/platform/kvm_x86.go:95:4: error: integer constant overflow
src/novmm/platform/kvm_xcrs.go:46:3: error: integer constant overflow
src/novmm/platform/kvm_xsave.go:45:3: error: integer constant overflow
make[1]: *** [Makefile:55: go-test] Error 2
make[1]: Leaving directory '/home/oceanfish81/go_projects/novm'
make: *** [Makefile:77: dist] Error 2

$ go version
go version go1.15.2 gollvm LLVM 12.0.0git linux/amd64

$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/oceanfish81/.cache/go-build"
GOENV="/home/oceanfish81/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/oceanfish81/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/oceanfish81/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/oceanfish81/gollvm_dist"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/oceanfish81/gollvm_dist/tools"
GCCGO="/home/oceanfish81/gollvm_dist/bin/llvm-goc"
AR="ar"
CC="/usr/bin/clang"
CXX="/usr/bin/clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build759872561=/tmp/go-build -gno-record-gcc-switches -funwind-tables"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.