Date: Thu, 26 Jun 2014 02:14:08 +0000 (UTC) From: Marcel Moolenaar <marcel@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r267889 - user/marcel/mkimg Message-ID: <201406260214.s5Q2E8Fq083064@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: marcel Date: Thu Jun 26 02:14:08 2014 New Revision: 267889 URL: http://svnweb.freebsd.org/changeset/base/267889 Log: Add stubbed vhd.c for VHD support. Added: user/marcel/mkimg/vhd.c (contents, props changed) Modified: user/marcel/mkimg/Makefile Modified: user/marcel/mkimg/Makefile ============================================================================== --- user/marcel/mkimg/Makefile Thu Jun 26 01:10:53 2014 (r267888) +++ user/marcel/mkimg/Makefile Thu Jun 26 02:14:08 2014 (r267889) @@ -9,6 +9,7 @@ CFLAGS+=-DSPARSE_WRITE # List of formats to support SRCS+= \ raw.c \ + vhd.c \ vmdk.c # List of schemes to support Added: user/marcel/mkimg/vhd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/marcel/mkimg/vhd.c Thu Jun 26 02:14:08 2014 (r267889) @@ -0,0 +1,63 @@ +/*- + * Copyright (c) 2014 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + +#include <sys/types.h> +#include <sys/apm.h> +#include <sys/endian.h> +#include <sys/errno.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + +#include "image.h" +#include "format.h" +#include "mkimg.h" + +static int +vhd_resize(lba_t imgsz __unused) +{ + + return (0); +} + +static int +vhd_write(int fd) +{ + + return (image_copyout(fd)); +} + +static struct mkimg_format vhd_format = { + .name = "vhd", + .description = "Virtual Hard Disk", + .resize = vhd_resize, + .write = vhd_write, +}; + +FORMAT_DEFINE(vhd_format);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201406260214.s5Q2E8Fq083064>