]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
15 years agoRe-arrange python generator to make it clear what's auto-generated
Daniel P. Berrange [Wed, 16 Sep 2009 13:03:53 +0000 (14:03 +0100)]
Re-arrange python generator to make it clear what's auto-generated

* README: New file describing what each file is used for
* livvirt-override.c, libvirt-override.py, libvirt-override-api.xml,
  libvirt-override-virConnect.py: Manually written code overriding
  the generator
* typewrappers.c, typewrappers.h: Data type wrappers
* generator.py: Automatically pre-prend contents of libvirt-override.py
  to generated libvirt.py. Output into libvirt.py directly instead of
  libvirtclass.py. Don't generate libvirtclass.txt at all. Write C
  files into libvirt.c/.h directly
* Makefile.am: Remove rule for creating libvirt.py from libvirt-override.py
  and libvirtclass.py, since generator.py does it directly

15 years agoRemove obsolete files
Daniel P. Berrange [Wed, 16 Sep 2009 12:15:48 +0000 (13:15 +0100)]
Remove obsolete files

* docs/Goals, RENAMES, mylibtool: Removed

15 years agoMove docs/examples into examples/
Daniel P. Berrange [Wed, 16 Sep 2009 12:07:48 +0000 (13:07 +0100)]
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

15 years agoRemove unused images from docs/ directory
Daniel P. Berrange [Wed, 16 Sep 2009 11:43:17 +0000 (12:43 +0100)]
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

15 years agoRename daemon main code
Daniel P. Berrange [Wed, 16 Sep 2009 11:37:26 +0000 (12:37 +0100)]
Rename daemon main code

* daemon/qemud.c: Rename to daemon/libvirtd.c
* daemon/qemud.h: Rename to daemon/libvirtd.h
* daemon/Makefile.am, daemon/dispatch.h, daemon/mdns.c,
  daemon/remote.h: Update for renamed libvirtd.h file

15 years agoMove config files to align with driver sources
Daniel P. Berrange [Wed, 16 Sep 2009 11:31:13 +0000 (12:31 +0100)]
Move config files to align with driver sources

* daemon/default-network.xml: Move to src/network/default.xml
* daemon/libvirtd_qemu.aug, daemon/test_libvirtd_qemu.aug: Move
  to src/qemu/
* src/qemu.conf: Move to src/qemu/qemu.conf
* daemon/Makefile.am: Remove rules for default-nmetwork.xml and
  libvirtd_qemu.aug and test_libvirtd_qemu.aug. Fix typo in
  uninstall-local that would install polkit again.
* src/Makefile.am: Add rules for installing network/default.xml
  and the qemu/*.aug files. Add test case for QEMU augeas files.
  Add uninstall-local rule for files/directories created during
  install. Rename install-exec-local to install-data-local.
  Only install qemu.conf if WITH_QEMU is set.
* tests/networkschematest: Update for XML location move

15 years agoMove virsh into tools/ directory
Daniel P. Berrange [Wed, 16 Sep 2009 11:01:53 +0000 (12:01 +0100)]
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

15 years agoMove security drivers to src/security/
Daniel P. Berrange [Tue, 15 Sep 2009 18:06:37 +0000 (19:06 +0100)]
Move security drivers to src/security/

* src/Makefile.am, src/qemu/qemu_conf.h, src/qemu/qemu_driver.c,
  tests/seclabeltest.c: Adapt for changed paths
* src/security.c: Rename to src/security/security_driver.c
* src/security.h: Rename to src/security/security_driver.h
* src/security_selinux.c, src/security_selinux.h: Move to src/security/

15 years agoMove secret driver into src/secret/
Daniel P. Berrange [Tue, 15 Sep 2009 17:59:58 +0000 (18:59 +0100)]
Move secret driver into src/secret/

* daemon/qemud.c, src/Makefile.am: Adapt for changed paths
* src/secret_driver.c, src/secret_driver.h: Move to src/secret/

15 years agoMove netcf interface driver into src/interface/
Daniel P. Berrange [Tue, 15 Sep 2009 17:55:16 +0000 (18:55 +0100)]
Move netcf interface driver into src/interface/

* daemon/qemud.c, src/Makefile.am: Adapt for changed paths
* src/interface_driver.c: Rename to src/interface/netcf_driver.c
* src/interface_driver.h: Rename to src/interface/netcf_driver.h

15 years agoMove network driver into src/network
Daniel P. Berrange [Tue, 15 Sep 2009 17:52:58 +0000 (18:52 +0100)]
Move network driver into src/network

* daemon/qemud.c, src/Makefile.am: Adapt for changed paths
* src/network_driver.c: Rename to src/network/bridge_driver.c
* src/network_driver.h: Rename to src/network/bridge_driver.h

15 years agoMove remote driver to src/remote/
Daniel P. Berrange [Tue, 15 Sep 2009 17:47:05 +0000 (18:47 +0100)]
Move remote driver to src/remote/

* daemon/mdns.c: Remove bogus include
* daemon/qemud.c, src/Makefile.am, src/libvirt.c: Adapt for
  changed paths
* src/remote_internal.c: Rename to src/remote/remote_driver.c
* src/remote_internal.h: Rename to src/remote/remote_driver.h

15 years agoMove test driver into src/test/
Daniel P. Berrange [Tue, 15 Sep 2009 17:38:50 +0000 (18:38 +0100)]
Move test driver into src/test/

* src/Makefile.am, src/libvirt.c: Adjust for changed paths
* src/test.c: Rename to src/test/test_driver.c,
* src/test.h: Rename to src/test/test_driver.h

15 years agoMove node device drivers to src/node_device/
Daniel P. Berrange [Tue, 15 Sep 2009 17:30:17 +0000 (18:30 +0100)]
Move node device drivers to src/node_device/

* daemon/qemud.c, src/Makefile.am: Update for changed paths
* src/node_device*.{h,c}: Move to src/node_device/
* src/storage/storage_backend.c: Remove bogus import of node_device.c

15 years agoMove storage drivers into src/storage/
Daniel P. Berrange [Tue, 15 Sep 2009 16:55:05 +0000 (17:55 +0100)]
Move storage drivers into src/storage/

* daemon/qemud.c, src/Makefile.am: Adapt for changed paths
* src/storage*.c, src/storage/*.h, src/parthelpre.c: Move
  to src/storage/

15 years agoMove OpenVZ driver to src/openvz/
Daniel P. Berrange [Tue, 15 Sep 2009 16:32:56 +0000 (17:32 +0100)]
Move OpenVZ driver to src/openvz/

* src/openvz_conf.c, src/openvz_conf.h, src/openvz_driver.c,
  src/openvz_driver.h: Move to src/openvz/
* src/Makefile.am, src/libvirt.c: Adjust for changed paths

15 years agoMove UML driver to src/uml/
Daniel P. Berrange [Tue, 15 Sep 2009 16:25:30 +0000 (17:25 +0100)]
Move UML driver to src/uml/

* src/uml_conf.c, src/uml_conf.h, src/uml_driver.c,
  src/uml_driver.h: Move to src/uml/
* daemon/qemud.c, src/Makefile.am: Adjust for changed paths

15 years agoMove QEMU driver to src/qemu/
Daniel P. Berrange [Tue, 15 Sep 2009 16:14:43 +0000 (17:14 +0100)]
Move QEMU driver to src/qemu/

* src/qemu_conf.c, src/qemu_conf.h, src/qemu_driver.c,
  src/qemu_driver.h: Move to src/qemu/
* daemon/qemud.c, src/Makefile.am, tests/qemuargv2xmltest.c,
  tests/qemuhelptest.c, tests/qemuxml2argvtest.c,
  tests/qemuxml2xmltest.c: Adapt for changed paths

15 years agoMove LXC driver into src/lxc/
Daniel P. Berrange [Tue, 15 Sep 2009 16:03:01 +0000 (17:03 +0100)]
Move LXC driver into src/lxc/

* src/lxc_conf.c, src/lxc_conf.h, src/lxc_container.c,
  src/lxc_container.h, src/lxc_controller.c, src/lxc_driver.c,
  src/lxc_driver.h, src/veth.c, src/veth.h: Move to src/lxc/
* src/opennebula/one_driver.c: Remove bogus veth.h include
* src/Makefile.am: Adjust for lxc paths
* daemon/qemud.c: Adjust include for lxc

15 years agoMove xen driver code into src/xen/ directory
Daniel P. Berrange [Tue, 15 Sep 2009 15:38:33 +0000 (16:38 +0100)]
Move xen driver code into src/xen/ directory

* src/Makefile.am, src/proxy_internal.c, src/proxy_internal.h
  src/sexpr.c, src/sexpr.h, src/xen_unified.c, src/xen_unified.h,
  src/xen_internal.c, src/xen_internal.h, src/xen_inotify.c,
  src/xen_inotify.h, src/xend_internal.c, src/xend_internal.h,
  src/xm_internal.c, src/xm_internal.h, src/xs_internal.c,
  src/xs_internal.h: Move to src/xen/ directory
* proxy/Makefile.am, proxy/libvirt_proxy.c, src/Makefile.am,
  src/libvirt.c, tests/sexpr2xmltest.c, tests/statstest.c,
  tests/xencapstest.c, tests/xmconfigtest.c, tests/xml2sexprtest.c:
  Adapt to changed xen location
* src/stats_linux.h, src/stats_linux.c: Remove xen specific block
  stats APIs
* src/qemu_driver.c, src/uml_driver.c: Add missing sys/un.h include
  uncovered after change to stats_linux.h
* src/xen/block_stats.h, src/xen/block_stats.c: Add xen specific
  block stats APIs

15 years agoRename qemud/ directory to daemon/
Daniel P. Berrange [Tue, 15 Sep 2009 14:49:29 +0000 (15:49 +0100)]
Rename qemud/ directory to daemon/

* qemud/: Rename to daemon/
* Makefile.am, configure.in, src/Makefile.am, src/remote_internal.c,
  tests/Makefile.am, tests/eventtest.c: s/qemud/daemon/ where needed

15 years agoRefactor libvirt.spec to allow client-only builds
Daniel P. Berrange [Wed, 16 Sep 2009 15:02:38 +0000 (16:02 +0100)]
Refactor libvirt.spec to allow client-only builds

Some architectures in certain RHEL versions do not include any
hypervisors. Update the specfile to allow those to easily build
a remote client only version of libvirt. ie no libvirtd related
bits at all.

* qemud/Makefile.am: Always instal SASL config since its needed
  by client too
* libvirt.spec.in: Re-factor specfile conditionals to allow entire
  server side build to be disabled easily, eg a remote client only
  build. Make RHEL-5 do client only build for s390/ppc. Make RHEL-6
  do a client only build for all non-x86_64 archs. Enable LXC on
  RHEL-6. Enable all Fedora >= 6 features on RHEL-6 too. Add some
  more conditionals around dnsmasq/iptables/hal Requires tags.
  Add missing e2fsprogs-devel BR for RHEL-5 as workaround for broken
  parted. Fix the device mapper BR for RHEL-5. Add conditional rules
  for ESX build. Add conditional rules for SELinux + HAL builds.
  Fix a mistaken %{with_qemu} to be %{with_network} when setting
  up default network XML

15 years agoFix leak in PCI hostdev hot-unplug
Mark McLoughlin [Thu, 17 Sep 2009 14:32:45 +0000 (15:32 +0100)]
Fix leak in PCI hostdev hot-unplug

* src/qemu_driver.c: sync the hostdev hot-unplug code with the disk/net
  code.

15 years agoFix net/disk hot-unplug segfault
Mark McLoughlin [Thu, 17 Sep 2009 14:31:08 +0000 (15:31 +0100)]
Fix net/disk hot-unplug segfault

When we hot-unplug the last device, we're currently double-freeing
the device definition.

Reported by Martin Banas here:

  https://bugzilla.redhat.com/523953

* src/qemu_driver.c: fix double free

15 years agoESX add support for vmxnet3 virtual device
Shahar Klein [Wed, 16 Sep 2009 10:04:49 +0000 (12:04 +0200)]
ESX add support for vmxnet3 virtual device

* src/esx/esx_vmx.c: add it to the list of accepted devices when
  parsing the Ethernet section.

15 years agodoc: don't emit trailing blanks into generated and VC'd NEWS file
Jim Meyering [Tue, 15 Sep 2009 13:01:26 +0000 (15:01 +0200)]
doc: don't emit trailing blanks into generated and VC'd NEWS file

* docs/Makefile.am ($(top_builddir)/NEWS): Filter out trailing
white space.

15 years agoMore whitespace problems
Daniel Veillard [Tue, 15 Sep 2009 12:31:59 +0000 (14:31 +0200)]
More whitespace problems

15 years agoFix some last minute whitespace problems.
Daniel Veillard [Tue, 15 Sep 2009 12:30:55 +0000 (14:30 +0200)]
Fix some last minute whitespace problems.

15 years agoRelease of libvirt 0.7.1
Daniel Veillard [Tue, 15 Sep 2009 12:24:51 +0000 (14:24 +0200)]
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

15 years agoUpdate a number of localizations and regenerate
Daniel Veillard [Tue, 15 Sep 2009 11:59:13 +0000 (13:59 +0200)]
Update a number of localizations and regenerate

* as.po bn_IN.po de.po gu.po hi.po kn.po ko.po ml.po mr.po or.po pa.po
  pl.po ta.po te.po zh_CN.po got updated

15 years agoFix dlopen of secrets driver
Daniel P. Berrange [Tue, 15 Sep 2009 10:11:10 +0000 (11:11 +0100)]
Fix dlopen of secrets driver

* src/Makefile.am: Add gnulib.la for base64 functions
* src/libvirt_private.syms: Export virFileNameMatchesSuffix

15 years agoAdd UUID definition required by storage encryption import
Daniel P. Berrange [Mon, 14 Sep 2009 20:09:07 +0000 (21:09 +0100)]
Add UUID definition required by storage encryption import

* docs/schemas/storagevol.rng: storage encryption rules require
  that UUID type be defined

15 years agoRemove accidentally added UUID re-definition in storage schema
Daniel P. Berrange [Mon, 14 Sep 2009 18:11:13 +0000 (19:11 +0100)]
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

15 years agoRebuild API docs
Daniel P. Berrange [Fri, 11 Sep 2009 14:49:35 +0000 (15:49 +0100)]
Rebuild API docs

15 years agoMake secrets RNG more strict
Daniel P. Berrange [Fri, 11 Sep 2009 13:04:41 +0000 (14:04 +0100)]
Make secrets RNG more strict

* docs/schemas/secret.rng: Require volume element to be an absolute
  path. Fix whitespace indentation

15 years agoFill in secret UUID for qcow encryption
Daniel P. Berrange [Fri, 11 Sep 2009 13:13:45 +0000 (14:13 +0100)]
Fill in secret UUID for qcow encryption

* src/storage_backend_fs.c: Lookup & fill in secret passphrase UUID
  for storage volumes using encryption

15 years agoAdd usage type/id as a public API property of virSecret
Daniel P. Berrange [Fri, 11 Sep 2009 13:06:15 +0000 (14:06 +0100)]
Add usage type/id as a public API property of virSecret

* include/libvirt/libvirt.h, include/libvirt/libvirt.h.in: Add
  virSecretGetUsageType, virSecretGetUsageID and virLookupSecretByUsage
* python/generator.py: Mark virSecretGetUsageType, virSecretGetUsageID
  as not throwing exceptions
* qemud/remote.c: Implement dispatch for virLookupSecretByUsage
* qemud/remote_protocol.x: Add usage type & ID as attributes of
  remote_nonnull_secret. Add RPC calls for new public APIs
* 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.c, src/datatypes.h: Add usageType and usageID as
  properties of virSecretPtr
* src/driver.h: Add virLookupSecretByUsage driver entry point
* src/libvirt.c: Implement virSecretGetUsageType, virSecretGetUsageID
  and virLookupSecretByUsage
* src/libvirt_public.syms: Export virSecretGetUsageType, virSecretGetUsageID
  and virLookupSecretByUsage
* src/remote_internal.c: Implement virLookupSecretByUsage entry
* src/secret_conf.c, src/secret_conf.h: Remove the
  virSecretUsageType enum, now in public API. Make volume
  path mandatory when parsing XML
* src/secret_driver.c: Enforce usage uniqueness when defining secrets.
  Implement virSecretLookupByUsage api method
* src/virsh.c: Include usage for secret-list command

15 years agoFix UUID handling in secrets/storage encryption APIs
Daniel P. Berrange [Thu, 10 Sep 2009 16:44:12 +0000 (17:44 +0100)]
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

15 years agoVBox bug when starting machine from old versions
Pritesh Kothari [Mon, 14 Sep 2009 15:37:13 +0000 (17:37 +0200)]
VBox bug when starting machine from old versions

* src/vbox/vbox_tmpl.c: fix a bug where one can't start domains defined
  with older builds or with empty "FRONTEND/Type" tag in their xml
  files.

15 years agoSave vcpuinfo in status file
Daniel P. Berrange [Fri, 11 Sep 2009 15:26:40 +0000 (16:26 +0100)]
Save vcpuinfo in status file

* src/qemu_driver.c: Don't trust monitor for vcpu PID info on
  restart
* src/domain_conf.c: Save and load vCPU PID info from domain
  status file

15 years agoFix win32 platform build
Daniel P. Berrange [Mon, 14 Sep 2009 12:31:23 +0000 (13:31 +0100)]
Fix win32 platform build

* configure.in: Only define WITH_SECRETS if libvirtd is present
* src/Makefile.am: Only build secrets driver if WITH_SECRETS is
  defined. Always add SECRET_DRIVER_SOURCES to EXTRA_DIST

15 years agoRestart libvirtd upon RPM upgrade
Daniel P. Berrange [Fri, 11 Sep 2009 13:05:20 +0000 (14:05 +0100)]
Restart libvirtd upon RPM upgrade

* libvirt.spec.in: Restart libvirtd in %post

15 years agoESX cleanup of CPU model strings
Matthias Bolte [Mon, 14 Sep 2009 12:20:07 +0000 (14:20 +0200)]
ESX cleanup of CPU model strings

* src/esx/esx_driver.c: also strip (C) and (TM) from the CPU model
  strings

15 years agoESX avoid potential leaks
Matthias Bolte [Mon, 14 Sep 2009 10:44:33 +0000 (12:44 +0200)]
ESX avoid potential leaks

* src/esx/esx_driver.c: reorder some function calls to avoid potential
  virDomainPtr leaks

15 years agoVBox 3.0.6 API change support
Pritesh Kothari [Mon, 14 Sep 2009 10:10:10 +0000 (12:10 +0200)]
VBox 3.0.6 API change support

* src/vbox/vbox_CAPI_v3_0.h: this includes minor API changes for VBox
  3.0.6 released some days ago.

15 years agoAdd support for qcow encrypted volumes to qemu.
Miloslav Trmač [Tue, 21 Jul 2009 10:41:38 +0000 (12:41 +0200)]
Add support for qcow encrypted volumes to qemu.

Integrate with QEMU monitor to provide encryption passphrase when
starting a guest using encrypted qcow volumes

* src/qemu_driver.c (findDomainDiskEncryption,
  findVolumeQcowPassphrase,
  qemudMonitorSendVolumePassphrase, qemudMonitorSendCont): Send a volume
  passphrase if qemu asks for it.

15 years agoProvide missing passphrase when creating a volume.
Miloslav Trmač [Fri, 14 Aug 2009 18:06:59 +0000 (20:06 +0200)]
Provide missing passphrase when creating a volume.

If the <encryption format='qcow'> element does not specify a secret
during volume creation, generate a suitable secret and add it to the
<encryption> tag.  The caller can view the updated <encryption> tag
using virStorageVolGetXMLDesc().

Similarly, when <encryption format='default'/> is specified while
creating a qcow or qcow2-formatted volume, change the format to "qcow"
and generate a secret as described above.

* src/storage_encryption_conf.h (VIR_STORAGE_QCOW_PASSPHRASE_SIZE,
  virStorageGenerateQcowPasphrase),
  src/storage_encryption_conf.c (virStorageGenerateQcowPasphrase),
  src/libvirt_private.syms: Add virStorageGenerateQcowPasphrase().
* src/storage_backend.c (virStoragegenerateQcowEncryption,
  virStorageBackendCreateQemuImg): Generate a passphrase and
  <encryption> when creating a qcow-formatted encrypted volume and the
  user did not supply the information.

15 years agoAdd virsh commands for secrets APIs
Miloslav Trmač [Tue, 28 Jul 2009 10:27:25 +0000 (12:27 +0200)]
Add virsh commands for secrets APIs

* src/virsh.c: Add virsh commands.
* docs/virsh.pod, virsh.1: Update documentation.

15 years agoLocal file implementation of secret driver API
Miloslav Trmač [Fri, 14 Aug 2009 19:48:55 +0000 (21:48 +0200)]
Local file implementation of secret driver API

This implementation stores the secrets in an unencrypted text file,
for simplicity in implementation and debugging.

(Symmetric encryption, e.g. using gpgme, will not be difficult to add.
Because the TLS private key used by libvirtd is stored unencrypted,
encrypting the secrets file does not currently provide much additional
security.)

* include/libvirt/virterror.h, src/virterror.c (VIR_ERR_NO_SECRET): New
  error number.
* po/POTFILES.in, src/Makefile.am: Add secret_driver.
* bootstrap: Use gnulib's base64 module.
* src/secret_driver.c, src.secret_driver.h, src/libvirt_private.syms:
  Add local secret driver.
* qemud/qemud.c (qemudInitialize): Use the local secret driver.

15 years agoAdd an internal <secret> XML handling API
Miloslav Trmač [Tue, 1 Sep 2009 15:27:46 +0000 (17:27 +0200)]
Add an internal <secret> XML handling API

Add a <secret> XML handling API, separate from the local driver, to
avoid manually generating XML in other parts of libvirt.

* src/secret_conf.c, src/secret_conf.h: New files.
* po/POTFILES.in, src/Makefile.am: Add secret_conf.

15 years agoMask out flags used internally for virSecretGetValue
Miloslav Trmač [Fri, 14 Aug 2009 19:42:19 +0000 (21:42 +0200)]
Mask out flags used internally for virSecretGetValue

Add a VIR_SECRET_GET_VALUE_INTERNAL_CALL flag value, replacing the
originally separate libvirt_internal_call parameter.  The flag is used
to differentiate external virSecretGetValue() calls from internal calls
by libvirt drivers that need to use the secret even if it is private.

* src/libvirt_internal.h Remove VIR_DOMAIN_XML_FLAGS_MASK
* src/driver.h Add VIR_SECRET_GET_VALUE_FLAGS_MASK constant and
  VIR_SECRET_GET_VALUE_INTERNAL_CALL. Re-add the
  VIR_DOMAIN_XML_FLAGS_MASK constant
* src/libvirt.c (virSecretGetValue): Don't allow the user to specify
  internal flags.

15 years agoFix use of dlopen modules
Daniel P. Berrange [Thu, 10 Sep 2009 13:21:10 +0000 (14:21 +0100)]
Fix use of dlopen modules

Remove the bogus dependancy between node_device.c & storage_backend.c
by moving the virWaitForDevices into util.h where it can be shared
safely

* src/storage_backend_disk.c, src/storage_backend_logical.c,
  src/storage_backend_mpath.c, src/storage_backend_scsi.c: Replace
  virStorageBackendWaitForDevices with virFileWaitForDevices
* src/storage_backend.c, src/storage_backend.h: Remove
  virStorageBackendWaitForDevices, virWaitForDevices
* src/util.h, src/util.c: Add virFileWaitForDevices
* configure.in: Move xmlrpc check further down after pkgconfig
  is detected
* src/Makefile.am: Add missing XMLRPC_CFLAGS/LIBS to opennebula
* src/libvirt_private.syms: Add many missing exports

15 years agoConsolidate "cont" into qemudMonitorSendCont()
Miloslav Trmač [Tue, 21 Jul 2009 09:53:17 +0000 (11:53 +0200)]
Consolidate "cont" into qemudMonitorSendCont()

The interface allows qemudMonitorSendCont() to report errors that are
not overridden by its callers.

Also fix a potential infinite loop in qemuDomainCoreDump() if sending
cont repeatedly fails.

* src/qemu_driver.c (qemudMonitorSendCont): New function.
  (qemudAutostartConfigs): Reset error before each call to
  qemudStartVMDaemon().
  (qemudInitCpus, qemudDomainResume, qemudDomainCoreDump,
  qemudDomainRestore, qemudDomainMigratePerform,
  qemudDomainMigrateFinish2): Use qemudMonitorSendCont().

15 years agoAdd <usage> to <secret> docs
Miloslav Trmač [Tue, 1 Sep 2009 17:25:11 +0000 (19:25 +0200)]
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'>

15 years agoCleanup sec driver error reporting to use virReportSystemError
Daniel P. Berrange [Fri, 28 Aug 2009 17:44:43 +0000 (18:44 +0100)]
Cleanup sec driver error reporting to use virReportSystemError

* src/security_selinux.c: Use virReportSystemError whereever an
  errno is involved
* src/qemu_driver.c: Don't overwrite error message from the
  security driver

15 years agoSupport relabelling of USB and PCI devices
Daniel P. Berrange [Fri, 14 Aug 2009 13:23:11 +0000 (14:23 +0100)]
Support relabelling of USB and PCI devices

* src/security.h: Driver API for relabelling host devices
* src/security_selinux.c: Implement relabelling of PCI and USB
  devices
* src/qemu_driver.c: Relabel USB/PCI devices before hotplug

15 years agoPort QEMU driver to use USB/PCI device helpers
Daniel P. Berrange [Fri, 28 Aug 2009 12:44:43 +0000 (13:44 +0100)]
Port QEMU driver to use USB/PCI device helpers

* src/qemu_driver.c: Remove usbfs/sysfs iterator code and call
  into generic helper APIs instead when setting device permissions

15 years agoAdd helper APIs for iterating over PCI device resource files
Daniel P. Berrange [Fri, 14 Aug 2009 13:20:40 +0000 (14:20 +0100)]
Add helper APIs for iterating over PCI device resource files

* src/pci.h, src/pci.c: Helper for iterating over PCI device
  resource files
* src/libvirt_private.syms: Export pciDeviceFileIterate

15 years agoAdd helper module for dealing with USB host devices
Daniel P. Berrange [Fri, 14 Aug 2009 13:19:32 +0000 (14:19 +0100)]
Add helper module for dealing with USB host devices

* src/Makefile.am: Add usb.h and usb.h to libvirt_util.la
* src/libvirt_private.syms: Export symbols
* src/usb.c, src/usb.h: Helper APIs for USB host devices

15 years agoFix more OOM handling bugs
Daniel P. Berrange [Thu, 3 Sep 2009 16:37:45 +0000 (17:37 +0100)]
Fix more OOM handling bugs

* src/qemu_conf.c: Fix leak of values upon OOM
* src/xend_internal.c: Fix missing check for OOM failure
* tests/qemuargv2xmltest.c, tests/qemuxml2argvtest.c: Free
  stateDir upon exit to avoid leak

15 years agoFix logging buffer overrun read
Daniel P. Berrange [Thu, 3 Sep 2009 16:36:59 +0000 (17:36 +0100)]
Fix logging buffer overrun read

* src/logging.c: Fix buffer offset in logging read

15 years agoFix misc thread locking bugs / bogus warnings
Daniel P. Berrange [Wed, 2 Sep 2009 13:02:06 +0000 (14:02 +0100)]
Fix misc thread locking bugs / bogus warnings

Fix all thread locking bugs reported by object-locking test
case.

NB, some of the driver locking is getting too coarse. Driver
mutexes really need to be turned into RW locks instead to
significantly increase concurrency.

* src/lxc_driver.c: Fix useof driver when unlocked in the methods
  lxcDomainGetInfo, lxcSetSchedulerParameters, and
  lxcGetSchedulerParameters
* src/opennebula/one_driver.c: Fix missing unlock in oneDomainUndefine.
  Fix use of driver when unlocked in oneDomainGetInfo,
  oneGetOSType, oneDomainShutdown
* src/qemu_driver.c: Fix use of driver when unlocked in
  qemudDomainSavem, qemuGetSchedulerType, qemuSetSchedulerParameters
  and qemuGetSchedulerParameters
* src/storage_driver.c: Re-work storagePoolCreate to avoid bogus
  lock checking warning. Re-work storageVolumeCreateXMLFrom to
  remove a potential NULL de-reference & avoid bogus lock check
  warnings
* src/test.c: Remove testDomainAssignDef since it break lock chekc
  warnings.
* tests/object-locking.ml: Add oneDriverLock, oneDriverUnlock
  and one_driver_t methods/types to allow lock checking on the
   OpenNebula drivers

15 years agoTest that domain-specific qemu machine types are used correctly
Mark McLoughlin [Thu, 10 Sep 2009 10:22:32 +0000 (11:22 +0100)]
Test that domain-specific qemu machine types are used correctly

* tests/testutilsqemu.c: add a machine types list for /usr/bin/kvm
  which doesn't have any aliases, while the guest has aliases

* tests/qemuxml2argvdata/qemuxml2argv-machine-aliases2.*,
  tests/qemuxml2argvtest.c: add a test using /usr/bin/kvm and make
  sure that 'pc' machine type doesn't get canonicalized using the
  aliases in the guest machine type list

15 years agoSimplify and fix qemudCanonicalizeMachine()
Mark McLoughlin [Thu, 10 Sep 2009 11:19:33 +0000 (12:19 +0100)]
Simplify and fix qemudCanonicalizeMachine()

The algorithm is quite simple:

  If the emulator matches a guest's domain:
    if domain has machine type info:
      check the domain's machine type info
    else
      check the guest's default machine type info
  else if the emulator matches the guest's default emulator:
     check the guest's default machine type info

The previous implementation was incorrectly falling back to the default
machine type info if the domain's machine type info didn't have an
alias.

* src/qemu_driver.c: simplify and fix qemudCanonicalizeMachine()

15 years agoProbe machine types from kvm binary too
Mark McLoughlin [Mon, 7 Sep 2009 11:52:12 +0000 (12:52 +0100)]
Probe machine types from kvm binary too

Currently we only probe the main qemu binary for machine types, but we
should also probe the kvm binary.

* src/qemu_conf.c: probe kvm binary machines in qemudCapsInitGuest()

15 years agoLook up machine types from all domains in qemudGetOldMachines()
Mark McLoughlin [Mon, 7 Sep 2009 11:50:36 +0000 (12:50 +0100)]
Look up machine types from all domains in qemudGetOldMachines()

Rather than just looking at the default domain info, look at all
domains

* src/qemu_conf.c: look at all domains in qemudGetOldMachines()

15 years agoSplit up qemudGetOldMachines()
Mark McLoughlin [Mon, 7 Sep 2009 11:12:42 +0000 (12:12 +0100)]
Split up qemudGetOldMachines()

We need to look at all the domain infos in guest capabilities, not
just the defaults.

In order to allow that, split out a qemudGetOldMachinesFromInfo()
from qemudGetOldMachines(). We'll make more use of it in the next
patch.

* src/qemu_conf.c: split out qemudGetOldMachinesFromInfo() from
  qemudGetOldMachines()

15 years agoTest qemu machine aliases
Mark McLoughlin [Thu, 10 Sep 2009 10:19:12 +0000 (11:19 +0100)]
Test qemu machine aliases

* tests/testutilsqemu.c: make 'pc' an alias for qemu-system-x86_64

* tests/qemuxml2argvdata/qemuxml2argv-machine-aliases1.*,
  tests/qemuxml2argvtest.c: add a test which uses qemu-system-x86_64
  and make sure the machine type is canonicalized.

15 years agoRe-factor qemu test machine allocation code
Mark McLoughlin [Thu, 10 Sep 2009 09:16:27 +0000 (10:16 +0100)]
Re-factor qemu test machine allocation code

* test/testutilsqemu.c: split out code to testQemuAllocMachines()
  and make use of the ARRAY_CARDINALITY macro

15 years agoCanonicalize the qemu machine type in qemuxml2argvtest
Mark McLoughlin [Thu, 10 Sep 2009 10:09:06 +0000 (11:09 +0100)]
Canonicalize the qemu machine type in qemuxml2argvtest

This doesn't have any affect on the current tests because we don't have
any machine aliases in the current test data.

* src/qemu_conf.h, src/qemu_driver.c: expose qemudCanonicalizeMachine()
  for the tests

* tests/qemuxml2argvtest.c: canonicalize the machine type

15 years agoDump qemu driver capabilities if test debugging enabled
Mark McLoughlin [Thu, 10 Sep 2009 10:07:20 +0000 (11:07 +0100)]
Dump qemu driver capabilities if test debugging enabled

* src/testutils.[ch]: make testDebug externally available

* src/testutilsqemu.c: if VIR_TEST_DEBUG is set, dump the qemu
  driver capabilities to stderr

15 years agoFix formatting of machine types in capabilities XML
Mark McLoughlin [Mon, 7 Sep 2009 13:11:43 +0000 (14:11 +0100)]
Fix formatting of machine types in capabilities XML

* src/capabilities.c: fix machine type formatting in
  virCapabilitiesFormatXML()

15 years agoAdd qemu -help test data for qemu-kvm-0.11.0-rc2
Mark McLoughlin [Thu, 10 Sep 2009 08:36:13 +0000 (09:36 +0100)]
Add qemu -help test data for qemu-kvm-0.11.0-rc2

* tests/qemuhelpdata/qemu-kvm-0.11.0-rc2: add data

* tests/qemuhelptest.c: add expected output

15 years agoAdd a more featureful qemu capabilities test data
Mark McLoughlin [Thu, 10 Sep 2009 08:52:46 +0000 (09:52 +0100)]
Add a more featureful qemu capabilities test data

Things added include

  - x86_64 host
  - Migration features
  - NUMA topology
  - Security model
  - Canonical machine types
  - Domain machine types
  - An arm guest
  - More machine types for mips, mipsel, sparc and ppc
  - An x86_64 xenner guest

This file was generated on a Fedora 12 machine using latest libvirt
and qemu-kvm-0.11.0-rc2

* tests/capabilityschemadata/caps-qemu-kvm.xml: add more features
  to test

15 years agoAdd arm arch to capabilities schema
Mark McLoughlin [Thu, 10 Sep 2009 08:51:23 +0000 (09:51 +0100)]
Add arm arch to capabilities schema

* docs/schemas/capabilities.rng: add arm and sort arches

15 years agoUpdate capabilities schema to allow multiple machines per domain
Mark McLoughlin [Thu, 10 Sep 2009 08:47:57 +0000 (09:47 +0100)]
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

15 years agoAdd esx and tcp migration uri transports to capabilities schema
Mark McLoughlin [Thu, 10 Sep 2009 08:45:38 +0000 (09:45 +0100)]
Add esx and tcp migration uri transports to capabilities schema

* docs/schemas/capabilities.rng: include esx and tcp uri_transport

15 years agoFix regression from "Avoid polling on FDs with no events"
Chris Lalancette [Thu, 10 Sep 2009 09:36:35 +0000 (11:36 +0200)]
Fix regression from "Avoid polling on FDs with no events"

After the mentioned patch was applied, I noticed that
shutting down a kvm guest from inside (i.e. poweroff) caused
the guest to shutdown, but not removed from the list of
active guests.  DanB pointed out that the problem is that
the virEventAddHandle() call in the qemu driver was asking
to watch for 0 events, not HANGUP | ERROR as it should.  Add
these events so that shutdown works again.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoqemu_driver.c: factor out more duplication
Jim Meyering [Thu, 10 Sep 2009 09:26:00 +0000 (11:26 +0200)]
qemu_driver.c: factor out more duplication

* src/qemu_driver.c (qemudDomainRestore): Use the new ...TypeToString
function here, too.

15 years agoClose logfile fd after spawning qemu
Ryota Ozaki [Thu, 10 Sep 2009 09:34:14 +0000 (11:34 +0200)]
Close logfile fd after spawning qemu

* src/qemu_driver.c: avoid a leak of file descriptor when exec'ing qemu

15 years agoReintroduce support for lzop compression
Charles Duffy [Thu, 10 Sep 2009 09:13:33 +0000 (11:13 +0200)]
Reintroduce support for lzop compression

lzop was removed due to some confusion over whether it provided functional
advantages distinct from xz. This has been addressed in the mailing list post
archived at http://permalink.gmane.org/gmane.comp.emulators.libvirt/16487, and
support for lzop is re-added here.

* libvirt.spec.in: add dependancy on lzop
* src/qemu.conf: update documentation of save_image_format
* src/qemu_driver.c: re-add lzop compression option

15 years agoDeprecate lzma and lzop in favor of xz, add dep
Daniel Veillard [Wed, 9 Sep 2009 14:44:44 +0000 (16:44 +0200)]
Deprecate lzma and lzop in favor of xz, add dep

* src/qemu_driver.c: drop lzma and lzop images compression options
  as they are deprecated by xz
* libvirt.spec.in: add requires for xz/bzip2/gzip as they are needed
  to implement the compression options

15 years agoCheck for libssh2 >= 1.0 for phy driver
Maximilian Wilhelm [Wed, 9 Sep 2009 14:21:38 +0000 (16:21 +0200)]
Check for libssh2 >= 1.0 for phy driver

* configure.in: phyp driver uses libssh2_session_block_directions()
  which is only available in libssh2 >= 1.0, so check for this symbol
  too when configuring

15 years agoqemu_driver.c: factor out duplication in compression-type handling
Jim Meyering [Wed, 9 Sep 2009 08:10:38 +0000 (10:10 +0200)]
qemu_driver.c: factor out duplication in compression-type handling

* src/qemu_driver.c (QEMUD_SAVE_FORMAT_LAST): Define.
(qemudSaveCompressionTypeFromString): Declare.
(qemudSaveCompressionTypeToString): Declare.
(qemudDomainSave): Use those functions rather than open-coding them.
Use "cat >> '%s' ..." in place of equivalent
"dd of='%s' oflag=append conv=notrunc ...".

15 years agoalso allow use of XZ for Qemu image compression
Jim Meyering [Tue, 8 Sep 2009 18:52:37 +0000 (20:52 +0200)]
also allow use of XZ for Qemu image compression

* src/qemu_driver.c (enum qemud_save_formats) [QEMUD_SAVE_FORMAT_XZ]:
New member.
[QEMUD_SAVE_FORMAT_LZMA]: Mark as deprecated.
Use an explicit value for each member.
(qemudDomainSave, qemudDomainRestore): Handle the new member.
* src/qemu.conf: Mention xz, too.

15 years agoopenvz_conf.c: remove dead store to "p"; use strchrnul
Jim Meyering [Tue, 8 Sep 2009 09:07:32 +0000 (11:07 +0200)]
openvz_conf.c: remove dead store to "p"; use strchrnul

* src/openvz_conf.c (openvzReadNetworkConf): Replace open-coded
while loop with equivalent use of strchrnul.
* bootstrap (modules): Add strchrnul.

15 years agobuild: update gnulib submodule to latest
Jim Meyering [Tue, 8 Sep 2009 12:28:40 +0000 (14:28 +0200)]
build: update gnulib submodule to latest

15 years agoRemove some tabs used for indent
Daniel Veillard [Tue, 8 Sep 2009 15:32:57 +0000 (17:32 +0200)]
Remove some tabs used for indent

15 years agoAvoid another leak in src/xend_internal.c
Matthias Bolte [Tue, 8 Sep 2009 14:48:20 +0000 (16:48 +0200)]
Avoid another leak in src/xend_internal.c

* src/xend_internal.c: in xenDaemonLookupByID() if virGetDomain fails
  free up the name

15 years agoUpdated a number of localizations and regenerated
Daniel Veillard [Tue, 8 Sep 2009 14:14:08 +0000 (16:14 +0200)]
Updated a number of localizations and regenerated

15 years agoAdd flags and requires for Multipath storage
Daniel Veillard [Tue, 8 Sep 2009 14:07:54 +0000 (16:07 +0200)]
Add flags and requires for Multipath storage

* libvirt.spec.in: the new multipath module requires device-mapper
  and device-mapper-devel for build

15 years agoMultipath storage support module
Dave Allan [Tue, 8 Sep 2009 13:47:45 +0000 (15:47 +0200)]
Multipath storage support module

* configure.in src/Makefile.am src/storage_backend.[ch]
  src/storage_conf.[ch] src/storage_backend_mpath.[ch] po/POTFILES.in:
  add a new module for storage multipath, it requires device-mapper

15 years agoAvoid a leak in xenDaemonLookupByID
Matthias Bolte [Tue, 8 Sep 2009 12:42:10 +0000 (14:42 +0200)]
Avoid a leak in xenDaemonLookupByID

* src/xend_internal.c: free name in xenDaemonLookupByID() if
  virGetDomain() fails

15 years agoAdd a missing comment
Miloslav Trmač [Tue, 8 Sep 2009 11:33:35 +0000 (13:33 +0200)]
Add a missing comment

* src/libvirt_private.syms: Add a missing comment for
  storage_encryption_conf.h entries

15 years agoFix a pasto in storage_encryption_conf.c
Miloslav Trmač [Tue, 8 Sep 2009 11:30:45 +0000 (13:30 +0200)]
Fix a pasto in storage_encryption_conf.c

* src/storage_encryption_conf.c: small typo fix in top comment

15 years agoxm_internal.c: remove four useless comparisons after strchr
Jim Meyering [Mon, 7 Sep 2009 08:09:20 +0000 (10:09 +0200)]
xm_internal.c: remove four useless comparisons after strchr

* src/xm_internal.c (xenXMDomainConfigParse): After t=strchr...
don't test *t; it's known.  This was *not* detected by clang,
but I spotted it since once instance was in the vicinity of the
dead increment of "data".

15 years agoxm_internal.c: remove dead increment of "data"
Jim Meyering [Mon, 7 Sep 2009 08:03:22 +0000 (10:03 +0200)]
xm_internal.c: remove dead increment of "data"

* src/xm_internal.c (xenXMDomainConfigParse): Don't increment it.

15 years agonetwork_driver.c: remove dead store to "err"
Jim Meyering [Fri, 4 Sep 2009 17:37:37 +0000 (19:37 +0200)]
network_driver.c: remove dead store to "err"

* src/network_driver.c (networkSetAutostart): ...and its decl.

15 years agoiptables.c: remove dead store to "s"
Jim Meyering [Fri, 4 Sep 2009 17:36:17 +0000 (19:36 +0200)]
iptables.c: remove dead store to "s"

* src/iptables.c (iptablesAddRemoveRule): Remove dead store.

15 years agoutil.c: avoid dead store to "flag"
Jim Meyering [Fri, 4 Sep 2009 16:53:20 +0000 (18:53 +0200)]
util.c: avoid dead store to "flag"

* src/util.c (virExecDaemonize): Change flag |= VAR to "flag | VAR".