]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
Fix UUID handling in secrets/storage encryption APIs
authorDaniel P. Berrange <berrange@redhat.com>
Thu, 10 Sep 2009 16:44:12 +0000 (17:44 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Mon, 14 Sep 2009 16:48:29 +0000 (17:48 +0100)
commit47e7a258db425a14e4ae7562a4f1fb4e2a042c16
tree108ae68ca70ff470a8a695e1f7d5ff0bd9c7e4af
parentb22d935dbe097de342aa29114fa2a13614c9e7e2
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
29 files changed:
docs/schemas/secret.rng
docs/schemas/storageencryption.rng
include/libvirt/libvirt.h
include/libvirt/libvirt.h.in
python/generator.py
python/libvir.c
python/libvirt-python-api.xml
qemud/remote.c
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
qemud/remote_protocol.x
src/datatypes.c
src/datatypes.h
src/driver.h
src/libvirt.c
src/libvirt_public.syms
src/qemu_driver.c
src/remote_internal.c
src/secret_conf.c
src/secret_conf.h
src/secret_driver.c
src/storage_backend.c
src/storage_encryption_conf.c
src/storage_encryption_conf.h
src/virsh.c