Giter Club home page Giter Club logo

blktap's Introduction

User-level Disk layer for XenServer

This repository contains the code which forms the User-level Disk layer for XenSever. It contains tools and software needed to hide different types of disks from the user, and helps giving a unique access from VM's point of view. The tools mainly help to verify and correct disk corruptions.

blktap's People

Contributors

andreil avatar andyhhp avatar bensimscitrix avatar chandrikas avatar citrix-openstack-jenkins-xx avatar cristiklein avatar cuinutanix avatar dns42 avatar edwintorok avatar franciozzy avatar gaborigloi avatar garykirkpatrick avatar germanop avatar jandryuk avatar jjd27 avatar johnelse avatar jonludlam avatar kostaslambda avatar letsboogey avatar mahantesh-ais avatar marksymsctx avatar martinjorge avatar nraynaud avatar pritha-srivastava avatar qinz0822 avatar rosslagerwall avatar stefanopanella avatar timsmithctx avatar wescoeur avatar zli 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

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

blktap's Issues

vhd-util check very slow

vhd-util check is very slow because of the double loop. We can create an array of sector ranges occupied by each extent and then sort it. We can then check for overlaps, so the whole process should take O(NlogN) time instead of O(N^2).

pause behavior

Pause requests are idempotent. If this is the expected behavior, it should be documented, otherwise an error should be returned.

Unable to compile blktap against latest stable kernel

Essentially I'm getting following compile time errors

td-req.c: In function 'guest_copy2':
td-req.c:359:18: error: 'struct gntdev_grant_copy_segment' has no member named 'iov'
gcopy_seg->iov.iov_base = tapreq->vma + (i << PAGE_SHIFT) + (blkif_seg->first_sect << SECTOR_SHIFT);
^
td-req.c:360:18: error: 'struct gntdev_grant_copy_segment' has no member named 'iov'
gcopy_seg->iov.iov_len = (blkif_seg->last_sect - blkif_seg->first_sect + 1) << SECTOR_SHIFT;
^
td-req.c:361:18: error: 'struct gntdev_grant_copy_segment' has no member named 'ref'
gcopy_seg->ref = blkif_seg->gref;
^
td-req.c:362:18: error: 'struct gntdev_grant_copy_segment' has no member named 'offset'
gcopy_seg->offset = blkif_seg->first_sect << SECTOR_SHIFT;
^
td-req.c:365:10: error: 'struct ioctl_gntdev_grant_copy' has no member named 'dir'
gcopy.dir = blkif_rq_wr(&tapreq->msg);
^
td-req.c:366:10: error: 'struct ioctl_gntdev_grant_copy' has no member named 'domid'
gcopy.domid = blkif->domid;

Environment -
[root@localhost blktap-3.2.0.xs1086]# rpm -qa | grep kernel | grep 4.16
kernel-devel-4.16.8-1.x86_64
kernel-headers-4.16.8-1.x86_64
kernel-4.16.8-1.x86_64

[root@localhost blktap-3.2.0.xs1086]# rpm -qa | grep xen
xe-guest-utilities-xenstore-7.0.0-24.x86_64
xen-dom0-libs-devel-4.6.1-2.1.0.851.31985.x86_64
xenserver-ddk-files-7.0.0-16.noarch
xen-hypervisor-4.6.1-2.1.0.851.31985.x86_64
xen-dom0-libs-4.6.1-2.1.0.851.31985.x86_64
xen-libs-devel-4.6.1-2.1.0.851.31985.x86_64
xenserver-release-7.0.0-125770c.96.x86_64
xen-devel-4.6.1-2.1.0.851.31985.x86_64
xen-libs-4.6.1-2.1.0.851.31985.x86_64

Kindly suggest a way ahead to make it compatible.

Wont compile on 3.9.1 with dkms on Debian

blktap does not build with dkms on debian sid with 3.9.1 kernal

DKMS make.log for blktap-2.0.91 for kernel 3.9-1-amd64 (x86_64)
Fr 7. Jun 21:08:00 UTC 2013
make: Entering directory /usr/src/linux-headers-3.9-1-amd64' CC [M] /var/lib/dkms/blktap/2.0.91/build/control.o In file included from /var/lib/dkms/blktap/2.0.91/build/control.c:30:0: /var/lib/dkms/blktap/2.0.91/build/blktap.h:75:41: warning: variably modified 'pending' at file scope [enabled by default] CC [M] /var/lib/dkms/blktap/2.0.91/build/ring.o In file included from /var/lib/dkms/blktap/2.0.91/build/ring.c:30:0: /var/lib/dkms/blktap/2.0.91/build/blktap.h:75:41: warning: variably modified 'pending' at file scope [enabled by default] /var/lib/dkms/blktap/2.0.91/build/ring.c: In function 'blktap_ring_map_request': /var/lib/dkms/blktap/2.0.91/build/ring.c:206:2: error: too few arguments to function 'do_mmap_pgoff' In file included from /usr/src/linux-headers-3.9-1- common/include/linux/pagemap.h:7:0, from /usr/src/linux-headers-3.9-1-common/include/linux/blkdev.h:13, from /var/lib/dkms/blktap/2.0.91/build/ring.c:27: /usr/src/linux-headers-3.9-1-common/include/linux/mm.h:1454:22: note: declared here /var/lib/dkms/blktap/2.0.91/build/ring.c: In function 'blktap_ring_mmap_request': /var/lib/dkms/blktap/2.0.91/build/ring.c:438:19: error: 'VM_RESERVED' undeclared (first use in this function) /var/lib/dkms/blktap/2.0.91/build/ring.c:438:19: note: each undeclared identifier is reported only once for each function it appears in /var/lib/dkms/blktap/2.0.91/build/ring.c: In function 'blktap_ring_mmap_sring': /var/lib/dkms/blktap/2.0.91/build/ring.c:474:19: error: 'VM_RESERVED' undeclared (first use in this function) make[3]: *** [/var/lib/dkms/blktap/2.0.91/build/ring.o] Error 1 make[2]: *** [_module_/var/lib/dkms/blktap/2.0.91/build] Error 2 make[1]: *** [sub-make] Fehler 2 make: *** [all] Fehler 2 make: Leaving directory/usr/src/linux-headers-3.9-1-amd64'

iops limit

Hi there!

Would it be possible to have an iops/rate limits and then expose it to the VBD object of XenServer? This is often a no-go for multi-tenant environnements because of that.

Any idea @chandrikas ?

What's the exact version?

Hi,

I just took over this package in Fedora, previous it's 2.0.90 maintained by @ke4qqq.

I just checked the VERSION file, saying that it's 3.0.0 now, but the git tags confuse me again, why it's 0.9.2?

Also libvhdio-2.0.90.so is still the present library in the tree. Shouldn't it be renamed to libvhdio-3.0.0.so?

I hope I can get an answer.

Thanks.

blktap build fails from xenserver/xenserver-build-env

How to reproduce :

[root@localhost ~]# ./run.py -p blktap
Launching docker with args ['docker', 'run', '-i', '-t', '-u', 'builder', '-e', 'PACKAGES=blktap', 'xenserver/xenserver-build-env', '/usr/local/bin/init-container.sh']
.
.
.

sh-4.2$ ls
local-SRPMs
sh-4.2$ cd local-SRPMs/
sh-4.2$ ls
blktap-3.7.0-1.0.src.rpm
sh-4.2$ rpmbuild --rebuild blktap-3.7.0-1.0.src.rpm
Installing blktap-3.7.0-1.0.src.rpm
.
.
/bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -D_GNU_SOURCE -I../include -Wall -Werror -DXC_WANT_COMPAT_EVTCHN_API -DXC_WANT_COMPAT_GNTTAB_API -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c -o tapdisk-control.lo tapdisk-control.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -D_GNU_SOURCE -I../include -Wall -Werror -DXC_WANT_COMPAT_EVTCHN_API -DXC_WANT_COMPAT_GNTTAB_API -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c tapdisk-control.c -fPIC -DPIC -o .libs/tapdisk-control.o
In file included from td-blkif.h:43:0,
from tapdisk-vbd.h:40,
from tapdisk-control.c:53:
td-req.h:37:24: fatal error: xen/gntdev.h: No such file or directory
#include <xen/gntdev.h>
^
compilation terminated.

###################

gntdev.h is present at path /usr/include/xen/sys/gntdev.h

Team work on getting blktap in recent kernel

Hi there!

We started to think about various changes on blktap, especially to achieve these goals:

  1. IO_uring support for faster IOPS (we already have a PoC)
  2. Faster integration/merge in recent Linux kernels
  3. Ideally, having it upstream Linux if possible at some point

Obviously, doing this together and going into the right direction after some architecture decision might be faster for everyone, deliver better perfs for both Citrix Hypervisor and XCP-ng. What do you think? Where you'd like to start?

Increase MAX_RING_PAGE_ORDER value

Hi, I have a issue concerning the ring size, I would like to modify the default value of MAX_RING_PAGE_ORDER to 4, in theory it's ok it's the max authorized value by the blkfront module.

#define MAX_RING_PAGE_ORDER 3

But I don't understand why I can't boot correctly:

xenbus_probe_frontend: Waiting for devices to initialise: 25s...20s...15s...10s...5s...0s...

Should I change something else? Or is there a bug in blktap when MAX_RING_PAGE_ORDER is equal to 4? Thank you!

memcmp() return value not checked correctly

In vhd-util-check.c, all calls to memcmp() check the return value without any comparison operator (eg. if (memcmp(...)) ). I'm not a C guru, but from what I've read memcmp() will return 0 if equal, and potentially any other value if not. Shouldn't these checks be something like if (memcmp(...) != 0)?

To support my thoughts, I'm testing this on a VHD which I have no reason to believe is corrupt and I'm getting an invalid cookie message.

libvhd.c compares the value to 0 everywhere except in vhd_validate_batmap_header(). That appears to be a bug too.

Am I missing something here?

Fix build on upstream kernels

It'd be great to have a configure script check whether the grant-copy interface is available or not so we don't need to have a branch for buildroot.

GCC 4.8

This is a comment I got on the Archlinux package for this git repo, reporting it here just in case:

changes in gcc 4.8 bring a warning for pointer access:
http://gcc.gnu.org/gcc-4.8/porting_to.html

This is triggered in the current setup; also another error indicating that optimization needs to be on when compiling.

  • I patched around this by using CFLAGS="-Wno-sizeof-pointer-memaccess -O" ./configure --prefix=/usr

But that is probably not going to be that neccesary in the coming weeks as there's a Debian bugreport about it, so someone has probably started talking to the git folks about it and they will either patch the source or ... similar. (I haven't actually loaded the kernel module yet, so I'm not going to recommend this solution just yet.)

tapdisk process in state 0x2

Hi,

I've seen failures to close blktap disks:

Sep 7 17:51:29.235595 xl: tap-err:tap_ctl_read_raw: failure reading data 0/544
Sep 7 17:51:29.235606 xl: tap-err:tap_ctl_send_and_receive: failed to receive 'close' message
Sep 7 17:51:29.235626 xl: [4274] libxl_blktap3.c:175:libxl__device_destroy_tapdisk:Failed to destroy tap device id 4163 minor 4
...
Sep 7 17:51:29.288949 tapdisk[4163]: ERROR: errno -32 at tapdisk_ctl_conn_send_event: close: failure sending message at offset 0/544

tap-ctl list shows processes lingering in state 0x2.

I was unable to repro under strace. This commit b6ef33c looks like what I was preparing to write. Are any details for CA-356508 available? Were close failures seen with lingering tapdisk processes?

Thanks.

nbd print event timeout

nbd prints "timeout N", this is the event ID, not an actual time out being hit, fix this misleading print

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.