dm-userspace xen kernel patch
A message that is not in the archive (sent off-list or not yet received): patchbomb.1156192193@venkman-64
PATCH 1/1 dm-userspace xen kernel patch
# HG changeset patch
# User Ryan Grimm <[email protected]>
# Date 1156190582 18000
# Node ID 9ebba79efbe99774c4063174ab569783017c7e78 # Parent 6a8204e4619d5bd182364b768b1ec2c8a43e8d15 dm-userspace xen kernel patch
buildconfigs/linux-defconfig_xen0_ia64 +1 -0
@@ -485,6 +485,7 @@ CONFIG_MD=y CONFIG_MD=y # CONFIG_BLK_DEV_MD is not set # CONFIG_BLK_DEV_DM is not set +CONFIG_DM_USERSPACE=n # # Fusion MPT device support
buildconfigs/linux-defconfig_xen0_x86_32 +1 -0
@@ -600,6 +600,7 @@ CONFIG_DM_MIRROR=y CONFIG_DM_MIRROR=y # CONFIG_DM_ZERO is not set # CONFIG_DM_MULTIPATH is not set +CONFIG_DM_USERSPACE=m # # Fusion MPT device support
buildconfigs/linux-defconfig_xen0_x86_64 +1 -0
@@ -552,6 +552,7 @@ CONFIG_DM_MIRROR=y # CONFIG_DM_ZERO is not set CONFIG_DM_MULTIPATH=y CONFIG_DM_MULTIPATH_EMC=y +CONFIG_DM_USERSPACE=m # # Fusion MPT device support
buildconfigs/linux-defconfig_xen_x86_32 +1 -0
@@ -1187,6 +1187,7 @@ CONFIG_DM_ZERO=m CONFIG_DM_ZERO=m CONFIG_DM_MULTIPATH=m CONFIG_DM_MULTIPATH_EMC=m +CONFIG_DM_USERSPACE=m # # Fusion MPT device support
buildconfigs/linux-defconfig_xen_x86_64 +1 -0
@@ -1130,6 +1130,7 @@ CONFIG_DM_ZERO=m CONFIG_DM_ZERO=m CONFIG_DM_MULTIPATH=m CONFIG_DM_MULTIPATH_EMC=m +CONFIG_DM_USERSPACE=m # # Fusion MPT device support
patches/linux-2.6.16.13/series +1 -0
@@ -1,5 +1,6 @@ blktap-aio-16_03_06.patch blktap-aio-16_03_06.patch device_bind.patch +dmu.patch fix-hz-suspend.patch fix-ide-cd-pio-mode.patch i386-mach-io-check-nmi.patch
patches/linux-2.6.16.13/dmu.patch new file +2591 -0
2,591 lines not on this page · raw message
PATCH 1/1 dm-userspace userspace tool base patch
In reply to a message not in the archive# HG changeset patch
# User Ryan Grimm <[email protected]>
# Date 1156190587 18000
# Node ID 53c5bcecfcfdb70cb3a2aed0adb564312988fbdd # Parent 9ebba79efbe99774c4063174ab569783017c7e78 dm-userspace userspace tool base patch
tools/Makefile +10 -0
@@ -31,6 +31,7 @@ all: check $(MAKE) -C $$subdir $@; \ done $(MAKE) ioemu + $(MAKE) cowd .PHONY: install install: check
@@ -38,6 +39,7 @@ install: check $(MAKE) -C $$subdir $@; \ done $(MAKE) ioemuinstall + $(MAKE) cowdinstall $(INSTALL_DIR) -p $(DESTDIR)/var/xen/dump .PHONY: clean
@@ -46,6 +48,7 @@ clean: check_clean $(MAKE) -C $$subdir $@; \ done $(MAKE) ioemuclean + $(MAKE) cowdclean .PHONY: distclean distclean: clean
@@ -71,3 +74,10 @@ ioemu ioemuinstall ioemuclean: ioemu ioemuinstall ioemuclean: endif +.PHONY: cowd cowdinstall cowclean +cowd/Makefile: + cd cowd && sh autogen && sh configure +cowd cowdinstall: cowd/Makefile + $(MAKE) -C cowd $(patsubst cowd%,%,$@) +cowdclean: + [ -f ./cowd/Makefile ] && $(MAKE) -C cowd clean || true
tools/cowd/Makefile.am new file +11 -0
@@ -0,0 +1,11 @@ +bin_PROGRAMS = cowd + +cowd_SOURCES = cowd.c util.c cowd_loader.c cowd_control_loop.c \ + cowd_plugin.h cowd.h cowd_loader.h cowd_ll.c cowd_ll.h +cowd_CFLAGS = -I/lib/modules/`uname -r`/build/include \ + -DDEFAULT_PLUGIN_DIR=\"@PLUGIN_DIR@\" @GLOBAL_CFLAGS@ +cowd_LDADD = -ldevmapper -lltdl +cowd_LDFLAGS = -rdynamic -L./lib + +clean-local: + rm -f *~
tools/cowd/README new file +68 -0
68 lines not on this page · raw message
tools/cowd/autogen new file +5 -0
@@ -0,0 +1,5 @@ +#!/bin/sh +libtoolize --force +aclocal +automake --add-missing --copy --foreign +autoconf
tools/cowd/configure.in new file +77 -0
77 lines not on this page · raw message
tools/cowd/cowd.c new file +453 -0
453 lines not on this page · raw message
tools/cowd/cowd.h new file +38 -0
@@ -0,0 +1,38 @@ +/* +* Copyright (C) International Business Machines Corp., 2006 +* Author: Dan Smith <[email protected]> +* +* This file is subject to the terms and conditions of the GNU Lesser +* General Public License. See the file COPYING in the main directory +* of this archive for more details. +* +*/ + +#ifndef __COWD_H +#define __COWD_H + +#include "cowd_ll.h" +#include <stdint.h> + +struct config_struct { +int verbose; +int debug; +int daemonize; +int init_device; +int init; +unsigned long block_size; +int sync_mode; +char *pidfile; +}; + +extern struct config_struct config; + +struct sync_blocks { +uint32_t id; +uint64_t block; +struct ll_member *member; +}; + +struct ll *sync_list; + +#endif
tools/cowd/cowd_control_loop.c new file +263 -0
263 lines not on this page · raw message
tools/cowd/cowd_ll.c new file +105 -0
105 lines not on this page · raw message
tools/cowd/cowd_ll.h new file +31 -0
@@ -0,0 +1,31 @@ +/* +* Copyright (C) International Business Machines Corp., 2006 +* Author: Ryan Grimm <[email protected]> +* +* This file is subject to the terms and conditions of the GNU Lesser +* General Public License. See the file COPYING in the main directory +* of this archive for more details. +* +*/ + +#ifndef __COWD_LL_H__ +#define __COWD_LL_H__ + +struct ll_member { +void *member_of; +struct ll *ll; +struct ll_member *next; +struct ll_member *prev; +}; + +struct ll { +struct ll_member *head; +struct ll_member *tail; +}; + + +int ll_init (struct ll **ll); +int ll_member_init (struct ll_member **member,void *member_of); +int ll_add_tail (struct ll *ll,struct ll_member *member); +int ll_remove (struct ll_member *member); +#endif
tools/cowd/cowd_loader.c new file +72 -0
72 lines not on this page · raw message
tools/cowd/cowd_loader.h new file +22 -0
@@ -0,0 +1,22 @@ +/* +* Copyright (C) International Business Machines Corp., 2006 +* Author: Dan Smith <[email protected]> +* +* This file is subject to the terms and conditions of the GNU Lesser +* General Public License. See the file COPYING in the main directory +* of this archive for more details. +* +*/ + +#ifndef __COWD_LOADER_H +#define __COWD_LOADER_H + +#include "cowd_plugin.h" + +#ifndef DEFAULT_PLUGIN_DIR +# define DEFAULT_PLUGIN_DIR "./lib" +#endif + +int load_plugin (struct cowd_plugin *plugin,char *name); + +#endif
tools/cowd/cowd_plugin.h new file +81 -0
81 lines not on this page · raw message
tools/cowd/util.c new file +236 -0
236 lines not on this page · raw message
PATCH 1/1 dm-userspace internal libdmu support for userspace tool
In reply to a message not in the archive# HG changeset patch
# User Ryan Grimm <[email protected]>
# Date 1156190589 18000
# Node ID a19a066dea764a70f06b4e4341229db92c2eb5c3 # Parent 53c5bcecfcfdb70cb3a2aed0adb564312988fbdd dm-userspace internal libdmu support for userspace tool
tools/Makefile +1 -1
@@ -76,7 +76,7 @@ endif .PHONY: cowd cowdinstall cowclean cowd/Makefile: - cd cowd && sh autogen && sh configure + cd cowd && sh autogen && sh configure --enable-internal-dmu cowd cowdinstall: cowd/Makefile $(MAKE) -C cowd $(patsubst cowd%,%,$@) cowdclean:
tools/cowd/Makefile.am +6 -0
@@ -1,3 +1,5 @@ bin_PROGRAMS = cowd +EXTRA_DIST = libdmu/dmu.c libdmu/dmu.h + bin_PROGRAMS = cowd cowd_SOURCES = cowd.c util.c cowd_loader.c cowd_control_loop.c \
@@ -7,5 +9,9 @@ cowd_LDADD = -ldevmapper -lltdl cowd_LDADD = -ldevmapper -lltdl cowd_LDFLAGS = -rdynamic -L./lib +if INTERNAL_DMU +cowd_SOURCES += libdmu/dmu.c +endif + clean-local: rm -f *~
tools/cowd/configure.in +27 -1
@@ -11,7 +11,19 @@ libdevmapper_error() { echo "* The version of libdevmapper on this system does *" echo "* not contain dm-userspace support *" echo "* *" + echo "* If you cannot reinstall libdevmapper, you can include *" + echo "* rough internal support with --enable-internal-dmu *" echo "*************************************************************" + + exit +} + +libdevmapper_conflict() { + echo "*************************************************************" + echo "* ERROR: The system libdevmapper library has dm-userspace *" + echo "* support, which cannot be used in combination with *" + echo "* internal support. *" + echo "*************************************************************" exit }
@@ -30,6 +42,13 @@ AC_ARG_ENABLE(gcov, COVERAGE="-fprofile-arcs -ftest-coverage", COVERAGE="") +AC_ARG_ENABLE(internal-dmu, + [AC_HELP_STRING([--enable-internal-dmu], + [Enable internal dm-user library support])], + need_internal_dmu="yes", + need_internal_dmu="") +AM_CONDITIONAL(INTERNAL_DMU, test x$need_internal_dmu = xyes) + # Checks for programs. AC_PROG_CC AC_PROG_LIBTOOL
@@ -37,7 +56,14 @@ AC_PROG_LIBTOOL # Checks for libraries. AC_CHECK_LIB([devmapper], [dm_task_create],, exit) AC_CHECK_LIB([ltdl], [lt_dlsym],, exit) -AC_CHECK_LIB([devmapper], [dmu_ctl_open],, libdevmapper_error) + +if test x$need_internal_dmu = xyes; then + AC_CHECK_LIB([devmapper], [dmu_ctl_open], libdevmapper_conflict) + abs_libdmu_dir=$(readlink -f .)/libdmu + GLOBAL_CFLAGS="$GLOBAL_CFLAGS -DINTERNAL_DMU -I$abs_libdmu_dir" +else + AC_CHECK_LIB([devmapper], [dmu_ctl_open],, libdevmapper_error) +fi if test -z "$COVERAGE"; then GLOBAL_CFLAGS="$GLOBAL_CFLAGS"
tools/cowd/cowd.c +4 -0
@@ -24,6 +24,10 @@#include <syslog.h> #include <libdevmapper.h> + +#ifdef INTERNAL_DMU +# include <dmu.h> +#endif #include "cowd.h" #include "cowd_plugin.h"
tools/cowd/libdmu/dmu.c new file +554 -0
554 lines not on this page · raw message
tools/cowd/libdmu/dmu.h new file +50 -0
50 lines not on this page · raw message
tools/cowd/libdmu/linux/dm-userspace.h new file +147 -0
147 lines not on this page · raw message
PATCH 1/1 dscow plugin for dm-userspace userspace tool
In reply to a message not in the archive# HG changeset patch
# User Ryan Grimm <[email protected]>
# Date 1156190589 18000
# Node ID 6a7ea5a3554309b4e37e3e8bcbd6a11b8cdc4386 # Parent a19a066dea764a70f06b4e4341229db92c2eb5c3 dscow plugin for dm-userspace userspace tool
tools/cowd/Makefile.am +2 -0
@@ -1,3 +1,5 @@ EXTRA_DIST = libdmu/dmu.c libdmu/dmu.h +SUBDIRS = plugins + EXTRA_DIST = libdmu/dmu.c libdmu/dmu.h bin_PROGRAMS = cowd
tools/cowd/configure.in +5 -1
@@ -93,11 +93,15 @@ AC_SUBST(PLUGIN_DIR) AC_SUBST(PLUGIN_DIR) AC_SUBST(GLOBAL_CFLAGS) -AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([Makefile + plugins/Makefile + plugins/dscow/Makefile]) # This just makes it easier to run cowd from the source directory # for testing mkdir -p lib +ln -sf ../plugins/dscow/.libs/libcowd_dscow.so.0 lib/libcowd_dscow.so +ln -sf ../plugins/dscow/.libs/libcowd_dscow.la lib/libcowd_dscow.la AC_OUTPUT
tools/cowd/cowd_control_loop.c +1 -0
@@ -1,6 +1,7 @@/* * Copyright (C) International Business Machines Corp., 2006 * Author: Dan Smith <[email protected]> +* Author: Ryan Grimm <[email protected]> * * This file is subject to the terms and conditions of the GNU Lesser * General Public License. See the file COPYING in the main directory
tools/cowd/plugins/Makefile.am new file +1 -0
@@ -0,0 +1,1 @@ +SUBDIRS = dscow
tools/cowd/plugins/dscow/Makefile.am new file +14 -0
@@ -0,0 +1,14 @@ +EXTRA_DIST = README + +lib_LTLIBRARIES = libcowd_dscow.la +libcowd_dscow_la_CFLAGS = -I../.. -I../../../../module @GLOBAL_CFLAGS@ +libcowd_dscow_la_SOURCES = dscow_ops.c dscow_plugin.c dscow_ops.h +libcowd_dscow_la_LIBADD = + +bin_PROGRAMS = dscow_tool +dscow_tool_SOURCES = dscow_tool.c dscow_ops.c ../../util.c +dscow_tool_CFLAGS = @GLOBAL_CFLAGS@ + +#noinst_PROGRAMS = dscow_test +#dscow_test_SOURCES = dscow_test.c dscow_ops.c +
tools/cowd/plugins/dscow/README new file +13 -0
@@ -0,0 +1,13 @@ +To create a dscow image, run "dscow_tool" as follows: + + # dscow_tool -c foo.dscow /path/to/base.img + +Which will create a "foo.dscow" file that uses '/path/to/base.img' as +its base and 64kb blocks. + +Then, start a cowd instance like this: + + # cowd -p dscow mydev /path/to/foo.dscow + +The base image will be loaded automatically. +
tools/cowd/plugins/dscow/dscow_ops.c new file +417 -0
417 lines not on this page · raw message
tools/cowd/plugins/dscow/dscow_ops.h new file +50 -0
50 lines not on this page · raw message
tools/cowd/plugins/dscow/dscow_plugin.c new file +206 -0
206 lines not on this page · raw message
tools/cowd/plugins/dscow/dscow_test.c new file +33 -0
@@ -0,0 +1,33 @@ +/* +* Copyright (C) International Business Machines Corp., 2006 +* Author: Dan Smith <[email protected]> +* +* This file is subject to the terms and conditions of the GNU Lesser +* General Public License. See the file COPYING in the main directory +* of this archive for more details. +* +*/ + +#include <stdio.h> +#include <stdint.h> + +#include "dscow_ops.h" + +int main (int argc,char **argv) +{ +struct dscow *h; +uint64_t i; + + h =dscow_create ("test.dscow" ,"test.base" ,512 ); + +for (i =0 ; i <1024 ; i+=2 ) { +dscow_map_block (h, i); + } + +for (i =0 ; i <1024 ; i++) { +if ((i%2 ) ==dscow_is_block_mapped (h, i)) +printf ("Error: %llu (%llu:%i)\n" , + i, i%2 ,dscow_is_block_mapped (h, i)); + } + +}
tools/cowd/plugins/dscow/dscow_tool.c new file +190 -0
190 lines not on this page · raw message
PATCH 1/1 qcow plugin for dm-userspace userspace tool
In reply to a message not in the archive# HG changeset patch
# User Ryan Grimm <[email protected]>
# Date 1156190590 18000
# Node ID 77a518e8f44d1c0c89dcb93e5a3713da6c5e6131 # Parent 6a7ea5a3554309b4e37e3e8bcbd6a11b8cdc4386 qcow plugin for dm-userspace userspace tool
tools/cowd/configure.in +2 -0
@@ -95,11 +95,13 @@ AC_SUBST(GLOBAL_CFLAGS) AC_CONFIG_FILES([Makefile plugins/Makefile + plugins/qcow/Makefile plugins/dscow/Makefile]) # This just makes it easier to run cowd from the source directory # for testing mkdir -p lib +ln -sf ../plugins/qcow/.libs/libcowd_qcow.so.0 lib/libcowd_qcow.so ln -sf ../plugins/dscow/.libs/libcowd_dscow.so.0 lib/libcowd_dscow.so ln -sf ../plugins/dscow/.libs/libcowd_dscow.la lib/libcowd_dscow.la
tools/cowd/plugins/Makefile.am +1 -1
@@ -1,1 +1,1 @@ SUBDIRS = dscow -SUBDIRS = dscow +SUBDIRS = dscow qcow
tools/cowd/plugins/qcow/Makefile.am new file +6 -0
@@ -0,0 +1,6 @@ +lib_LTLIBRARIES = libcowd_qcow.la +libcowd_qcow_la_CFLAGS = -I../.. -I../../../../module @GLOBAL_CFLAGS@ +libcowd_qcow_la_SOURCES = qcow_plugin.c qcow_ops.c qcow.h qcow_ops.h + +#noinst_PROGRAMS = qcow_test +#qcow_test_SOURCES = qcow_test.c qcow_ops.c ../../util.c
tools/cowd/plugins/qcow/qcow.h new file +167 -0
167 lines not on this page · raw message
tools/cowd/plugins/qcow/qcow_ops.c new file +603 -0
603 lines not on this page · raw message
tools/cowd/plugins/qcow/qcow_ops.h new file +15 -0
@@ -0,0 +1,15 @@ +#ifndef __QCOW_OPS_H +#define __QCOW_OPS_H + +#include <stdint.h> + +#include "qcow.h" + +int qcow_rw_header (int fd,struct qcow_header *header,int write); +int qcow_read_backing_info (struct qcow *qcow); +int qcow_read_l1_table (struct qcow *qcow); +uint64_t qcow_get_mapping (struct qcow *qcow,uint64_t logical); + +void qcow_print_header (struct qcow *qcow); + +#endif
tools/cowd/plugins/qcow/qcow_plugin.c new file +519 -0
519 lines not on this page · raw message
tools/cowd/plugins/qcow/qcow_test.c new file +74 -0
74 lines not on this page · raw message
PATCH 1/1 dm-userspace backend script and xmexample
In reply to a message not in the archive# HG changeset patch
# User Ryan Grimm <[email protected]>
# Date 1156190591 18000
# Node ID ac06ebd033aa5f62ff18cd1e21b21e19c67f04b9 # Parent 77a518e8f44d1c0c89dcb93e5a3713da6c5e6131 dm-userspace backend script and xmexample
tools/examples/Makefile +2 -0
@@ -18,6 +18,7 @@ XEN_CONFIGS += xmexample2 XEN_CONFIGS += xmexample2 XEN_CONFIGS += xmexample.hvm XEN_CONFIGS += xmexample.vti +XEN_CONFIGS += xmexample.dmu XEN_CONFIGS += xend-pci-quirks.sxp XEN_CONFIGS += xend-pci-permissive.sxp
@@ -32,6 +33,7 @@ XEN_SCRIPTS += vtpm vtpm-delete XEN_SCRIPTS += vtpm vtpm-delete XEN_SCRIPTS += xen-hotplug-cleanup XEN_SCRIPTS += external-device-migrate +XEN_SCRIPTS += block-dmu XEN_SCRIPT_DATA = xen-script-common.sh locking.sh logging.sh XEN_SCRIPT_DATA += xen-hotplug-common.sh xen-network-common.sh vif-common.sh XEN_SCRIPT_DATA += block-common.sh vtpm-common.sh vtpm-hotplug-common.sh
tools/examples/README +3 -0
@@ -13,6 +13,7 @@ block-common.sh - sourced by block, block-common.sh - sourced by block, block-* block-enbd - binds/unbinds network block devices block-nbd - binds/unbinds network block devices +block-dmu - binds/unbinds dm-userspace devices external-device-migrate - called by xend for migrating external devices locking.sh - locking functions to prevent concurrent access to critical sections inside script files
@@ -45,3 +46,5 @@ xmexample.hvm - a configuration sc xmexample.hvm - a configuration script for creating a hvm domain with 'xm create' xmexample.vti - a configuration script for creating a domain on vti +xmexample.dmu - a configuration script for creating a domain with + dm-userspace
tools/examples/block-dmu new file +49 -0
49 lines not on this page · raw message
tools/examples/xmexample.dmu new file +151 -0
151 lines not on this page · raw message
Re: [PATCH 6 of 6] dm-userspace backend script and xmexample
Here's the updated patch, just added to xmexample1 instead of a whole new example.
tools/examples/Makefile +1 -0
@@ -32,6 +32,7 @@ XEN_SCRIPTS += vtpm vtpm-delete XEN_SCRIPTS += vtpm vtpm-delete XEN_SCRIPTS += xen-hotplug-cleanup XEN_SCRIPTS += external-device-migrate +XEN_SCRIPTS += block-dmu XEN_SCRIPT_DATA = xen-script-common.sh locking.sh logging.sh XEN_SCRIPT_DATA += xen-hotplug-common.sh xen-network-common.sh vif-common.sh XEN_SCRIPT_DATA += block-common.sh vtpm-common.sh vtpm-hotplug-common.sh
tools/examples/README +1 -0
@@ -13,6 +13,7 @@ block-common.sh - sourced by block, block-common.sh - sourced by block, block-* block-enbd - binds/unbinds network block devices block-nbd - binds/unbinds network block devices +block-dmu - binds/unbinds dm-userspace devices external-device-migrate - called by xend for migrating external devices locking.sh - locking functions to prevent concurrent access to critical sections inside script files
tools/examples/xmexample1 +7 -0
@@ -64,6 +64,13 @@ vif = [ '' ] # and MODE is r for read-only, w for read-write. disk = [ 'phy:hda1,hda1,w' ] + +#---------------------------------------------------------------------------- +# Using a dm-userspace backed device +# for dmu, the syntax is dmu:<plugin>:<cow file>:<base file> +# if <cow file> does not exist, it is created and <base file> is used +# as a base. if <cow file> does exist, <base file> is ignored. +# disk = [ 'dmu:dscow:/path/to/domain.dscow:/path/to/domain.img,hda1,w'] #---------------------------------------------------------------------------- # Define to which TPM instance the user domain should communicate.
tools/examples/block-dmu new file +49 -0
49 lines not on this page · raw message
Signature · 3 lines
Thanks, Ryan Grimm IBM Linux Technology Center