Commit Graph

480 Commits

Author SHA1 Message Date
Richard Jones
08bed02515 Support QEMU watchdog device.
This adds simple support for configuring a guest with a QEMU/KVM
virtual hardware watchdog device.
2009-10-21 16:37:44 +01:00
Cole Robinson
4027461865 schema: Update network schema.
Make things a bit more readable, and properly handle forward mode 'route'.
2009-10-16 10:52:10 -04:00
Jim Fehlig
e391595890 Add ocfs2 to list of fs pool types
* src/conf/storage_conf.c src/conf/storage_conf.h: extend the enums
  and values
* docs/schemas/storagepool.rng: add to the list of storage pool type
  formats
2009-10-14 17:03:22 +02:00
Daniel Veillard
a56ec4515b Release of 0.7.2 2009-10-14 11:16:13 +02:00
Cole Robinson
be2cd079af schema: Update storage pool schema.
- mpath pools weren't listed
- scsi pools were missing an adapter section
- iscsi pools were missing an auth section
- Logical pools do not require a source name to be specified
2009-10-13 10:56:43 -04:00
Daniel Veillard
b8b260dde9 Add a target for libvirt.devhelp
* docs/Makefile.am: the lack of a target for devhelp/libvirt.devhelp
  broke 'make dist'
2009-10-13 16:19:57 +02:00
Mark McLoughlin
33948c6844 Fix schema to allow missing machine type
The domain/os/type element may have an arch specified without having
a machine variant specified. In fact, this is what python-virtinst
does when defining a guest.

* docs/schemas/domain.rng: allow missing machine type
2009-10-12 10:47:01 +01:00
Daniel P. Berrange
35b5f84c50 Remove some auto-generated files
Removes some auto-generated files still under version control.
It also moves the rule for generating NEWS into the Makefile.am
that's in the same directory as the output file to avoid confusion

* docs/libvirt-api.xml, docs/libvirt-refs.xml, NEWS: Remove
  auto-generated files from source control
* Makefile.am: Add rule for generating NEWS file
* docs/Makefile.am: Remove rule for generating NEWS file
2009-10-09 13:01:22 +01:00
Daniel P. Berrange
0d5600fd2f Pull connection handling code out of doTunnelMigrate
Simplify the doTunnelMigrate() method by pulling out the code
which opens/closes the virConnectPtr  object into a parent
method

* qemu/qemu_driver.c: Add doPeer2PeerMigrate which then calls
  doTunnelMigrate with dconn & dom_xml
2009-10-09 12:35:07 +01:00
Jamie Strandboge
624a7927f0 Documentation and examples for SVirt Apparmor driver
* docs/drvqemu.html.in: include documentation for AppArmor sVirt
  confinement
* examples/apparmor/TEMPLATE examples/apparmor/libvirt-qemu
  examples/apparmor/usr.lib.libvirt.virt-aa-helper
  examples/apparmor/usr.sbin.libvirtd: example templates and
  configuration files for SVirt Apparmor when using KVM/QEmu
2009-10-08 16:42:05 +02:00
Daniel P. Berrange
e46f6309d5 Fix rebuilding of devhelp files
The devhelp/ directory files depend on libvirt-api.xml being
uptodate, but automake always processes SUBDIRS before the
current directory. So devhelp would be built and then the
libvirt-api.xml re-build, invalidating the devhelp data again.

To fix this all the rules for devhelp are moved directly
into the docs/Makefile.am allowing make to see the global
dependancy chain and thus build things in the correct order

* docs/Makefile.am: Add rules for devhelp rebuild
* docs/devhelp/Makefile.am: Remove devhelp rebuild
* configure.in: Remove docs/devhelp/Makefile.am
2009-10-06 11:12:53 +01:00
Daniel P. Berrange
e2b8f981c4 Fix ordering of <exports> in API description file
* docs/apibuild.py: Make uniq() function sort keys before returning
  them to ensure consitent ordering of <exports> in XML file
2009-10-06 11:12:53 +01:00
Daniel P. Berrange
ea6bc1e8c6 Fix typo in Makefile.am breaking NEWS file generation
* docs/Makefile.am: Fix syntax error in NEWS rule, '$' should be '$$'
  to escape correctly
2009-10-02 12:02:36 +01:00
Chris Lalancette
6e16575a37 Tunnelled migration.
Implementation of tunnelled migration, using a Unix Domain Socket
on the qemu backend.  Note that this requires very new versions of
qemu (0.10.7 at least) in order to get the appropriate bugfixes.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2009-10-02 11:43:26 +02:00
Paolo Bonzini
36e0372986 Fix documentation and comment typos
Fix a few mispellings :-) of "successfully" and regenerate
docs/libvirt-*.xml.
* src/libvirt.c: Fix typos.
* src/secret/secret_driver.c: Fix typos.
* docs/libvirt-api.xml: Regenerate.
* docs/libvirt-refs.xml: Regenerate.
2009-10-01 16:42:40 +02:00
Daniel Veillard
8fc469b3d5 523639 Allows a <description> tag for domains
* docs/schemas/domain.rng: allow one <description> tag in the top level
  of the <domain> to store user information as text
* src/conf/domain_conf.c src/conf/domain_conf.h: extend the structure
  to store this text, grab it at parse time and save it back when
  present after <uuid>
2009-09-30 16:10:16 +02:00
Chris Lalancette
47c8709564 Fix up a few typos in the tree.
Signed-off-by: Chris Lalancette <clalance@redhat.com>
2009-09-30 14:05:24 +02:00
Matthias Bolte
14bf7270aa Fix apibuild.py warnings
Function comments for virStreamEvent{Add,Update,Remove}Callback() are
missing a trailing ':'. Therefore apibuild.py fails to parse the comment
and warns about the missing ':'.

* docs/libvirt-api.xml, docs/libvirt-refs.xml: updated by apibuild.py
* src/libvirt.c: add missing ':' in function comments
2009-09-30 13:41:28 +02:00
Daniel P. Berrange
182eba1bc6 Add public API definition for data stream handling
* include/libvirt/libvirt.h.in: Public API contract for
  virStreamPtr object
* src/libvirt_public.syms: Export data stream APIs
* src/libvirt_private.syms: Export internal helper APIs
* src/libvirt.c: Data stream API driver dispatch
* src/datatypes.h, src/datatypes.c: Internal helpers for virStreamPtr
  object
* src/driver.h: Define internal driver API for streams
* .x-sc_avoid_write: Ignore src/libvirt.c because it trips
  up on comments including write()
* python/Makefile.am: Add libvirt-override-virStream.py
* python/generator.py: Add rules for virStreamPtr class
* python/typewrappers.h, python/typewrappers.c: Wrapper
  for virStreamPtr
* docs/libvirt-api.xml, docs/libvirt-refs.xml: Regenerate
  with new APIs
2009-09-29 15:48:52 +01:00
Daniel P. Berrange
5486abfe4e Fix API doc extractor to stop munging comment formatting
The python method help docs are copied across from the C
funtion comments, but in the process all line breaks and
indentation was being lost. This made the resulting text
and code examples completely unreadable. Both the API
doc extractor and the python generator were destroying
whitespace & this fixes them to preserve it exactly.

* docs/apibuild.py: Preserve all whitespace when extracting
  function comments. Print function comment inside a <![CDATA[
  section to fully preserve all whitespace. Look for the
  word 'returns' to describe return values, instead of 'return'
  to avoid getting confused with code examples including the
  C 'return' statement.
* python/generator.py: Preserve all whitespace when printing
  function help docs
* src/libvirt.c: Change any return parameter indicated by
  'return' to be 'returns', to avoid confusing the API extractor
* docs/libvirt-api.xml: Re-build for fixed descriptions
2009-09-28 14:08:25 +01:00
Paolo Bonzini
738ee810b4 network: add 'bootp' and 'tftp' config
Currently, libvirtd will start a dnsmasq process for the virtual
network, but (aside from killing the dnsmasq process and replacing it),
there's no way to define tftp boot options.

This change introduces the appropriate tags to the dhcp configuration:

 <network>
   <name>default</name>
   <bridge name="virbr%d" />
   <forward/>
   <ip address="192.168.122.1" netmask="255.255.255.0">
     <tftp root="/var/lib/tftproot" />
     <dhcp>
       <range start="192.168.122.2" end="192.168.122.254" />
       <bootp file="pxeboot.img"/>
     </dhcp>
   </ip>
 </network>

When the attributes are present, these are passed to the
arguments to dnsmasq:

 dnsmasq [...] --enable-tftp --tftp-root /srv/tftp --dhcp-boot pxeboot.img
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^
                      from <tftp />                     from <bootp />

At present, only local tftp servers are supported (ie, dnsmasq runs as
the tftp server), but we could improve this in future by adding a
server= attribute.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

2009-09-21  Paolo Bonzini  <pbonzini@redhat.com>
            Jeremy Kerr  <jk@ozlabs.org>

	* docs/formatnetwork.html.in: Document new tags.
	* docs/formatnetwork.html: Regenerate.
	* docs/schemas/network.rng: Update.
	* src/network_conf.c (virNetworkDefFree): Free new fields.
	(virNetworkDHCPRangeDefParseXML): Parse <bootp>.
	(virNetworkIPParseXML): New, parsing <dhcp> and <tftp>.
	(virNetworkDefParseXML): Use virNetworkIPParseXML instead of
	virNetworkDHCPRangeDefParseXML.
	(virNetworkDefFormat): Pretty print new fields.
	* src/network_conf.h (struct _virNetworkDef): Add netboot fields.
	* src/network_driver.c (networkBuildDnsmasqArgv): Add
	TFTP and BOOTP arguments.

	* tests/Makefile.am (EXTRA_DIST): Add networkschemadata.
	* tests/networkschematest: Look in networkschemadata.
	* tests/networkschemadata/netboot-network.xml: New.
2009-09-23 09:47:10 +02:00
Dan Kenigsberg
27a1f781bc Fix a number of small typos 2009-09-22 12:55:39 +02:00
Florian Vichot
24e0171b86 add doc for graphic and video elements
* docs/formatdomain.html.in: explain the new syntax of the video and
  graphic elements in the domain XML
2009-09-22 10:32:14 +02:00
Daniel P. Berrange
13f59ad733 Move example XML files into examples/xml
* docs/storage/: Move to examples/xml/storage/
* docs/test*.xml: Move to examples/xml/test/
* docs/Makefile.am: Remove example XML files from dist
* Makefile.am: Add examples/xml to EXTRA_DIST
* tests/virshtest.c: Update for moved test XML
* libvirt.spec.in: Include example XML files as docs
* tests/int-overflow: UPdate for moved XML
2009-09-21 14:41:48 +01:00
Daniel P. Berrange
bde4589189 Remove all generated docs from source control
* docs/*.html, docs/devhelp/*.html, docs/html/*.html: Delete
* docs/.gitignore, docs/devhelp/.gitignore, docs/html/.gitignore:
  Ignore generated docs files
* docs/Makefile.am: Rebuild all HTML docs for 'all' target
  and include them in EXTRA_DIST and CLEANFILES
* docs/devhelp/Makefile.am: Include HTML in CLEANFILES
2009-09-21 14:41:47 +01:00
Daniel P. Berrange
1355e0552e Move all shared utility files to src/util/
* src/bridge.c, src/bridge.h, src/buf.c, src/buf.h, src/cgroup.c,
  src/cgroup.h, src/conf.c, src/conf.h, src/event.c, src/event.h,
  src/hash.c, src/hash.h, src/hostusb.c, src/hostusb.h,
  src/iptables.c, src/iptables.h, src/logging.c, src/logging.h,
  src/memory.c, src/memory.h, src/pci.c, src/pci.h, src/qparams.c,
  src/qparams.h, src/stats_linux.c, src/stats_linux.h,
  src/threads-pthread.c, src/threads-pthread.h, src/threads-win32.c,
  src/threads-win32.h, src/threads.c, src/threads.h, src/util.c,
  src/util.h, src/uuid.c, src/uuid.h, src/virterror.c,
  src/virterror_internal.h, src/xml.c, src/xml.h: Move all files
  into src/util/
* daemon/Makefile.am: Add -Isrc/util/ to build flags
* src/Makefile.am: Add -Isrc/util/ to build flags and update for
  moved files
* src/libvirt_private.syms: Export cgroup APIs since they're now
  in util rather than linking directly to drivers
* src/xen/xs_internal.c: Disable bogus virEventRemoveHandle call
  when built under PROXY
* proxy/Makefile.am: Update for changed file locations. Remove
  bogus build of event.c
* tools/Makefile.am, tests/Makefile.am: Add -Isrc/util/ to build flags
2009-09-21 14:41:47 +01:00
Daniel P. Berrange
3decd4f9f1 Make pki_check.sh into an installed & supported tool
* docs/pki_check.sh: Move to tool/virt-pki-validate.in and add
  in POD man page documentation
* tools/.gitignore: Ignore generated virt-pki-validate file
* tools/Makefile.am: Install & build virt-pki-validate and
  virt-pki-validate.1
* docs/remote.html, docs/remote.html.in: Refer to new tool
  name virt-pki-validate
* libvirt.spec.in, mingw32-libvirt.spec.in: Add virt-pki-validate
  and virt-pki-validate.1 to files list
2009-09-21 14:41:46 +01:00
Daniel P. Berrange
81c28325aa Remove obsolete files
* docs/Goals, RENAMES, mylibtool: Removed
2009-09-21 14:41:46 +01:00
Daniel P. Berrange
cebeba7bd7 Move docs/examples into examples/
* Makefile.am: Add examples/dominfo examples/domsuspend examples/python
  as SUBDIRS
* configure.in: Update AC_OUTPUT for new/old Makefiles
* docs/Makefile.am: Remove examples from SUBDIRS
* docs/examples/info1.c: Move to examples/dominfo/info1.c
* docs/examples/suspend.c: Move to examples/domsuspend/suspend.c
* docs/examples: Remove all remaining files
* docs/examples/python: Moved to examples/python/
* examples/dominfo/Makefile.am, examples/domsuspend/Makefile.am: New
  build files
* libvirt.spec.in: Update to take account of moved examples
2009-09-21 14:41:46 +01:00
Daniel P. Berrange
d6d528ca25 Remove unused images from docs/ directory
* 16favicon.png, Libxml2-Logo-90x34.gif, libvirHeader.png,
  libvirLogo.png, windows-cygwin-1.png, windows-cygwin-2.png,
  windows-cygwin-3.png: Remove unreferenced files
* Makefile.am: Remove deleted files from EXTRA_DIST
2009-09-21 14:41:45 +01:00
Daniel P. Berrange
7ff256ec98 Move virsh into tools/ directory
Move the virsh tool and its man page into the tools directory

* Makefile.am: Remove rules for virsh.1 man page
* virsh.1: Remove auto-generated file
* docs/Makefile.am: Remove rules for virsh.pod man page
* docs/virsh.pod: Move to tools/ directory
* src/Makefile.am, src/.gitignore: Remove rules for virsh
* src/console.c, src/console.h, src/*.ico, src/virsh_win_icon.rc,
  src/virsh.c: Move into tools/ directory
* tools/Makefile.am: Add rules for building virsh
* tools/.gitignore: Ignore virsh built files
* tests/virshtest.c, tests/int-overflow: Update for new
  virsh location
2009-09-21 14:41:45 +01:00
Jim Meyering
8110d304f4 doc: don't emit trailing blanks into generated and VC'd NEWS file
* docs/Makefile.am ($(top_builddir)/NEWS): Filter out trailing
white space.
2009-09-15 15:01:26 +02:00
Daniel Veillard
c4f6e80671 Release of libvirt 0.7.1
* configure.in docs/news.html.in libvirt.spec.in src/libvirt_public.syms:
  updates to new release
* NEWS docs/devhelp/libvirt-libvirt.html docs/html/libvirt-libvirt.html
  docs/libvirt-api.xml docs/libvirt-refs.xml docs/news.html
  include/libvirt/libvirt.h: regenerated
2009-09-15 14:24:51 +02:00
Daniel P. Berrange
6c02fa7bd9 Add UUID definition required by storage encryption import
* docs/schemas/storagevol.rng: storage encryption rules require
  that UUID type be defined
2009-09-14 21:09:49 +01:00
Daniel P. Berrange
fac3f4cd54 Remove accidentally added UUID re-definition in storage schema
* docs/schemas/storageencryption.rng: Remove UUID definition
  since its provided by the domain.rng/storagevol.rng schemas
  that import this
2009-09-14 19:11:13 +01:00
Daniel P. Berrange
e1d715ef7d Rebuild API docs 2009-09-14 17:49:37 +01:00
Daniel P. Berrange
67b2d5e0bf Make secrets RNG more strict
* docs/schemas/secret.rng: Require volume element to be an absolute
  path. Fix whitespace indentation
2009-09-14 17:49:37 +01:00
Daniel P. Berrange
47e7a258db Fix UUID handling in secrets/storage encryption APIs
Convert all the secret/storage encryption APIs / wire format to
handle UUIDs in raw format instead of non-canonical printable
format. Guarentees data format correctness.

* docs/schemas/storageencryption.rng: Make UUID mandatory for a secret
  and validate fully
* docs/schemas/secret.rng: Fully validate UUID
* include/libvirt/libvirt.h, include/libvirt/libvirt.h.in, Add
  virSecretLookupByUUID and virSecretGetUUID. Make
  virSecretGetUUIDString follow normal API design pattern
* python/generator.py: Skip generation of virSecretGetUUID,
  virSecretGetUUIDString and virSecretLookupByUUID
* python/libvir.c, python/libvirt-python-api.xml: Manual impl
  of virSecretGetUUID,virSecretGetUUIDString and virSecretLookupByUUID
* qemud/remote.c: s/virSecretLookupByUUIDString/virSecretLookupByUUID/
  Fix get_nonnull_secret/make_nonnull_secret to use unsigned char
* qemud/remote_protocol.x: Fix remote_nonnull_secret to use a
  remote_uuid instead of remote_nonnull_string for UUID field.
  Rename REMOTE_PROC_SECRET_LOOKUP_BY_UUID_STRING to
  REMOTE_PROC_SECRET_LOOKUP_BY_UUID_STRING and make it take an
  remote_uuid  value
* qemud/remote_dispatch_args.h, qemud/remote_dispatch_prototypes.h,
  qemud/remote_dispatch_ret.h, qemud/remote_dispatch_table.h,
  qemud/remote_protocol.c, qemud/remote_protocol.h: Re-generate
* src/datatypes.h, src/datatypes.c: Store UUID in raw format instead
  of printable. Change virGetSecret to use raw format UUID
* src/driver.h: Rename virDrvSecretLookupByUUIDString to
  virDrvSecretLookupByUUID and use raw format UUID
* src/libvirt.c: Add virSecretLookupByUUID and virSecretGetUUID
  and re-implement virSecretLookupByUUIDString and
  virSecretGetUUIDString in terms of those
* src/libvirt_public.syms: Add virSecretLookupByUUID and
  virSecretGetUUID
* src/remote_internal.c: Rename remoteSecretLookupByUUIDString
  to remoteSecretLookupByUUID. Fix typo in args for
  remoteSecretDefineXML impl. Use raw UUID format for
  get_nonnull_secret and make_nonnull_secret
* src/storage_encryption_conf.c, src/storage_encryption_conf.h:
  Storage UUID in raw format, and require it to be present in
  XML. Use UUID parser to validate.
* secret_conf.h, secret_conf.c: Generate a UUID if none is provided.
  Storage UUID in raw format.
* src/secret_driver.c: Adjust to deal with raw UUIDs. Save secrets
  in a filed with printable UUID, instead of base64 UUID.
* src/virsh.c: Adjust for changed public API contract of
  virSecretGetUUIDString.
* src/storage_Backend.c: DOn't undefine secret we just generated
  upon successful volume creation. Fix to handle raw UUIDs. Generate
  a non-clashing UUID
* src/qemu_driver.c: Change to use lookupByUUID instead of
  lookupByUUIDString
2009-09-14 17:48:29 +01:00
Miloslav Trmač
2db2c5a186 Add virsh commands for secrets APIs
* src/virsh.c: Add virsh commands.
* docs/virsh.pod, virsh.1: Update documentation.
2009-09-11 14:54:57 +01:00
Miloslav Trmač
78811ae572 Add <usage> to <secret> docs
* docs/formatsecret.html.in, docs/formatsecret.html: Document <usage
  type='volume'>, replacing stand-alone <volume>.
* docs/schemas/secret.rng: Update schema to require <usage
  type='volume'>
2009-09-10 15:30:47 +01:00
Mark McLoughlin
22d990f138 Add arm arch to capabilities schema
* docs/schemas/capabilities.rng: add arm and sort arches
2009-09-10 12:25:42 +01:00
Mark McLoughlin
e45b13d248 Update capabilities schema to allow multiple machines per domain
* docs/schemas/capabilities.rng: allow multiple machines per domain
  just like they are allowed for guests
2009-09-10 12:25:42 +01:00
Mark McLoughlin
db4137ba02 Add esx and tcp migration uri transports to capabilities schema
* docs/schemas/capabilities.rng: include esx and tcp uri_transport
2009-09-10 12:25:42 +01:00
Daniel P. Berrange
85d15b5143 Add support for setting disk drive serial numbers
* docs/schemas/domain.rng: Add <serial> element to disks
* src/domain_conf.h, src/domain_conf.c: XML parsing and
  formatting for disk serial numbers
* src/qemu_conf.c: Set serial number when launching guests
* tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared.args,
  tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared.xml: Add
  serial number to XML test
2009-09-03 13:53:34 +01:00
Daniel P. Berrange
d823a05aef Support configuration of huge pages in guests
Add option to domain XML for

     <memoryBacking>
        <hugepages/>
     </memoryBacking>

* configure.in: Add check for mntent.h
* qemud/libvirtd_qemu.aug, qemud/test_libvirtd_qemu.aug, src/qemu.conf
  Add 'hugetlbfs_mount' config parameter
* src/qemu_conf.c, src/qemu_conf.h: Check for -mem-path flag in QEMU,
  and pass it when hugepages are requested.
  Load hugetlbfs_mount config parameter, search for mount if not given.
* src/qemu_driver.c: Free hugetlbfs_mount/path parameter in driver shutdown.
  Create directory for QEMU hugepage usage, chowning if required.
* docs/formatdomain.html.in: Document memoryBacking/hugepages elements
* docs/schemas/domain.rng: Add memoryBacking/hugepages elements to schema
* src/util.c, src/util.h, src/libvirt_private.syms: Add virFileFindMountPoint
  helper API
* tests/qemuhelptest.c: Add -mem-path constants
* tests/qemuxml2argvtest.c, tests/qemuxml2xmltest.c: Add tests for hugepage
  handling
* tests/qemuxml2argvdata/qemuxml2argv-hugepages.xml,
  tests/qemuxml2argvdata/qemuxml2argv-hugepages.args: Data files for
  hugepage tests
2009-09-03 13:51:55 +01:00
Pritesh Kothari
6aa576cda7 Generic parsing support for video acceleration
* docs/schemas/domain.rng: augment the video model with an optional
  acceleration element with optional accel2d and accel3d flags
* src/domain_conf.c src/domain_conf.h: exten the virDomainVideoDef
  structure with an optional accel field, virDomainVideoAccelDefParseXML
  and virDomainVideoAccelDefFormat functions to parse and serialize
  the structure.
2009-09-03 10:29:35 +02:00
Miloslav Trmač
f340964dc9 Attach encryption information to virDomainDiskDef.
The XML allows <encryption format='unencrypted'/>, this implementation
canonicalizes the internal representation so that "disk->encryption" is
non-NULL iff encryption information is available.

A domain with partial encryption information can be defined,
completeness of the information is not verified.  The domain won't
start until the remaining information is added, of course.

* docs/formatdomain.html, docs/formatdomain.html.in: Document
  new encryption options for disks
* docs/schemas/domain.rng: Pull in storage encryption schema
  rules
* src/domain_conf.h, src/domain_conf.c: Wire up storage encryption
  XML parsing/formatting APIs
2009-09-01 18:36:53 +01:00
Miloslav Trmač
eda3af2488 Attach encryption information to virStorageVolDef.
The XML allows <encryption format='unencrypted'/>, this implementation
canonicalizes the internal representation so that "vol->encryption" is
non-NULL iff the volume is encrypted.

Note that partial encryption information (e.g. specifying an encryption
format, but not the key/passphrase) is valid, libvirt will automatically
choose value for the missing information during volume creation.  The
user can read the volume XML, and use the unmodified <encryption> tag in
future operations (without having to be able to understand) its contents.

* docs/formatstorage.html, docs/formatstorage.html.in: Document
  storage volume encryption options
* src/storage_conf.c, src/storage_conf.h: Hook up storage
  encryption XML handling
* tests/storagevolschemadata/vol-qcow2.xml: Test case for encryption
  schema changes
2009-09-01 18:27:38 +01:00
Miloslav Trmač
05b9b8fda3 Add volume encryption information handling.
Define an <encryption> tag specifying volume encryption format and
format-depenedent parameters (e.g. passphrase, cipher name, key
length, key).

Currently the only defined parameter is a reference to a "secret"
(passphrase/key) managed using the virSecret* API.

Only the qcow/qcow2 encryption format, and a "default" format used to
let libvirt choose the format during volume creation, is currently
supported.

This patch does not add any users; the <encryption> tag is added in
the following patches to both volumes (to support encrypted volume
creation) and domains.

* docs/*.html: Re-generate
* docs/formatstorageencryption.html.in, docs/sitemap.html.in:
  Add page describing storage encryption data format
* docs/schemas/Makefile.am, docs/schemas/storageencryption.rng:
  Add RNG schema for storage encryption format
* po/POTFILES.in: Add src/storage_encryption_conf.c
* src/libvirt_private.syms: Export virStorageEncryption* functions
* src/storage_encryption_conf.h, src/storage_encryption_conf.c: Internal
  helper APIs for dealing with storage encryption format
* libvirt.spec.in, mingw32-libvirt.spec.in: Add storageencryption.rng
  RNG schema
2009-09-01 18:27:28 +01:00
Miloslav Trmač
9dc3b99345 Secret manipulation API docs refresh & wire up python generator
Sample session:

>>> import libvirt
>>> c = libvirt.open('qemu:///session')

>>> c.listSecrets()
['12247729-47d2-a783-88ce-b329d4781cd3', 'reee', 'abc']

>>> s = c.secretDefineXML("<secret ephemeral='no' private='no'>\n<description>Something for use</description>\n<volume>/foo/bar</volume>\n</secret>\n")

>>> s.UUIDString()
'340c2dfb-811b-eda8-da9e-25ccd7bfd650'

>>> s.XMLDesc()
"<secret ephemeral='no' private='no'>\n  <uuid>340c2dfb-811b-eda8-da9e-25ccd7bfd650</uuid>\n  <description>Something for use</description>\n  <volume>/foo/bar</volume>\n</secret>\n"

>>> s.setValue('abc\0xx\xffx')
0

>>> s.value()
'abc\x00xx\xffx'

>>> s.undefine()
0

* python/generator.py: Add rules for virSecret APIs
* python/libvir.c, python/libvirt-python-api.xml: Manual impl of
  virSecretSetValue, virSecretGetValue$ and virConnectListSecrets APIs
* python/libvirt_wrap.h, python/types.c: Wrapper for virSecret objects
* docs/libvirt-api.xml, docs/libvirt-refs.xml,
  docs/html/libvirt-virterror.html, docs/html/libvirt-libvirt.html,
  docs/devhelp/libvirt-virterror.html, docs/devhelp/libvirt-libvirt.html:
  Re-generate with 'make api'
2009-09-01 18:27:06 +01:00