Sync with ^/head.
Add stubbed vhd.c for VHD support.
We don't need APM definitions here.
Add structure definitions for headers with related constants .
Implement vhd_resize(): we round to a multiple of the block size,
which is 4096 sectors per block or 2M bytes per block.
In vhd_write(), construct the footer and write it out. Next in line
is the dynamic header. After that, the block allocation table and
the actual blocks. It's for the blocks we need some infrastructure
support, because each data block is preceeded by a bitmap that tells
whether a sector in that block has been written, etc. The point is
that we interleave metadata with data and we don't have good support
functions for writing chunks of the image yet.
o   Avoid using strncpy(), as it will confuse Coverity. Use integrals for
    cookies and creator information. Just as meaningless; more cryptic.
o   Construct the dynamuc header and write it out.
Construct and write the BAT.
To allow testing of the code so far, scribble a bitmap before we write
the image. This won't work for images that need multiple blocks, because
each block starts with a sector bitmap, followed by 4096 sectors of user
data. But it works nicely for images that fit in a single block (and are
rounded to a block size.

With this commit, we can test if the Azura platform accepts our images.
Previous commit was premature in stating that we could test. The
file must have the footer at the end and we didn't write it yet.
With this commit we actually write the footer.
Let the testing begin.
Add image_copyout_region(). It allows a format to write chunks of
the image interleaved with metadata.
Add option -y for unit testing. When unit_testing is in effect, fields
that have different values for each run, such as UUIDs and timestamps,
will have a synthesized value. This allows us to compare images against
a known baseline without fails negatives.

Add mkimg_uuid() that wraps uuidgen() and provides synthesized values
for unit testing.
Use mkimg_uuid() instead of uuidgen().
Support unit testing:
o   use mkimg_uuid() instead of uuidgen().
o   Check unit_testing in vhd_timestamp() to synthesize a time.
Add vhd_geometry() to fill in the geometry in the footer. We respect
the command line arguments if possible, but otherwise implement the
algorithm from the specification.
Use image_copyout_region() to write 2MB of user data interleaved with
the block's sector bitmap. This should complete the support, modulo
bug fixing.
Remove old reference to IP_RSSCPUID.

Submitted by:	Eggert, Lars <lars@netapp.com>
Free the static DMA buffer holding the command ring during detach as well
as if attach fails.
Merge r267837 from ^/projects/release-debugdist:
  When building world when WITH_DEBUG_FILES is set,
  avoid building ar(1) archives with '-g'.

Tested on:	head@r267801
Reviewed by:	emaste, imp
Sponsored by:	The FreeBSD Foundation
Merge ^/projects/release-debugdist into ^/head:
r262491, r262493, r262516, r267345, r267397:

r262491:
  Add DEBUG_DISTRIBUTIONS, and set it to include base and
  EXTRA_DISTRIBUTIONS, excluding 'doc', since the documentation
  distribution does not have corresponding debug information.

  Use DEBUG_DISTRIBUTIONS in the 'distributeworld installworld'
  and 'packageworld' targets, to reduce the number of occurances
  of excluding distributions that do not have .debug files.

r262493:
  In release/Makefile, explicitly set WITHOUT_DEBUG_FILES=1
  for dvdrom and cdrom targets.  (Later reverted.)

  Exclude the *.debug.txz distributions from dvdrom and
  cdrom images, but include them for ftp distribution.

r262516:
  Rename ${dist}.debug.txz to ${dist}-dbg.txz to prevent the
  following output:
	eval: ${base....}: Bad substitution
	eval: ${doc....}: Bad substitution
	eval: ${games....}: Bad substitution
	eval: ${lib32....}: Bad substitution

  This also follows other naming conventions seen in the
  wild.

r267345:
  Explicitly set MK_DEBUG_FILES=no, which overrides the
  WITH_DEBUG_FILES=1 and WITHOUT_DEBUG_FILES=1 collisions
  previously experienced.

  This change allows us to create the {base,kernel}_debug.txz
  distributions without accidentally installing the *.debug
  files on the medium itself.

r267397:
  Remove evaluations of MK_DEBUG_FILES where not needed.
  If DEBUG_DISTRIBUTIONS is empty, which is true if
  MK_DEBUG_FILES evaluates to 'no' above, the loop does
  nothing.

MFC after:	1 month
Tested on:	head@r267801
Reviewed by:	brooks [1], emaste, imp [1]
		[1] earlier version
Sponsored by:	The FreeBSD Foundation
Convert bge(4) to use the driver API.

Submitted by:   Sreekanth Rupavatharam <rupavath@juniper.net>
Obtained from:  Juniper Networks, Inc.