From owner-svn-src-user@FreeBSD.ORG Thu Jun 26 02:14:08 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E4C1C1DC; Thu, 26 Jun 2014 02:14:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B87F12F50; Thu, 26 Jun 2014 02:14:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5Q2E8iT083066; Thu, 26 Jun 2014 02:14:08 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5Q2E8Fq083064; Thu, 26 Jun 2014 02:14:08 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201406260214.s5Q2E8Fq083064@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 26 Jun 2014 02:14:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r267889 - user/marcel/mkimg X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jun 2014 02:14:09 -0000 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 +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#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);