- Jun 01, 2015
-
-
Sasha Levin authored
Overview: 9p allows for simple RPC based resource sharing over different transports (in our case, virtio). This is the implementation of (most of) the original 9p2000 protocol, without the .u or the .l extensions. How to use: 1. Make sure kernel is compiled with: CONFIG_NET_9P=y CONFIG_NET_9P_VIRTIO=y CONFIG_NET_9P_DEBUG=y (At least until code is stable) CONFIG_9P_FS=y 2. Start KVM with '--virtio-9p <dirname>'. What happens now is that a virtio transport with the name 'kvm_9p' is created. The server side of the transport maps dirname to the root of the file system. 3. Within the guest, mount the fs: mount -t 9p -otrans=virtio kvm_9p <local_dir> -oversion=9p2000 This will mount the 9p server to local_dir. Signed-off-by:
Sasha Levin <levinsasha928@gmail.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Sasha Levin authored
Header could not be included directly because among some minor issues, the original header declared the same function twice: int p9_errstr2errno(char *errstr, int len); int p9_errstr2errno(char *, int); A patch has been sent to 9P maintainers, this header should be removed once the patch is in. Until then, use a modified copy of the header. Signed-off-by:
Sasha Levin <levinsasha928@gmail.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Amerigo Wang authored
'kvm run --help' works fine but 'kvm help run' shows nothing, this patch implements it. Acked-by:
Prasad Joshi <prasadjoshi124@gmail.com> Signed-off-by:
WANG Cong <amwang@redhat.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Sasha Levin authored
If user haven't specified cpu count for the guest, use the amount of online cpus on the host. Tested-by:
Asias He <asias.hejun@gmail.com> Signed-off-by:
Sasha Levin <levinsasha928@gmail.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Sasha Levin authored
When shutting down SMP guests only VCPU #0 will receive a KVM_EXIT_SHUTDOWN. Waiting for all VCPU threads to exit causes them to hang. Instead, notify all VCPU threads once VCPU #0 thread is terminated so they could also stop properly. Signed-off-by:
Sasha Levin <levinsasha928@gmail.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Cyrill Gorcunov authored
Thomas and Asias reported that kernel doesn't find MP tables on 32 bit host. This is because previously the alignment was done on address obtained from calloc missing the fact that MP tables are put into guest memory *with* offset and MP signature should be calculated keeping this offset in midn as well and then aligned. Reported-by:
Thomas Heil <heil@terminal-consulting.de> Reported-by:
Asias He <asias.hejun@gmail.com> Tested-by:
Thomas Heil <heil@terminal-consulting.de> Tested-by:
Asias He <asias.hejun@gmail.com> Signed-off-by:
Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Amerigo Wang authored
Don't link the rbtree.o from kernel object tree, build rbtree.o from source by ourselves. Acked-by:
Ingo Molnar <mingo@elte.hu> Reported-by:
Ingo Molnar <mingo@elte.hu> Signed-off-by:
WANG Cong <amwang@redhat.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Pekka Enberg authored
This patch moves hypervisor native hardware emulation drivers to "hw" directory like we've done for virtio and disk image code. Acked-by:
Cyrill Gorcunov <gorcunov@gmail.com> Acked-by:
Ingo Molnar <mingo@elte.hu> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Pekka Enberg authored
We recently changed the meaning of "-i" from disk image to initrd. This has confused many users because kvm just reports: Fatal: mmap() failed. if a disk image is passed as initrd. This patch fixes that by checking for the first two ID bytes in initrd: $ ./kvm run -i ~/images/linux-0.2.qcow # kvm run -k ../../arch/x86/boot/bzImage -m 256 -c 1 Fatal: /home/penberg/images/linux-0.2.qcow is not an initrd Reported-by:
Thomas Heil <heil@terminal-consulting.de> Suggested-by:
Ingo Molnar <mingo@elte.hu> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Cyrill Gorcunov authored
Thomas reported that on some systems there might be no bdf library installed. So we take perf approach and check for library presence at compilation time. Reported-by:
Thomas Heil <heil@terminal-consulting.de> Tested-by:
Thomas Heil <heil@terminal-consulting.de> Signed-off-by:
Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Cyrill Gorcunov authored
To look more familiar with kernel functions. Suggested-by:
Ingo Molnar <mingo@elte.hu> Signed-off-by:
Cyrill Gorcunov <gorcunov@gmail.com> Acked-by:
Ingo Molnar <mingo@elte.hu> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Pekka Enberg authored
This patch fixes cryptic "out of memory" errors on hosts where sysconf() fails by defaulting to MIN_RAM_SIZE_MB. Reported-by:
<born2befrag@gmail.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Asias He authored
Print debug info when we are in qcow1_nowrite_sector Signed-off-by:
Asias He <asias.hejun@gmail.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Asias He authored
Print debug info when read/write error occurs Signed-off-by:
Asias He <asias.hejun@gmail.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Asias He authored
Signed-off-by:
Asias He <asias.hejun@gmail.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Asias He authored
Let's do it in blkdev__probe. Signed-off-by:
Asias He <asias.hejun@gmail.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Asias He authored
This patch also adds some comments to disk/blk.c Signed-off-by:
Asias He <asias.hejun@gmail.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Asias He authored
This patch renames: raw_image__read_sector_ro_mmap to raw_image__read_sector raw_image__write_sector_ro_mmap to raw_image__write_sector raw_image__close_ro_mmap to raw_image__close Signed-off-by:
Asias He <asias.hejun@gmail.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Asias He authored
Make read/write ops in 'struct disk_image_operations' always return the number of bytes read/written and close/flush ops return int. Signed-off-by:
Asias He <asias.hejun@gmail.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Asias He authored
Signed-off-by:
Asias He <asias.hejun@gmail.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Asias He authored
This patch simplifies the disk image API. Signed-off-by:
Asias He <asias.hejun@gmail.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Asias He authored
These code are not used anymore. Let's remove it. Signed-off-by:
Asias He <asias.hejun@gmail.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Asias He authored
This patch renames disk_image__{read, write}_sector_io to disk_image__{read, write}. Signed-off-by:
Asias He <asias.hejun@gmail.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Asias He authored
This patch moves raw image and blk device code into disk/raw.c Signed-off-by:
Asias He <asias.hejun@gmail.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Asias He authored
This patch prepares the splitting of disk-image.c to core.c, blk.c and raw.c. Signed-off-by:
Asias He <asias.hejun@gmail.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Asias He authored
This patch removes disk-image.c and qcow.c under disk directory. Signed-off-by:
Asias He <asias.hejun@gmail.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Pekka Enberg authored
"bornto befrag <born2befrag@gmail.com>" writes: > When i compile i kvm native tool tools/kvm && make i get this > > CC read-write.o > cc1: warnings being treated as errors > read-write.c: In function ‘xpreadv’: > read-write.c:255: error: implicit declaration of function ‘preadv’ > read-write.c:255: error: nested extern declaration of ‘preadv’ > read-write.c: In function ‘xpwritev’: > read-write.c:268: error: implicit declaration of function ‘pwritev’ > read-write.c:268: error: nested extern declaration of ‘pwritev’ > make: *** [read-write.o] Error 1 Fix that up by including <sys/uio.h> for preadv()/pwritev(). Reported-by:
<born2befrag@gmail.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Sasha Levin authored
Instead of redefining virtio IDs in our headers, use IDs defined in <linux/virtio_ids.h>. Signed-off-by:
Sasha Levin <levinsasha928@gmail.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Sasha Levin authored
When we have a MMIO exit, we need to find which device has registered to use the accessed MMIO space. The mapper maps ranges of guest physical addresses to callback functions. Implementation is based on an interval red-black tree. Acked-by:
Ingo Molnar <mingo@elte.hu> Signed-off-by:
Sasha Levin <levinsasha928@gmail.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Sasha Levin authored
Interval rb-tree allows to directly store interval ranges and quickly lookup an overlap with a single point or a range. The helper is based on the kernel rb-tree implementation (located in <linux/rbtree.h>) which alows for the augmention of the classical rb-tree to be used as an interval tree. Acked-by:
Ingo Molnar <mingo@elte.hu> Signed-off-by:
Sasha Levin <levinsasha928@gmail.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Sasha Levin authored
Currently read/write IOV functions return an incorrect value instead of the amount of bytes read/written. This incorrect value may cause errors within the virtio layer. Return correct amount of bytes read/written from _iov functions. [ penberg@kernel.org: don't use 'inline' for out-of-line functions ] Signed-off-by:
Sasha Levin <levinsasha928@gmail.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Sasha Levin authored
'make check' will now try booting a kernel and will exit gracefully once the kernel has finished loading. Signed-off-by:
Sasha Levin <levinsasha928@gmail.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Prasad Joshi authored
The virtual machine calls 'sync' when the machine is halted. Adding the virtio flush feature will ensure that the data is synced on to disk before the virtual machine is halted. This is needed to ensure the intigrity of the data. Signed-off-by:
Prasad Joshi <prasadjoshi124@gmail.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Asias He authored
With this patch we can have -c --cpus -m --mem -d --disk -k --kernel -i --initrd which is more consistent and easy to remember. The patch also frees up -s, -g option. Ingo suggestied ''' The debug options should probably be concentrated under a --debug option anyway, to allow things like: --debug single-step,ioport Even if the debug options are kept they should be streamlined along the same pattern: >> --debug-single-step Enable single stepping >> --debug-ioport Enable ioport debugging But having a --debug option that recognizes all the debug flags would be nicer. It would also allow future enhancements to group debug features, like: --debug all # turn on everything and the kitchen sink for early hangs --debug all,-single-step # turn on everything except single-step debugging --debug nonverbose # turn on all non-noisy debug options we have Maybe even: --debug memcheck ... could run kvm under valgrind automatically - that way we can hide any secondary tool complexities from the user and turn those tools into simple debug options :-) ''' Let's do this --debug option consolidation later. Signed-off-by:
Asias He <asias.hejun@gmail.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Asias He authored
commit b764422bb0b46b00b896f6d4538ac3d3dde9e56b (kvm tools: Add support for multiple virtio-blk) removed the VIRTIO_BLK_F_SEG_MAX publishment to guest. There is no reason we should not support it. Just bring it back. Signed-off-by:
Asias He <asias.hejun@gmail.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Ingo Molnar authored
The tools/kvm build still fails on 32-bit: cc1: warnings being treated as errors qcow.c: In function ‘qcow1_write_sector’: qcow.c:307: error: comparison between signed and unsigned integer expressions make: *** [qcow.o] Error 1 make: *** Waiting for unfinished jobs.... using: gcc version 4.4.4 20100630 (Red Hat 4.4.4-10) (GCC) The patch below addresses them. Signed-off-by:
Ingo Molnar <mingo@elte.hu> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Ingo Molnar authored
I had a quick look at virtio/net.c and it still had quite many style inefficiencies - all of which are patterns which i pointed out before: - use short names for devices within the driver, so not 'net_device' but 'ndev' - everyone hacking net.c knows that this is the network driver so 'ndev' is a self-explanatory (and very short) term of art ... - use 'pci_header' instead of the ambiguous and misleading 'virtio_net_pci_device' naming. - do not repeat 'net' in struct net_device fields! So rename ndev->net_config to ndev->config. - In the kernel we generally use _lock names for mutexes. This is conceptually more generic. So rename the net device mutexes accordingly. - group #include lines in a topical way instead of a random mess - fix vertical alignment mismatches Signed-off-by:
Ingo Molnar <mingo@elte.hu> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Pekka Enberg authored
To make debugging easier, look up symbol from guest kernel image based on RIP when user does 'kill -3' to the hypervisor. Example output looks as follows: Code: ----- rip: [<ffffffff812cb3a0>] delay_loop+30 (/home/penberg/linux/arch/x86/lib/delay.c:32) Cc: Asias He <asias.hejun@gmail.com> Cc: Avi Kivity <avi@redhat.com> Cc: Cyrill Gorcunov <gorcunov@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Prasad Joshi <prasadjoshi124@gmail.com> Cc: Sasha Levin <levinsasha928@gmail.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Pekka Enberg authored
Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-
Pekka Enberg authored
If the user specifies a read-only image, make sure we never write to it. Booting to a read-only image looks like this now: $ ./kvm run -i ~/images/linux-0.2.qcow2,ro [ snip ] [ 1.250236] end_request: I/O error, dev vda, sector 32856 [ 1.252867] Buffer I/O error on device vda, logical block 16428 [ 1.255706] lost page write due to I/O error on vda [ 1.258120] EXT4-fs (vda): previous I/O error to superblock detected [ 1.261157] end_request: I/O error, dev vda, sector 2 [ 1.263333] Buffer I/O error on device vda, logical block 1 [ 1.264944] lost page write due to I/O error on vda [ 1.266139] EXT4-fs (vda): re-mounted. Opts: [ 1.284390] end_request: I/O error, dev vda, sector 35842 [ 1.285679] Buffer I/O error on device vda, logical block 17921 [ 1.287175] EXT4-fs warning (device vda): ext4_end_bio:259: I/O error writing to inode 3756 (offset 0 size 1024 starting block 17922) Reported-by:
Sasha Levin <levinsasha928@gmail.com> Cc: Asias He <asias.hejun@gmail.com> Cc: Avi Kivity <avi@redhat.com> Cc: Cyrill Gorcunov <gorcunov@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Prasad Joshi <prasadjoshi124@gmail.com> Cc: Sasha Levin <levinsasha928@gmail.com> Signed-off-by:
Pekka Enberg <penberg@kernel.org>
-