dm-userspace xen kernel patch
A message that is not in the archive (sent off-list or not yet received): patchbomb.1156540578@venkman-64
PATCH 1/1 dm-userspace xen kernel patch
# HG changeset patch
# User Ryan Grimm <[email protected]>
# Date 1156521490 18000
# Node ID 2cb702dcea0e44dcfb9c243943d3e523245ad495 # Parent d5eb5205ff3588cc151fb15d6201c26c67e87506 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 1156536093 18000
# Node ID 7ca9885684d9eaeef4422d52f9ae9efd033650d0 # Parent 2cb702dcea0e44dcfb9c243943d3e523245ad495 dm-userspace userspace tool base patch
tools/Makefile +11 -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,11 @@ ioemu ioemuinstall ioemuclean: ioemu ioemuinstall ioemuclean: endif +.PHONY: cowd cowdinstall cowclean +cowd/Makefile: + -which libtoolize && which aclocal && which automake && \ + 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 +264 -0
264 lines not on this page · raw message
tools/cowd/cowd_ll.c new file +72 -0
72 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 1156536094 18000
# Node ID 8c8d5dc4eaf4f0044f7fdd5adb282359eff7263a # Parent 7ca9885684d9eaeef4422d52f9ae9efd033650d0 dm-userspace internal libdmu support for userspace tool
tools/Makefile +1 -1
@@ -77,7 +77,7 @@ endif .PHONY: cowd cowdinstall cowclean cowd/Makefile: -which libtoolize && which aclocal && which automake && \ - 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 +10 -0
@@ -1,3 +1,5 @@ bin_PROGRAMS = cowd +EXTRA_DIST = libdmu/dmu.c libdmu/dmu.h libdmu/internal_renames + bin_PROGRAMS = cowd cowd_SOURCES = cowd.c util.c cowd_loader.c cowd_control_loop.c \
@@ -7,5 +9,13 @@ cowd_LDADD = -ldevmapper -lltdl cowd_LDADD = -ldevmapper -lltdl cowd_LDFLAGS = -rdynamic -L./lib +if INTERNAL_DMU +cowd_SOURCES += libdmu/dmu.c +all-local: + for obj in cowd lib/*.so; do \ + objcopy --redefine-syms libdmu/internal_renames $$obj; \ + done +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 1 }
@@ -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/internal_renames new file +23 -0
@@ -0,0 +1,23 @@ +dmu_ctl_open int__dmu_ctl_open +dmu_clr_flag int__dmu_clr_flag +dmu_ctl_close int__dmu_ctl_close +dmu_ctl_queue_msg int__dmu_ctl_queue_msg +dmu_ctl_recv_queue int__dmu_ctl_recv_queue +dmu_ctl_send_queue int__dmu_ctl_send_queue +dmu_events_pending int__dmu_events_pending +dmu_invalidate_block int__dmu_invalidate_block +dmu_map_get_block int__dmu_map_get_block +dmu_map_get_id int__dmu_map_get_id +dmu_map_is_write int__dmu_map_is_write +dmu_map_set_block int__dmu_map_set_block +dmu_map_set_copy_src_dev int__dmu_map_set_copy_src_dev +dmu_map_set_dest_dev int__dmu_map_set_dest_dev +dmu_map_set_offset int__dmu_map_set_offset +dmu_map_set_sync int__dmu_map_set_sync +dmu_map_set_writable int__dmu_map_set_writable +dmu_process_events int__dmu_process_events +dmu_register_map_handler int__dmu_register_map_handler +dmu_register_status_handler int__dmu_register_status_handler +dmu_set_flag int__dmu_set_flag +dmu_split_dev int__dmu_split_dev +dmu_sync_complete int__dmu_sync_complete
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 1156536095 18000
# Node ID a3656acd770b4f21ad54fa961032ff39562058eb # Parent 8c8d5dc4eaf4f0044f7fdd5adb282359eff7263a 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 l +SUBDIRS = plugins + EXTRA_DIST = libdmu/dmu.c libdmu/dmu.h libdmu/internal_renames 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 +10 -0
@@ -0,0 +1,10 @@ +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@
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 +428 -0
428 lines not on this page · raw message
tools/cowd/plugins/dscow/dscow_ops.h new file +51 -0
51 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_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 1156536096 18000
# Node ID be4574d288030b64d4623dd33505d0990185a6b9 # Parent a3656acd770b4f21ad54fa961032ff39562058eb 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 +3 -0
@@ -0,0 +1,3 @@ +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
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
PATCH 1/1 dm-userspace backend script and xmexample change
In reply to a message not in the archive# HG changeset patch
# User Ryan Grimm <[email protected]>
# Date 1156536098 18000
# Node ID 55e3795e5bc46ea6a205e60ebf27ed9faf306616 # Parent be4574d288030b64d4623dd33505d0990185a6b9 dm-userspace backend script and xmexample change
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 +57 -0
57 lines not on this page · raw message