Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using xhyve, as a library, from Go. PCI devices do not show up. #61

Closed
c4milo opened this issue Sep 20, 2015 · 8 comments
Closed

Using xhyve, as a library, from Go. PCI devices do not show up. #61

c4milo opened this issue Sep 20, 2015 · 8 comments

Comments

@c4milo
Copy link
Member

c4milo commented Sep 20, 2015

I've been using xhyve as a library from Go. I was able to statically compile my Go program against xhyve using CGO. But, whenever I boot a VM, for some reason none of the PCI devices are being recognized by the kernel. Any idea of why this would happen?

c4milo at Camilos-MacBook-Pro in ~/go/src/github.com/hooklift/nnn on master [!?]
$ sudo ./nnn -m 1024M -c 1 -A -s 0:0,hostbridge -s 31,lpc -l com1,stdio -s 2:0,virtio-net -U 6BCE442E-4359-4BD9-84F7-EDFB8EC6D2EF -f 'kexec,imgs/stable.766.3.0.coreos_production_pxe.vmlinuz,imgs/stable.766.3.0.coreos_production_pxe_image.cpio.gz,earlyprintk=serial console=ttyS0 coreos.autologin'
Password:
early console in decompress_kernel

Decompressing Linux... Parsing ELF... done.
Booting the kernel.
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 4.1.6-coreos-r1 (buildbot@ip-10-204-3-57) (gcc version 4.8.4 (Gentoo Hardened 4.8.4 p1.5, pie-0.6.1) ) #2 SMP Wed Sep 2 04:16:15 UTC 2015
[    0.000000] Command line: earlyprintk=serial console=ttyS0 coreos.autologin
[    0.000000] e820: BIOS-provided physical RAM map:
[    0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
[    0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000003fffffff] usable
[    0.000000] bootconsole [earlyser0] enabled
[    0.000000] ERROR: earlyprintk= earlyser already used
[    0.000000] NX (Execute Disable) protection: active
[    0.000000] SMBIOS 2.6 present.
[    0.000000] AGP: No AGP bridge found
[    0.000000] e820: last_pfn = 0x40000 max_arch_pfn = 0x400000000
[    0.000000] PAT configuration [0-7]: WB  WC  UC- UC  WB  WC  UC- UC
[    0.000000] CPU MTRRs all blank - virtualized system.
[    0.000000] Using GB pages for direct mapping
[    0.000000] init_memory_mapping: [mem 0x00000000-0x000fffff]
[    0.000000] init_memory_mapping: [mem 0x3fe00000-0x3fffffff]
[    0.000000] init_memory_mapping: [mem 0x20000000-0x3fdfffff]
[    0.000000] init_memory_mapping: [mem 0x00100000-0x1fffffff]
[    0.000000] RAMDISK: [mem 0x036bb000-0x0d7adfff]
[    0.000000] ACPI: Early table checksum verification disabled
[    0.000000] ACPI: RSDP 0x00000000000F2400 000024 (v02 BHYVE )
[    0.000000] ACPI: XSDT 0x00000000000F2480 000044 (v01 BHYVE  BVXSDT   00000001 INTL 20140828)
[    0.000000] ACPI: APIC 0x00000000000F2500 00005A (v01 BHYVE  BVMADT   00000001 INTL 20140828)
[    0.000000] ACPI: FACP 0x00000000000F2600 00010C (v05 BHYVE  BVFACP   00000001 INTL 20140828)
[    0.000000] ACPI: DSDT 0x00000000000F2800 000A2D (v02 BHYVE  BVDSDT   00000001 INTL 20140828)
[    0.000000] ACPI: FACS 0x00000000000F27C0 000040
[    0.000000] ACPI: FACS 0x00000000000F27C0 000040
[    0.000000] ACPI: HPET 0x00000000000F2740 000038 (v01 BHYVE  BVHPET   00000001 INTL 20140828)
[    0.000000] ACPI: MCFG 0x00000000000F2780 00003C (v01 BHYVE  BVMCFG   00000001 INTL 20140828)
[    0.000000] Setting APIC routing to physical flat.
[    0.000000] No NUMA configuration found
[    0.000000] Faking a node at [mem 0x0000000000000000-0x000000003fffffff]
[    0.000000] NODE_DATA(0) allocated [mem 0x3fff9000-0x3fffffff]
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000000001000-0x0000000000ffffff]
[    0.000000]   DMA32    [mem 0x0000000001000000-0x000000003fffffff]
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000001000-0x000000000009efff]
[    0.000000]   node   0: [mem 0x0000000000100000-0x000000003fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000001000-0x000000003fffffff]
[    0.000000] ACPI: PM-Timer IO Port: 0x408
[    0.000000] ACPI: LAPIC_NMI (acpi_id[0xff] high edge lint[0x1])
[    0.000000] IOAPIC[0]: apic_id 0, version 17, address 0xfec00000, GSI 0-23
[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 high edge)
[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 low level)
[    0.000000] Using ACPI (MADT) for SMP configuration information
[    0.000000] ACPI: HPET id: 0x80860701 base: 0xfed00000
[    0.000000] smpboot: Allowing 1 CPUs, 0 hot[    0.000000] AGP: No AGP bridge found
[    0.000000] Memory: 830148K/1048184K available (5459K kernel code, 993K rwdata, 2384K rodata, 24108K init, 936K bss, 218036K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  RCU restricting CPUs from NR_CPUS=128 to nr_cpu_ids=1.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS:8448 nr_irqs:256 16
[    0.000000] Console: colour dummy device 80x25
[    0.000000] console [ttyS0] enabled
[    0.000000] console [ttyS0] enabled
[    0.000000] bootconsole [earlyser0] disabled
[    0.000000] bootconsole [earlyser0] disabled
[    0.000000] clocksource hpet: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 191126044627 ns
[    0.000000] tsc: Fast TSC calibration using PIT
[    0.000000] tsc: Detected 2194.466 MHz processor
[    0.000155] Calibrating delay loop (skipped), value calculated using timer frequency.. 4388.93 BogoMIPS (lpj=2194466)
[    0.000835] pid_max: default: 32768 minimum: 301
[    0.001125] ACPI: Core revision 20150410
[    0.001731] ACPI: All ACPI Tables successfully acquired
[    0.002301] Security Framework initialized
[    0.002701] SELinux:  Disabled at boot.
[    0.002977] Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes)
[    0.004558] Inode-cache hash table entries: 65536 (order: 7, 524288 bytes)
[    0.005566] Mount-cache hash table entries: 2048 (order: 2, 16384 bytes)
[    0.005954] Mountpoint-cache hash table entries: 2048 (order: 2, 16384 bytes)
[    0.006748] Initializing cgroup subsys blkio
[    0.007001] Initializing cgroup subsys memory
[    0.007259] Initializing cgroup subsys devices
[    0.007530] Initializing cgroup subsys freezer
[    0.007789] Initializing cgroup subsys net_cls
[    0.008047] Initializing cgroup subsys perf_event
[    0.008336] Initializing cgroup subsys net_prio
[    0.008791] CPU: Physical Processor ID: 0
[    0.009834] mce: CPU supports 0 MCE banks
[    0.010094] Last level iTLB entries: 4KB 1024, 2MB 1024, 4MB 1024
[    0.010487] Last level dTLB entries: 4KB 1024, 2MB 1024, 4MB 1024, 1GB 4
[    0.029912] Freeing SMP alternatives memory: 24K (ffffffff83285000 - ffffffff8328b000)
[    0.040011] ftrace: allocating 21287 entries in 84 pages
[    0.099860] ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
[    0.211524] smpboot: CPU0: Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz (fam: 06, model: 46, stepping: 01)
[    0.212399] Performance Events: unsupported p6 CPU model 70 no PMU driver, software events only.
[    0.213697] x86: Booted up 1 node, 1 CPUs
[    0.213940] smpboot: Total of 1 processors activated (4388.93 BogoMIPS)
[    0.224247] NMI watchdog: disabled (cpu0): hardware events not enabled
[    0.224782] NMI watchdog: Shutting down hard lockup detector on all cpus
[    0.225471] devtmpfs: initialized
[    0.227295] clocksource jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1911260446275000 ns
[    0.228165] pinctrl core: initialized pinctrl subsystem
[    0.228643] NET: Registered protocol family 16
[    0.229001] cpuidle: using governor ladder
[    0.229242] cpuidle: using governor menu
[    0.229506] ACPI FADT declares the system doesn't support PCIe ASPM, so disable it
[    0.229938] ACPI: bus type PCI registered
[    0.230171] acpiphp: ACPI Hot Plug PCI Controller Driver version: 0.5
[    0.230642] dca service started, version 1.12.1
[    0.230951] PCI: MMCONFIG for domain 0000 [bus 00-ff] at [mem 0xe0000000-0xefffffff] (base 0xe0000000)
[    0.231480] PCI: not using MMCONFIG
[    0.231688] PCI: Using configuration type 1 for base access
[    0.232770] ACPI: Added _OSI(Module Device)
[    0.233022] ACPI: Added _OSI(Processor Device)
[    0.233279] ACPI: Added _OSI(3.0 _SCP Extensions)
[    0.233550] ACPI: Added _OSI(Processor Aggregator Device)
[    0.234264] ACPI: Interpreter enabled
[    0.234484] ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S1_] (20150410/hwxface-580)
[    0.235083] ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S2_] (20150410/hwxface-580)
[    0.235712] ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S3_] (20150410/hwxface-580)
[    0.236292] ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S4_] (20150410/hwxface-580)
[    0.236880] ACPI: (supports S0 S5)
[    0.237118] ACPI: Using IOAPIC for interrupt routing
[    0.237477] PCI: MMCONFIG for domain 0000 [bus 00-ff] at [mem 0xe0000000-0xefffffff] (base 0xe0000000)
[    0.238075] PCI: MMCONFIG at [mem 0xe0000000-0xefffffff] reserved in ACPI motherboard resources
[    0.238583] PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug
[    0.239840] ACPI: PCI Root Bridge [PC00] (domain 0000 [bus 00])
[    0.240187] acpi PNP0A03:00: _OSC: OS supports [ExtendedConfig ASPM ClockPM Segments MSI]
[    0.240656] acpi PNP0A03:00: _OSC failed (AE_NOT_FOUND); disabling ASPM
[    0.241044] acpi PNP0A03:00: host bridge window [mem 0x00000000-0xd0000fffff window] ([0x8000000000-0xd0000fffff] ignored, not CPU addressable)
[    0.241782] acpi PNP0A03:00: host bridge window expanded to [mem 0x00000000-0x7fffffffff window]; [mem 0x00000000-0x7fffffffff window] ignored
[    0.242540] PCI host bridge to bus 0000:00
[    0.242790] pci_bus 0000:00: root bus resource [bus 00]
[    0.243091] pci_bus 0000:00: root bus resource [io  0x0000-0x0cf7 window]
[    0.243480] pci_bus 0000:00: root bus resource [io  0x0d00-0x1fff window]
[    0.243876] pci_bus 0000:00: root bus resource [io  0x2000-0x203f window]
[    0.244265] pci_bus 0000:00: root bus resource [mem 0x00000000-0x7fffffffff window]
[    0.244885] ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 6 7 9 10 11 12 14 15) *0, disabled.
[    0.245528] ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 6 7 9 10 11 12 14 15) *0, disabled.
[    0.246177] ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 6 7 9 10 11 12 14 15) *0, disabled.
[    0.246820] ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 6 7 9 10 11 12 14 15) *0, disabled.
[    0.247454] ACPI: PCI Interrupt Link [LNKE] (IRQs 3 4 5 6 7 9 10 11 12 14 15) *0, disabled.
[    0.248094] ACPI: PCI Interrupt Link [LNKF] (IRQs 3 4 5 6 7 9 10 11 12 14 15) *0, disabled.
[    0.248729] ACPI: PCI Interrupt Link [LNKG] (IRQs 3 4 5 6 7 9 10 11 12 14 15) *0, disabled.
[    0.249378] ACPI: PCI Interrupt Link [LNKH] (IRQs 3 4 5 6 7 9 10 11 12 14 15) *0, disabled.
[    0.250170] vgaarb: loaded
[    0.250372] PCI: Using ACPI for IRQ routing
[    0.285826] hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0, 0, 0, 0, 0, 0
[    0.286469] hpet0: 8 comparators, 32-bit 10.000000 MHz counter
[    0.289003] Switched to clocksource hpet
[    0.297114] pnp: PnP ACPI init
[    0.297585] system 00:00: [io  0x0220-0x0223] has been reserved
[    0.298081] system 00:00: [io  0x0224-0x0227] has been reserved
[    0.298641] system 00:00: [io  0x04d0-0x04d1] has been reserved
[    0.299141] system 00:00: [io  0x0400-0x0407] has been reserved
[    0.299482] system 00:00: [mem 0xe0000000-0xefffffff] has been reserved
[    0.299982] pnp: PnP ACPI: found 4 devices
[    0.305812] clocksource acpi_pm: mask: 0xffffff max_cycles: 0xffffff, max_idle_ns: 2085701024 ns
[    0.306395] NET: Registered protocol family 2
[    0.306833] TCP established hash table entries: 8192 (order: 4, 65536 bytes)
[    0.307382] TCP bind hash table entries: 8192 (order: 5, 131072 bytes)
[    0.307913] TCP: Hash tables configured (established 8192 bind 8192)
[    0.308455] UDP hash table entries: 512 (order: 2, 16384 bytes)
[    0.308800] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
[    0.309291] NET: Registered protocol family 1
[    0.656801] Unpacking initramfs...
[    1.249566] Freeing initrd memory: 164812K (ffff8800036bb000 - ffff88000d7ae000)
rdmsr to register 0x570 on vcpu 0
                                 [    1.250498] futex hash table entries: 256 (order: 2, 16384 bytes)
[    1.251053] Initialise system trusted keyring
[    1.251471] audit: initializing netlink subsys (disabled)
[    1.251872] audit: type=2000 audit(1442779276.086:1): initialized
[    1.252383] HugeTLB registered 2 MB page size, pre-allocated 0 pages
[    1.254192] VFS: Disk quotas dquot_6.6.0
[    1.254472] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    1.255486] alg: No test for stdrng (krng)
[    1.255739] Key type asymmetric registered
[    1.255981] Asymmetric key parser 'x509' registered
[    1.256315] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[    1.256790] io scheduler noop registered
[    1.257046] io scheduler deadline registered
[    1.257330] io scheduler cfq registered (default)
[    1.257640] pci_hotplug: PCI Hot Plug PCI Core version: 0.5
[    1.257994] pciehp: PCI Express Hot Plug Controller Driver version: 0.4
[    1.258469] GHES: HEST is not enabled!
[    1.258705] ioatdma: Intel(R) QuickData Technology Driver 4.00
[    1.259132] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    1.280354] 00:01: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
[    1.301921] 00:02: ttyS1 at I/O 0x2f8 (irq = 3, base_baud = 115200) is a 16550A
[    1.302786] i8042: PNP: No PS/2 controller found. Probing ports directly.
[    1.824555] i8042: Can't read CTR while initializing i8042
[    1.825049] i8042: probe of i8042 failed with error -5
[    1.825581] ACPI Error: Could not enable RealTimeClock event (20150410/evxfevnt-212)
[    1.826309] ACPI Warning: Could not enable fixed event - RealTimeClock (4) (20150410/evxface-654)
[    1.827061] rtc_cmos 00:03: rtc core: registered rtc_cmos as rtc0
[    1.827470] rtc_cmos 00:03: alarms up to one day, y3k, 114 bytes nvram
[    1.828038] NET: Registered protocol family 10
[    1.828516] NET: Registered protocol family 17
[    1.828976] Loading compiled-in X.509 certificates
[    1.829814] Loaded X.509 cert 'Build time autogenerated kernel key: 10cf7da14a0e283401448e7555d5f178c32e7396'
[    1.830394] registered taskstats version 1
[    1.830794] rtc_cmos 00:03: setting system clock to 2015-09-20 20:01:17 UTC (1442779277)
[    1.833502] Freeing unused kernel memory: 24108K (ffffffff81afa000 - ffffffff83285000)
[    1.833977] Write protecting the kernel read-only data: 10240k
[    1.834490] Freeing unused kernel memory: 672K (ffff880001558000 - ffff880001600000)
[    1.835152] Freeing unused kernel memory: 1712K (ffff880001854000 - ffff880001a00000)
[    1.838535] systemd[1]: Inserted module 'autofs4'
[    1.839814] ip_tables: (C) 2000-2006 Netfilter Core Team
[    1.840250] systemd[1]: Inserted module 'ip_tables'
[    1.841061] random: systemd urandom read with 4 bits of entropy available
[    1.842338] systemd[1]: systemd 222 running in system mode. (-PAM +AUDIT -SELINUX +IMA -APPARMOR +SMACK -SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT -GNUTLS -ACL +XZ -LZ4 +SECCOMP +BLKID -ELFUTILS +KMOD -IDN)
[    1.843541] systemd[1]: Detected virtualization other.
[    1.843906] systemd[1]: Detected architecture x86-64.
[    1.844229] systemd[1]: Running in initial RAM disk.

Welcome to dracut-041-r2 (Initramfs)!

[    1.845128] systemd[1]: No hostname configured.
[    1.845405] systemd[1]: Set hostname to <localhost>.
[    1.845743] systemd[1]: Initializing machine ID from random generator.
[  OK  ] Reached target Encrypted Volumes.
[    1.876531] systemd[1]: Reached target Encrypted Volumes.
[    1.876840] systemd[1]: Starting Encrypted Volumes.
[  OK  ] Created slice -.slice.
[    1.877813] systemd[1]: Created slice -.slice.
[    1.878137] systemd[1]: Starting -.slice.
[  OK  ] Listening on Journal Socket (/dev/log).
[    1.879003] systemd[1]: Listening on Journal Socket (/dev/log).
[    1.879370] systemd[1]: Starting Journal Socket (/dev/log).
[  OK  ] Listening on udev Control Socket.
[    1.880332] systemd[1]: Listening on udev Control Socket.
[    1.880660] systemd[1]: Starting udev Control Socket.
[    1.881175] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
[    1.881638] systemd[1]: Starting Dispatch Password Requests to Console Directory Watch.
[  OK  ] Created slice System Slice.
[    1.883023] systemd[1]: Created slice System Slice.
[    1.883331] systemd[1]: Starting System Slice.
[  OK  ]istening on Journal Socket.
[    1.888381] systemd[1]: Starting Journal Socket.
[    1.889326] systemd[1]: Starting Create list of required static device nodes for the current kernel...
         Starting Create list of required st... nodes for the current kernel...
[    1.890612] systemd[1]: Started Load Kernel Modules.
[    1.891246] systemd[1]: Starting Apply Kernel Variables...
         Starting Apply Kernel Variables...
[  OK  ] Reached target Timers.
[    1.892494] systemd[1]: Reached target Timers.
[    1.892764] systemd[1]: Starting Timers.
[    1.893062] systemd[1]: Started dracut ask for additional cmdline parameters.
[    1.893823] systemd[1]: Starting dracut cmdline hook...
         Starting dracut cmdline hook...
[  OK  ] Reached target Paths.
[    1.900697] systemd[1]: Reached target Paths.
[    1.901561] systemd[1]: Starting Paths.
[  OK  ] Listening on Journal Audit Socket.
[    1.902635] systemd[1]: Listening on Journal Audit Socket.
[    1.902983] systemd[1]: Starting Journal Audit Socket.
[    1.903550] systemd[1]: Starting Journal Service...
         Starting Journal Service...
[  OK  ] Reached target Sockets.
[    1.911153] systemd[1]: Reached target Sockets.
[    1.911535] systemd[1]: Starting Sockets.
[  OK  ] Reached target Local File Systems.
[    1.918217] systemd[1]: Reached target Local File Systems.
[    1.918703] systemd[1]: Starting Local File Systems.
[  OK  ] Started Create list of required sta...ce nodes for the current kernel.
[    1.925022] systemd[1]: Started Create list of required static device nodes for the current kernel.
[    1.925622] audit: type=1130 audit(1442779277.594:2): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=kmod-static-nodes comm="systemd" exe="/usr/lib64/systemd/systemd" hostname=? addr=? terminal=? res=success'
[  OK  ] Started Apply Kernel Variables.
[    1.930002] systemd[1]: Started Apply Kernel Variables.
[    1.930328] audit: type=1130 audit(1442779277.599:3): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-sysctl comm="systemd" exe="/usr/lib64/systemd/systemd" hostname=? addr=? terminal=? res=success'
[  OK  ] Started Journal Service.
[    1.937614] systemd[1]: Started Journal Service.
[    1.937932] audit: type=1130 audit(1442779277.606:4): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-journald comm="systemd" exe="/usr/lib64/systemd/systemd" hostname=? addr=? terminal=? res=success'
         Starting Create Static Device Nodes in /dev...
[  OK [  OK  ] Started dracut cmdline hook.
[    1.970408] audit: type=1130 audit(1442779277.639:6): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=dracut-cmdline comm="systemd" exe="/usr/lib64/systemd/systemd" hostname=? addr=? terminal=? res=success'
         Starting dracut pre-udev hook...
[  OK  ] Started dracut pre-udev hook.
[    1.994078] audit: type=1130 audit(1442779277.663:7): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=dracut-pre-udev comm="systemd" exe="/usr/lib64/systemd/systemd" hostname=? addr=? terminal=? res=success'
         Starting udev Kernel Device Manager...
[  OK  ] Started udev Kernel Device Manager.
[    2.002701] audit: type=1130 audit(1442779277.671:8): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-udevd comm="systemd" exe="/usr/lib64/systemd/systemd" hostname=? addr=? terminal=? res=success'
         Starting dracut pre-trigger hook...
[  OK  ] Started dracut pre-trigger hook.
[    2.035705] audit: type=1130 audit(1442779277.704:9): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=dracut-pre-trigger comm="systemd" exe="/usr/lib64/systemd/systemd" hostname=? addr=? terminal=? res=success'
         Starting udev Coldplug all Devices...
[  OK  ] Started udev Coldplug all Devices.
[    2.061677] audit: type=1130 audit(1442779277.730:10): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-udev-trigger comm="systemd" exe="/usr/lib64/systemd/systemd" hostname=? addr=? terminal=? res=success'
         Starting dracut initqueue hook...
[  OK  ] Reached target System Initialization.
[  OK  ] Reached target Basic System.
[  OK  ] Started dracut initqueue hook.
         Starting dracut pre-mount hook...
[  OK  ] Reached target Remote File Systems (Pre).
[  OK  ] Reached target Remote File Systems.
[    2.095427] input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input0
[    2.095866] ACPI: Power Button [PWRF]
[  OK  ] Started dracut pre-mount hook.
         Mounting /sysroot...
[  OK  ] Mounted /sysroot.
         Mounting /sysroot/usr...
[    2.121072] loop: module loaded
[    2.123243] microcode: CPU0 sig=0x40661, pf=0x1, revision=0x0
[    2.126440] microcode: Microcode Update Driver: v2.00 <[email protected]>, Peter Oruba
[    2.130552] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[  OK  ] Mounted /sysroot/usr.
[  OK  ] Reached target Initrd Root File System.
         Starting Reload Configuration from the Real Root...
[    2.185547] AVX2 version of gcm_enc/dec engaged.
[    2.185949] AES CTR mode by8 optimization enabled
[  OK  ] Started Reload Configuration from the Real Root.
[  OK  ] Reached target Initrd File Systems.
[  OK  ] Reached target Initrd Default Target.
         Starting dracut pre-pivot and cleanup hook...
[    2.233266] alg: No test for __gcm-aes-aesni (__driver-gcm-aes-aesni)
[  OK  ] Started dracut pre-pivot and cleanup hook.
         Starting Cleaning Up and Shutting Down Daemons...
[  OK  ] Stopped Cleaning Up and Shutting Down Daemons.
[    2.252821] tsc: Refined TSC clocksource calibration: 2193.338 MHz
[    2.253197] clocksource tsc: mask: 0xffffffffffffffff max_cycles: 0x1f9d9da8ce1, max_idle_ns: 440795283791 ns
[  OK  ] Stopped dracut pre-pivot and cleanup hook.
         Stopping dracut pre-pivot and cleanup hook...
[  OK  ] Stopped target Remote File Systems.
[  OK  ] Stopped target Remote File Systems (Pre).
[  OK  ] Stopped dracut pre-mount hook.
         Stopping dracut pre-mount hook...
[  OK  ] Stopped dracut initqueue hook.
         Stopping dracut initqueue hook...
[  OK  ] Stopped target Initrd Default Target.
[  OK  ] Stopped target Basic System.
[  OK  ] Stopped target Slices.
[  OK  ] Stopped target Paths.
[  OK  ] Stopped target Sockets.
[  OK  ] Stopped target Timers.
[  OK  ] Stopped target System Initialization.
[  OK  ] Stopped target Local File Systems.
[  OK  ] Stopped target Encrypted Volumes.
[  OK  ] Stopped udev Coldplug all Devices.
         Stopping udev Coldplug all Devices...
[  OK  ] Stopped dracut pre-trigger hook.
         Stopping dracut pre-trigger hook...
         Stopping udev Kernel Device Manager...
[  OK  ] Stopped Apply Kernel Variables.
         Stopping Apply Kernel Variables...
[  OK  ] Stopped Create list of required sta...ce nodes for the current kernel.
         Stopping Create list of required st... nodes for the current kernel...
[  OK  ] Stopped target Swap.
[  OK  ] Stopped udev Kernel Device Manager.
[  OK  ] Stopped dracut pre-udev hook.
         Stopping dracut pre-udev hook...
[  OK  ] Stopped dracut cmdline hook.
         Stopping dracut cmdline hook...
[  OK  ] Closed udev Kernel Socket.
[  OK  ] Closed udev Control Socket.
         Starting Cleanup udevd DB...
[  OK  ] Started Cleanup udevd DB.
[  OK  ] Reached target Switch Root.
         Starting Switch Root...
[    2.296057] systemd-journald[88]: Received SIGTERM from PID 1 (systemd).

Welcome to CoreOS 766.3.0!

[  OK  ] Stopped Switch Root.
[  OK  ] Stopped Journal Service.
         Starting Journal Service...
[  OK  ] Created slice User and Session Slice.
[  OK  ] Created slice system-addon\x2drun.slice.
[  OK  ] Created slice system-addon\x2dconfig.slice.
         Mounting Temporary Directory...
         Starting Setup Virtual Console...
[  OK  ] Listening on udev Kernel Socket.
         Mounting External Media Directory...
[  OK  ] Listening on /dev/initctl Compatibility Named Pipe.
[  OK  ] Reached target Swap.
         Mounting POSIX Message Queue File System...
         Mounting Debug File System...
[  OK  ] Created slice system-system\x2dcloudinit.slice.
[  OK  ] Stopped target Switch Root.
[  OK  ] Stopped target Initrd Root File System.
         Starting Create list of required st... nodes for the current kernel...
[  OK  ] Listening on udev Control Socket.
         Starting Apply Kernel Variables...
[  OK  ] Listening on networkd rtnetlink socket.
[  OK  ] Created slice system-serial\x2dgetty.slice.
[  OK  ] Stopped target Initrd File Systems.
         Starting Create System Users...
         Starting Load/Save Random Seed...
[  OK  ] Reached target Local File Systems (Pre).
         Starting Rebuild Hardware Database...
         Mounting Huge Pages File System...
[  OK  ] Created slice system-getty.slice.
[  OK  ] Reached target Slices.
         Starting Rebuild Dynamic Linker Cache...
[  OK  ] Mounted Debug File System.
[  OK  ] Mounted POSIX Message Queue File System.
[  OK  ] Mounted Temporary Directory.
[  OK  ] Mounted External Media Directory.
[  OK  ] Mounted Huge Pages File System.
[  OK  ] Started Journal Service.
[  OK  ] Started Setup Virtual Console.
[  OK  ] Started Create list of required sta...ce nodes for the current kernel.
[  OK  ] Started Apply Kernel Variables.
[  OK  ] Started Load/Save Random Seed.
[  OK  ] Started Create System Users.
         Starting udev Kernel Device Manager...
         Starting Flush Journal to Persistent Storage...
[    2.566069] systemd-journald[355]: Received request to flush runtime journal from PID 1
[  OK  ] Started Flush Journal to Persistent Storage.
[  OK  ] Started udev Kernel Device Manager.
[  OK  ] Started Rebuild Dynamic Linker Cache.
[  OK  ] Started Rebuild Hardware Database.
         Starting udev Coldplug all Devices...
[  OK  ] Started udev Coldplug all Devices.
         Starting udev Wait for Complete Device Initialization...
[  OK  ] Found device /dev/ttyS0.
[  OK  ] Started udev Wait for Complete Device Initialization.
         Starting Activation of LVM2 logical volumes...
[  OK  ] Started Activation of LVM2 logical volumes.
[  OK  ] Reached target Encrypted Volumes.
         Starting Activation of LVM2 logical volumes...
[  OK  ] Started Activation of LVM2 logical volumes.
[  OK  ] Reached target Local File Systems.
         Starting Create missing system files...
         Starting Rebuild Journal Catalog...
         Starting Create Volatile Files and Directories...
         Starting Activation of LVM2 logical volumes...
[  OK  ] Started Rebuild Journal Catalog.
         Starting Update is Completed...
[  OK  ] Started Update is Completed.
[  OK  ] Started Create Volatile Files and Directories.
         Starting Update UTMP about System Boot/Shutdown...
         Starting Load Security Auditing Rules...
         Starting Network Time Synchronization...
         Starting Clean up broken links in /etc/ssl/certs...
[  OK  ] Started Update UTMP about System Boot/Shutdown.
[  OK  ] Started Network Time Synchronization.
[  OK  ] Reached target System Time Synchronized.
[  OK  ] Started Create missing system files.
[  OK  ] Started Activation of LVM2 logical volumes.
[  OK  ] Reached target Remote File Systems.
[  OK  ] Started Clean up broken links in /etc/ssl/certs.
[  OK  ] Started Load Security Auditing Rules.
[  OK  ] Reached target System Initialization.
[  OK  ] Listening on OpenSSH Server Socket.
[  OK  ] Listening on D-Bus System Message Bus Socket.
[  OK  ] Reached target Paths.
[  OK  ] Reached target Timers.
[  OK  ] Listening on rkt metadata service socket.
[  OK  ] Listening on Docker Socket for the API.
[  OK  ] Reached target Sockets.
[  OK  ] Reached target Basic System.
[  OK  ] Started Getty on tty1.
         Starting Getty on tty1...
         Starting Login Service...
         Starting Extend Filesystems...
         Starting Garbage Collection for rkt...
         Starting Generate /run/coreos/motd...
[  OK  ] Started Serial Getty on ttyS0.
         Starting Serial Getty on ttyS0...
[  OK  ] Reached target Login Prompts.
         Starting Generate sshd host keys...
[  OK  ] Started D-Bus System Message Bus.
         Starting D-Bus System Message Bus...
         Starting Network Service...
[  OK  ] Reached target Load system-provided cloud configs.
[  OK  ] Reached target Load user-provided cloud configs.
         Starting Install an ssh key from /proc/cmdline...
[  OK  ] Started Extend Filesystems.
[  OK  ] Started Install an ssh key from /proc/cmdline.
[  OK  ] Started Generate /run/coreos/motd.
[    3.258563] Switched to clocksource tsc
[  OK  ] Started Login Service.
[  OK  ] Started Network Service.
[  OK  ] Reached target Network.
         Starting Network Name Resolution...
[  OK  ] Started Network Name Resolution.
[  OK  ] Started Garbage Collection for rkt.
[  OK  ] Started Generate sshd host keys.
         Starting Generate /run/issue...
[  OK  ] Started Generate /run/issue.
[  OK  ] Reached target Multi-User System.


This is localhost (Linux x86_64 4.1.6-coreos-r1) 20:01:19
SSH host key: 3c:07:47:07:ef:28:8a:28:76:4d:3a:84:fb:d2:b4:65 (DSA)
SSH host key: a5:36:20:5f:2c:ad:92:34:22:de:e1:4d:ec:6d:74:65 (ED25519)
SSH host key: 7a:10:c5:0c:74:0c:7b:24:be:d3:43:0a:55:6f:f6:9b (RSA)

localhost login: core (automatic login)

CoreOS stable (766.3.0)
Update Strategy: No Reboots
Last login: Sun Sep 20 20:01:19 +0000 2015 on /dev/tty1.
core@localhost ~ $ lspci -v
core@localhost ~ $
@c4milo c4milo changed the title Using xhyve as a library in Go Using xhyve, as a library, from Go. PCI devices do not show up. Sep 20, 2015
@AntonioMeireles
Copy link
Member

@c4milo i looked before at tiborvass/xhyve-bindings and didn't hit that kind of trouble . (my isues were elsewhere - exit endpoints not go friendly - see tiborvass/xhyve-bindings#1). Will look at your code (presume it is https://github.com/hooklift/nnn) and report back :-)

@c4milo
Copy link
Member Author

c4milo commented Sep 21, 2015

I have a simplified version in my local environment. I will push it up for you.

@c4milo
Copy link
Member Author

c4milo commented Sep 21, 2015

@AntonioMeireles done. I wasn't aware of those bindings. I'm going to try them out. Thanks!

@c4milo
Copy link
Member Author

c4milo commented Sep 21, 2015

@AntonioMeireles, tiborvass bindings worked for me just fine. I wonder if by making the static library as opposed to embedded the C files is screwing something up.

@AntonioMeireles
Copy link
Member

humm... @c4milo probably. OTOH (and modulo bugs) your approach is way saner than tiborvass one. the main issue with the "atomic" way of tiborvass si that if an error happens in xhyve's side the exit/atexit there will be too strong for us and will stop anything working past it on our side (defers, go routines, whatever). you got around that issue by essentially doing all error handling in a granular way from our (golangs's) side, which at this stage imho is the right/sane thing to do.

@AntonioMeireles
Copy link
Member

also ... @c4milo if using an hardlinked xhyve isn't a req for you take a look at https://github.com/AntonioMeireles/coreos-xhyve (work in progress). lots of handy primitives there that may be handy for your use case...

@c4milo
Copy link
Member Author

c4milo commented Sep 21, 2015

@AntonioMeireles xhyve has exit calls everywhere, my approach has the same problem. I need to figure out a way of breaking the mevent_dispatch loop so that Go's runtime has a chance to clean things up. But that's a different problem and more doable.

also ... @c4milo if using an hardlinked xhyve isn't a req for you take a look at https://github.com/AntonioMeireles/coreos-xhyve (work in progress). lots of handy primitives there that may be handy for your use case.

Unfortunately it is a requirement :/

@c4milo
Copy link
Member Author

c4milo commented Sep 21, 2015

@AntonioMeireles I ended up doing something similar to tiborvass, emulated PCI devices show up correctly and in addition I'm also cleaning Go allocations and having Go calling os.Exit instead of xhyve. https://github.com/hooklift/xhyve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants