]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
15 years agoAdd a target for libvirt.devhelp
Daniel Veillard [Tue, 13 Oct 2009 14:19:57 +0000 (16:19 +0200)]
Add a target for libvirt.devhelp

* docs/Makefile.am: the lack of a target for devhelp/libvirt.devhelp
  broke 'make dist'

15 years agoFix a missing % on endif in spec file
Daniel Veillard [Tue, 13 Oct 2009 14:18:45 +0000 (16:18 +0200)]
Fix a missing % on endif in spec file

* libvirt.spec.in: missing % broke 'make rpm'

15 years agoTake domain type into account when looking up default machine
Mark McLoughlin [Mon, 12 Oct 2009 09:52:13 +0000 (10:52 +0100)]
Take domain type into account when looking up default machine

If one has e.g.

  <guest>
    <os_type>hvm</os_type>
    <arch name='x86_64'>
      <wordsize>64</wordsize>
      <emulator>/usr/bin/qemu-system-x86_64</emulator>
      <machine>pc-0.11</machine>
      <machine canonical='pc-0.11'>pc</machine>
      <machine>pc-0.10</machine>
      <machine>isapc</machine>
      <domain type='qemu'>
      </domain>
      <domain type='kvm'>
        <emulator>/usr/bin/kvm</emulator>
        <machine>pc</machine>
        <machine>isapc</machine>
      </domain>
    </arch>
  </guest>

and start a guest with:

  <domain type='kvm'>
    ...
    <os>
      <type arch='x86_64'>hvm</type>
      ...
    </os>
  </domain>

then the default machine type should be 'pc' and not 'pc-0.11'

Issue was reported by Anton Protopopov.

* src/capabilities.[ch]: pass the domain type to
  virCapabilitiesDefaultGuestArch() and use it to look up the default
  machine type from a specific guest domain if needed.

* src/conf/domain_conf.c, src/xen/xm_internal.c: update

* tests/qemuxml2argvdata/qemuxml2argv-machine-aliases2.xml: update
  the domain type to 'kvm' and remove the machine type to check
  that the default gets looked up correctly

15 years agoFix schema to allow missing machine type
Mark McLoughlin [Mon, 12 Oct 2009 09:47:01 +0000 (10:47 +0100)]
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

15 years agoRewrite example domain events programm for python
Daniel P. Berrange [Fri, 9 Oct 2009 12:05:10 +0000 (13:05 +0100)]
Rewrite example domain events programm for python

The existing python demo for domain events does not fully
implement the event loop contract. This makes the code useless
for real world applications. This change re-writes the demo so
that it has a full event loop implementation which is suitable
for application usage & better demonstrates integration

* examples/domain-events/events-python/event-test.py: Rewrite
  to include a real world usable event loop implementation

15 years agoRemove some auto-generated files
Daniel P. Berrange [Wed, 7 Oct 2009 10:15:45 +0000 (11:15 +0100)]
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

15 years agoSupport a new peer-to-peer migration mode & public API
Daniel P. Berrange [Thu, 17 Sep 2009 17:10:04 +0000 (18:10 +0100)]
Support a new peer-to-peer migration mode & public API

Introduces several new public API options for migration

 - VIR_MIGRATE_PEER2PEER: With this flag the client only
   invokes the virDomainMigratePerform method, expecting
   the source host driver to do whatever is required to
   complete the entire migration process.
 - VIR_MIGRATE_TUNNELLED: With this flag the actual data
   for migration will be tunnelled over the libvirtd RPC
   channel. This requires that VIR_MIGRATE_PEER2PEER is
   also set.
 - virDomainMigrateToURI: This is variant of the existing
   virDomainMigrate method which does not require any
   virConnectPtr for the destination host. Given suitable
   driver support, this allows for all the same modes as
   virDomainMigrate()

The URI for VIR_MIGRATE_PEER2PEER must be a valid libvirt
URI. For non-p2p migration a hypervisor specific migration
URI is used.

virDomainMigrateToURI without a PEER2PEER flag is only
support for Xen currently, and it involves XenD talking
directly to XenD, no libvirtd involved at all.

* include/libvirt/libvirt.h.in: Add VIR_MIGRATE_PEER2PEER
  flag for migration
* src/libvirt_internal.h: Add feature flags for peer to
  peer migration (VIR_FEATURE_MIGRATE_P2P) and direct
  migration (VIR_MIGRATE_PEER2PEER mode)
* src/libvirt.c: Implement support for VIR_MIGRATE_PEER2PEER
  and virDomainMigrateToURI APIs.
* src/xen/xen_driver.c: Advertise support for DIRECT migration
* src/xen/xend_internal.c: Add TODO item for p2p migration
* src/libvirt_public.syms: Export virDomainMigrateToURI
  method
* src/qemu/qemu_driver.c: Add support for PEER2PEER and
  migration, and adapt TUNNELLED migration.
* tools/virsh.c: Add --p2p and --direct args and use the
  new virDomainMigrateToURI method where possible.

15 years agoRe-arrange doTunnelMigrate to simplify cleanup code
Daniel P. Berrange [Fri, 2 Oct 2009 15:14:27 +0000 (16:14 +0100)]
Re-arrange doTunnelMigrate to simplify cleanup code

Re-arrange the doTunnelMigrate method putting all non-QEMU local
state setup steps first. This maximises chances of success before
then starting destination QEMU for receiving incoming migration.
Altogether this can reduce the number of goto cleanup labels to
something more managable.

* qemu/qemu_driver.c: Re-order steps in doTunnelMigrate

15 years agoSeparate out code for sending tunnelled data
Daniel P. Berrange [Fri, 2 Oct 2009 15:02:25 +0000 (16:02 +0100)]
Separate out code for sending tunnelled data

Simplify the doTunnelMigrate code by pulling out the code for
sending all tunnelled data into separate helper

* qemu/qemu_driver.c: introduce doTunnelSendAll() method

15 years agoPull connection handling code out of doTunnelMigrate
Daniel P. Berrange [Fri, 2 Oct 2009 14:56:36 +0000 (15:56 +0100)]
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

15 years agoFix stream abort upon I/O failure during migration
Daniel P. Berrange [Fri, 2 Oct 2009 14:49:50 +0000 (15:49 +0100)]
Fix stream abort upon I/O failure during migration

virStreamAbort is needed when the caller wishes to terminate
the stream early, not when virStreamSend fails.

* qemu/qemu_driver.c: Fix calling of virStreamAbort during
  tunnelled migration

15 years agoRefactor native QEMU migration code
Daniel P. Berrange [Fri, 2 Oct 2009 14:31:06 +0000 (15:31 +0100)]
Refactor native QEMU migration code

The code for tunnelled migration was added in a dedicated method,
but the native migration code is still inline in the top level
qemudDomainMigratePerform() API. Move the native code out into
a dedicated method too to make things more maintainable.

* src/qemu/qemu_driver.c: Pull code for performing a native
  QEMU migration out into separate method

15 years agoDon't force dconn to be NULL in virDomainMigrate
Daniel P. Berrange [Fri, 2 Oct 2009 14:20:23 +0000 (15:20 +0100)]
Don't force dconn to be NULL in virDomainMigrate

The code for tunnelled migration wierdly required the app to pass
a  NULL 'dconn' parameter, only to have to use virConnectOpen
itself shortly thereafter to get a 'dconn' object. Remove this
bogus check & require the app to always pas 'dconn' as before

* src/libvirt.c: Require 'dconn' for virDomainMigrate calls again
  and remove call to virConnectOpen

15 years agoRemove unneccessary uri_in parameter from virMigratePrepareTunnel
Daniel P. Berrange [Fri, 2 Oct 2009 14:05:11 +0000 (15:05 +0100)]
Remove unneccessary uri_in parameter from virMigratePrepareTunnel

Since virMigratePrepareTunnel() is used for migration over the
native libvirt connection, there is never any need to pass the
target URI to this method.

* daemon/remote.c, src/driver.h, src/libvirt.c, src/libvirt_internal.h,
  src/qemu/qemu_driver.c, src/remote/remote_driver.c,
  src/remote/remote_protocol.c, src/remote/remote_protocol.h,
  src/remote/remote_protocol.x: Remove 'uri_in' parameter from
  virMigratePrepareTunnel() method

15 years agoMove the VIR_DRV_FEATURE* constants
Daniel P. Berrange [Fri, 2 Oct 2009 13:43:22 +0000 (14:43 +0100)]
Move the VIR_DRV_FEATURE* constants

Move the VIR_DRV_FEATURE* constants into libvirt_internal.h
since these flags are indicating whether  APIs in the
libvirt_internal.h file are supported by a driver

* src/driver.h: Remove VIR_DRV_FEATURE* constants
* src/libvirt_internal.h: Add VIR_DRV_FEATURE* constants, using
  an enum instead of #define
* src/internal.h: pull in libvirt_internal.h

15 years agoFix configure.ac message vertical alignment
Daniel P. Berrange [Fri, 9 Oct 2009 09:42:09 +0000 (10:42 +0100)]
Fix configure.ac message vertical alignment

* configure.in: Align messages in configuration summary

15 years agoLXC add augeas support for config file
Amy Griffis [Thu, 8 Oct 2009 16:06:40 +0000 (18:06 +0200)]
LXC add augeas support for config file

* src/lxc/libvirtd_lxc.aug src/lxc/test_libvirtd_lxc.aug: augeas schemas
  for lxc.conf
* src/Makefile.am libvirt.spec.in: glue the new augeas files in

15 years agoLXC add driver config file lxc.conf
Amy Griffis [Thu, 8 Oct 2009 15:40:14 +0000 (17:40 +0200)]
LXC add driver config file lxc.conf

* src/lxc/lxc.conf: new configuration file, there is currently one
  tunable "log_with_libvirtd" that controls whether an lxc controller will
  log only to the container log file, or whether it will honor libvirtd's
  log output configuration. This provides a way to have libvirtd and its
  children log to a single file.  The default is to log to the container
  log file.
* src/Makefile.am libvirt.spec.in: add the new file
* src/lxc/lxc_conf.[ch] src/lxc/lxc_driver.c: read the new log value
  from the configuration file and pass the log informations when
  starting up a container.

15 years agoLXC do not truncate container log files on restart
Amy Griffis [Thu, 8 Oct 2009 15:37:09 +0000 (17:37 +0200)]
LXC do not truncate container log files on restart

* src/lxc/lxc_driver.c: use O_APPEND instead of O_TRUNC when opening
  the log file on lxcVmStart()

15 years agoLXC initialize logging configuration
Amy Griffis [Thu, 8 Oct 2009 15:16:08 +0000 (17:16 +0200)]
LXC initialize logging configuration

* src/lxc/lxc_driver.c src/lxc/lxc_controller.c: before launching the
  lxc controller, have the lxc driver query the log settings and setup
  envp[]. This provides the advantage of honoring the actual log
  configuration instead of only what had been set in the environment.
  The lxc controller now simply has to call virLogSetFromEnv().

15 years agoAdd debug for envp[] in virExecWithHook()
Amy Griffis [Thu, 8 Oct 2009 15:11:03 +0000 (17:11 +0200)]
Add debug for envp[] in virExecWithHook()

* src/util/util.c: output some debug if caller of virExecWithHook have
  set envp[]

15 years agoAdd accessors for logging filters and outputs
Amy Griffis [Thu, 8 Oct 2009 15:05:01 +0000 (17:05 +0200)]
Add accessors for logging filters and outputs

When configuring logging settings, keep more information about the
output destination. Add accessors to retrieve the filter and output
settings in the original string form; this to be used to set up
environment for a child process that also logs.

* src/util/logging.[ch]: add virLogGetFilters and virLogGetOutputs
  accessors and modify the internals (including virLogDefineOutput())
  to save the data needed for the accessors

15 years agoAdd virFileAbsPath() utility
Amy Griffis [Thu, 8 Oct 2009 14:55:58 +0000 (16:55 +0200)]
Add virFileAbsPath() utility

* src/util/util.[ch]: Add virFileAbsPath() function to ensure an
  absolute path for a potentially realtive path.
* src/libvirt_private.syms: add it in libvirt private symbols

15 years agoDocumentation and examples for SVirt Apparmor driver
Jamie Strandboge [Thu, 8 Oct 2009 14:42:05 +0000 (16:42 +0200)]
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

15 years agosVirt AppArmor security driver
Jamie Strandboge [Thu, 8 Oct 2009 14:34:22 +0000 (16:34 +0200)]
sVirt AppArmor security driver

* configure.in: look for AppArmor and devel
* src/security/security_apparmor.[ch] src/security/security_driver.c
  src/Makefile.am: add and plug the new driver
* src/security/virt-aa-helper.c: new binary which is used exclusively by
  the AppArmor security driver to manipulate AppArmor.
* po/POTFILES.in: registers the new files
* tests/Makefile.am tests/secaatest.c tests/virt-aa-helper-test:
  tests for virt-aa-helper and the security driver, secaatest.c is
  identical to seclabeltest.c except it initializes the 'apparmor'
  driver instead of 'selinux'

15 years agocgroup: Fix -Werror breakage
Cole Robinson [Thu, 8 Oct 2009 14:26:42 +0000 (10:26 -0400)]
cgroup: Fix -Werror breakage

15 years agoMisc win32 build fixes
Daniel P. Berrange [Wed, 7 Oct 2009 10:18:31 +0000 (11:18 +0100)]
Misc win32 build fixes

* daemon/Makefile.am: Fix missing sasl rule
* src/datatypes.c: Add unistd.h to avoid gnulib bug
* src/util/cgroup.c: Disable mntent if not available

15 years agoFix handling return value of qemuMonitorSetBalloon
Ryota Ozaki [Wed, 7 Oct 2009 13:33:36 +0000 (15:33 +0200)]
Fix handling return value of qemuMonitorSetBalloon

* src/qemu/qemu_driver.c: The positive return value of
  qemuMonitorSetBalloon should be handled as a success

15 years agoLXC implement memory control APIs
Ryota Ozaki [Wed, 7 Oct 2009 13:26:23 +0000 (15:26 +0200)]
LXC implement memory control APIs

The patch implements the missing memory control APIs for lxc, i.e.,
domainGetMaxMemory, domainSetMaxMemory, domainSetMemory, and improves
domainGetInfo to return proper amount of used memory via cgroup.

* src/libvirt_private.syms: Export virCgroupGetMemoryUsage
  and add missing virCgroupSetMemory
* src/lxc/lxc_driver.c: Implement missing memory functions
* src/util/cgroup.c, src/util/cgroup.h: Add the function
  to get used memory

15 years agoAdd a domain argument to SVirt *RestoreImageLabel
Jamie Strandboge [Wed, 7 Oct 2009 10:36:35 +0000 (12:36 +0200)]
Add a domain argument to SVirt *RestoreImageLabel

When James Morris originally submitted his sVirt patches (as seen in
libvirt 0.6.1), he did not require on disk labelling for
virSecurityDomainRestoreImageLabel. A later commit[2] changed this
behavior to assume on disk labelling, which halts implementations for
path-based MAC systems such as AppArmor and TOMOYO where
vm->def->seclabel is required to obtain the label.

* src/security/security_driver.h src/qemu/qemu_driver.c
  src/security/security_selinux.c: adds the 'virDomainObjPtr vm'
  argument back to *RestoreImageLabel

15 years agoFix up "make check"
Chris Lalancette [Wed, 23 Sep 2009 07:32:10 +0000 (09:32 +0200)]
Fix up "make check"

While running make check, I noticed that it was actually using
the virsh binary from my system, in /usr/bin/virsh, and not the
one that was just compiled.  This is actually caused by a bug
in Makefile.am, where we didn't update the PATH to include tools.

While here, I also updated all of the scripts to properly define
the srcdir, abs_top_srcdir, and abs_top_builddir environment
variables.  This is required if you want to be able to run the
tests standalone (i.e. ./test instead of from make check).  I've
tested this on both RHEL-5 and Fedora-10 machines, and make check
works on both, as does running the individual tests by hand.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoCreate /var/log/libvirt/{lxc,uml} dirs
Mark McLoughlin [Tue, 6 Oct 2009 11:33:17 +0000 (12:33 +0100)]
Create /var/log/libvirt/{lxc,uml} dirs

Otherwise logrotate barfs:

  error: error accessing /var/log/libvirt/uml: No such file or directory
  error: libvirtd:1 glob failed for /var/log/libvirt/uml/*.log
  error: found error in /var/log/libvirt/qemu/*.log /var/log/libvirt/uml/*.log /var/log/libvirt/lxc/*.log , skipping

* qemud/Makefile.am: always create /var/log/libvirt/{lxc,uml} when
  installing the logrotate conf; not ideal, but easier than making
  the logrotate conf depend on which drivers are enabled

15 years agoFix rebuilding of devhelp files
Daniel P. Berrange [Fri, 2 Oct 2009 11:29:15 +0000 (12:29 +0100)]
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

15 years agoFix ordering of <exports> in API description file
Daniel P. Berrange [Fri, 2 Oct 2009 11:17:18 +0000 (12:17 +0100)]
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

15 years agotest: Support loading node device info from file/XML
Cole Robinson [Fri, 2 Oct 2009 14:05:17 +0000 (10:05 -0400)]
test: Support loading node device info from file/XML

Also add some XML examples.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
15 years agonode conf: Make parsing routines consistent with other drivers
Cole Robinson [Fri, 2 Oct 2009 14:03:55 +0000 (10:03 -0400)]
node conf: Make parsing routines consistent with other drivers

Add virNodeDeviceParseFile, and make virNodeDeviceParseNode non-static. These
will be used by the test driver.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
15 years agotest: Implement node device driver.
Cole Robinson [Thu, 1 Oct 2009 18:54:36 +0000 (14:54 -0400)]
test: Implement node device driver.

Add a simple 'computer' device for the default driver. Only implement
the basic calls, no creation or destroy happening.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
15 years agonodedev: Break out virNodeDeviceHasCap to node_conf
Cole Robinson [Thu, 1 Oct 2009 18:53:43 +0000 (14:53 -0400)]
nodedev: Break out virNodeDeviceHasCap to node_conf

Will be used by test driver node device implementation.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
15 years agonodedev: Add locking in nodeNumOfDevices
Cole Robinson [Thu, 1 Oct 2009 18:51:39 +0000 (14:51 -0400)]
nodedev: Add locking in nodeNumOfDevices

Signed-off-by: Cole Robinson <crobinso@redhat.com>
15 years agotest: Throw a proper error in GetBridgeName
Cole Robinson [Wed, 23 Sep 2009 15:54:48 +0000 (11:54 -0400)]
test: Throw a proper error in GetBridgeName

Throw error in GetBridgeName if net has no bridge.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
15 years agopython: Add a newline after custom classes
Cole Robinson [Fri, 2 Oct 2009 17:05:03 +0000 (13:05 -0400)]
python: Add a newline after custom classes

In the generated bindings, custom classes are squashed against the following
class, which hurts readability.

15 years agopython: Fix generated virInterface method names
Cole Robinson [Wed, 23 Sep 2009 16:51:55 +0000 (12:51 -0400)]
python: Fix generated virInterface method names

A mistake in the generator was causing virInterface methods to be generated
with unpredicatable names ('ceUndefine', instead of just 'undefine'). This
fixes the method names to match existing convention.

Does anyone care if we are breaking API compat? My guess is that no one is
using the python interface bindings yet.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
15 years agopython: Use a pure python implementation of 'vir*GetConnect'
Cole Robinson [Wed, 23 Sep 2009 16:38:47 +0000 (12:38 -0400)]
python: Use a pure python implementation of 'vir*GetConnect'

The API docs explictly warn that we shouldn't use the C vir*GetConnect calls
in bindings: doing so can close the internal connection pointer and cause
things to get screwy. Implement these calls in python.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
15 years agopython: Don't generate bindings for vir*Ref
Cole Robinson [Wed, 23 Sep 2009 16:17:03 +0000 (12:17 -0400)]
python: Don't generate bindings for vir*Ref

They are only for use in implementing the bindings, so shouldn't be
exposed to regular API users.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
15 years agopython: Don't generate conflicting conn.createXML functions.
Cole Robinson [Wed, 23 Sep 2009 16:09:09 +0000 (12:09 -0400)]
python: Don't generate conflicting conn.createXML functions.

A special case in the generator wasn't doing its job, and duplicate
conn.createXML functions were being generated. The bindings diff is:

@@ -1079,14 +1079,6 @@ class virConnect:
         return __tmp

     def createXML(self, xmlDesc, flags):
-        """Create a new device on the VM host machine, for example,
-           virtual HBAs created using vport_create. """
-        ret = libvirtmod.virNodeDeviceCreateXML(self._o, xmlDesc, flags)
-        if ret is None:raise libvirtError('virNodeDeviceCreateXML() failed', conn=self)
-        __tmp = virNodeDevice(self, _obj=ret)
-        return __tmp
-
-    def createXML(self, xmlDesc, flags):
         """Launch a new guest domain, based on an XML description
           similar to the one returned by virDomainGetXMLDesc() This
           function may requires privileged access to the hypervisor.
@@ -1327,6 +1319,14 @@ class virConnect:
         __tmp = virNetwork(self, _obj=ret)
         return __tmp

+    def nodeDeviceCreateXML(self, xmlDesc, flags):
+        """Create a new device on the VM host machine, for example,
+           virtual HBAs created using vport_create. """
+        ret = libvirtmod.virNodeDeviceCreateXML(self._o, xmlDesc, flags)
+        if ret is None:raise libvirtError('virNodeDeviceCreateXML() failed', conn=self)
+        __tmp = virNodeDevice(self, _obj=ret)
+        return __tmp
+
     def nodeDeviceLookupByName(self, name):
         """Lookup a node device by its name. """
         ret = libvirtmod.virNodeDeviceLookupByName(self._o, name)

Signed-off-by: Cole Robinson <crobinso@redhat.com>
15 years agopython: Remove use of xmllib in generator.py
Cole Robinson [Fri, 2 Oct 2009 15:20:47 +0000 (11:20 -0400)]
python: Remove use of xmllib in generator.py

xmllib has been deprecated since python 2.0, and running the generator throws
a warning. Move to using xml.sax

Signed-off-by: Cole Robinson <crobinso@redhat.com>
15 years agopython: Remove FastParser from generator.
Cole Robinson [Fri, 2 Oct 2009 14:34:54 +0000 (10:34 -0400)]
python: Remove FastParser from generator.

FastParser uses sgmlop, a non-standard python module meant as a replacement
for xmllib (which is deprecated since python 2.0). Fedora doesn't even carry
this module, and the generator doesn't have high performance requirements, so
just rip the code out.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
15 years agoconfigure: Add explict --with-python option.
Cole Robinson [Fri, 2 Oct 2009 15:19:47 +0000 (11:19 -0400)]
configure: Add explict --with-python option.

--with-python currently already works for enabling/disabling the python
bindings, but doesn't show up in the help output.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
15 years ago526769 change logrotate config default to weekly
Daniel Veillard [Mon, 5 Oct 2009 15:03:14 +0000 (17:03 +0200)]
526769 change logrotate config default to weekly

* daemon/libvirtd.logrotate.in: change to weekly rotation of logs,
  keep a month worth of data and also extend to cover LXC and UML
  domain logs

15 years agoFix typo in Makefile.am breaking NEWS file generation
Daniel P. Berrange [Fri, 2 Oct 2009 11:01:10 +0000 (12:01 +0100)]
Fix typo in Makefile.am breaking NEWS file generation

* docs/Makefile.am: Fix syntax error in NEWS rule, '$' should be '$$'
  to escape correctly

15 years agoFix emission of domain events messages
Daniel P. Berrange [Wed, 30 Sep 2009 13:33:05 +0000 (14:33 +0100)]
Fix emission of domain events messages

The code which updated the message length after writing the
payload wrote the updated length word in the wrong place since
the XDR object was given a buffer pointing to the start of the
header payload, rather than message start.

* daemon/remote.c: Fix updating of event message length so that
  we actually send the payload, not just the header

15 years agounbreak `make rpcgen'
Paolo Bonzini [Thu, 1 Oct 2009 18:18:29 +0000 (20:18 +0200)]
unbreak `make rpcgen'

Fix "make rpcgen", broken by the directory reorganization.

* src/Makefile.am (rpcgen): Fix path to rpcgen_fix.pl.

15 years agounbreak migration
Paolo Bonzini [Thu, 1 Oct 2009 18:18:28 +0000 (20:18 +0200)]
unbreak migration

Fix migration, broken in two different ways by the QEMU monitor
abstraction.  Note that the QEMU console emits a "\r\n" as the
line-ending.

* src/qemu/qemu_monitor_text.c (qemuMonitorGetMigrationStatus):
Fix "info migrate" command and its output's parsing.

15 years agoTunnelled migration.
Chris Lalancette [Wed, 30 Sep 2009 10:51:54 +0000 (12:51 +0200)]
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>
15 years agoFix build in separate build directory
Jiri Denemark [Thu, 1 Oct 2009 14:55:09 +0000 (16:55 +0200)]
Fix build in separate build directory

* cfg.mk: use $(srcdir)/ prefix for Makefile.nonreentrant include
* examples/domain-events/events-c/Makefile.am tools/Makefile.am
  examples/hellolibvirt/Makefile.am: extend the include paths to
  use $(top_srcdir)/include too.

15 years agoFix documentation and comment typos
Paolo Bonzini [Thu, 1 Oct 2009 14:42:40 +0000 (16:42 +0200)]
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.

15 years agoVarious monitor improvements for migration.
Chris Lalancette [Wed, 30 Sep 2009 12:51:32 +0000 (14:51 +0200)]
Various monitor improvements for migration.

The upcoming tunnelled migration needs to be able to set
a migration in progress in the background, as well as
be able to cancel a migration when a problem has happened.
This patch allows for both of these to properly work.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoFix USB device re-labelling
Mark McLoughlin [Wed, 30 Sep 2009 17:37:03 +0000 (18:37 +0100)]
Fix USB device re-labelling

A simple misplaced break out of a switch results in:

  libvir: error : Failed to open file '/sys/bus/pci/devices/0000:00:54c./vendor': No such file or directory
  libvir: error : Failed to open file '/sys/bus/pci/devices/0000:00:54c./device': No such file or directory
  libvir: error : this function is not supported by the hypervisor: Failed to read product/vendor ID for 0000:00:54c.

when trying to passthrough a USB host device to qemu.

* src/security_selinux.c: fix a switch/break thinko

15 years agoAvoid a libvirtd crash on broken input 523418
Daniel Veillard [Thu, 1 Oct 2009 09:54:38 +0000 (11:54 +0200)]
Avoid a libvirtd crash on broken input 523418

* src/conf/domain_conf.c: a simple typo in an XML domain file could lead
  to a crash, because we called STRPREFIX() on the looked up value without
  checking it was non-null.

15 years agoIncorrect error message in virDomainNetDefParseXML
Florian Vichot [Wed, 30 Sep 2009 16:51:30 +0000 (18:51 +0200)]
Incorrect error message in virDomainNetDefParseXML

* src/conf/domain_conf.c: when declaring a <interface type="bridge">
  tag, <source> needs a "bridge" attribute, but the parser complains
  about a missing "dev" attribute.

15 years agoFix a few 'make rpm' breakages
Daniel Veillard [Wed, 30 Sep 2009 12:34:15 +0000 (14:34 +0200)]
Fix a few 'make rpm' breakages

* Makefile.am: examples/domain-events/events-python should be added
  to dist tarball
* libvirt.spec.in: there is no makefile in domain-events but in
  domain-events/events-c and python/libvirtclass.txt has vanished

15 years ago523639 Allows a <description> tag for domains
Daniel Veillard [Wed, 30 Sep 2009 14:07:24 +0000 (16:07 +0200)]
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>

15 years agoAdd src/util/storage_file.c to the POTFILES.in.
Chris Lalancette [Wed, 30 Sep 2009 12:12:03 +0000 (14:12 +0200)]
Add src/util/storage_file.c to the POTFILES.in.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoAdd a qemu feature flag for unix socket migration.
Chris Lalancette [Wed, 30 Sep 2009 10:52:34 +0000 (12:52 +0200)]
Add a qemu feature flag for unix socket migration.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoPass remote_message_header to the dispatch functions.
Chris Lalancette [Wed, 30 Sep 2009 10:29:20 +0000 (12:29 +0200)]
Pass remote_message_header to the dispatch functions.

This is necessary for the dispatch functions to be able to use
streams in the future.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoLet remoteClientStream only do RX if requested.
Chris Lalancette [Wed, 30 Sep 2009 10:47:43 +0000 (12:47 +0200)]
Let remoteClientStream only do RX if requested.

Right now, the stream stuff assumes that a stream is always
going to be used for transmit.  This is not the case, and in
fact doesn't work with the tunnelled migration stuff.  Add
a flag to remoteClientStream() to allow it to do RX only.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoFix up a few typos in the tree.
Chris Lalancette [Tue, 22 Sep 2009 09:42:06 +0000 (11:42 +0200)]
Fix up a few typos in the tree.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoFix up some warnings from stream DEBUG statements.
Chris Lalancette [Wed, 30 Sep 2009 11:05:21 +0000 (13:05 +0200)]
Fix up some warnings from stream DEBUG statements.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoFix apibuild.py warnings
Matthias Bolte [Wed, 30 Sep 2009 11:41:28 +0000 (13:41 +0200)]
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

15 years agoChange signature of remoteSendStreamData() to fix compile warning
Matthias Bolte [Wed, 30 Sep 2009 10:37:10 +0000 (12:37 +0200)]
Change signature of remoteSendStreamData() to fix compile warning

The actual type of size_t is architecture dependent. Because the len
parameter is used as unsigned int in remoteSendStreamData(), change its
type to unsigned int.

* daemon/dispatch.[ch]: change size_t to unsigned int for
  remoteSendStreamData()

15 years agoRe-label image file backing stores
Mark McLoughlin [Fri, 25 Sep 2009 13:20:13 +0000 (14:20 +0100)]
Re-label image file backing stores

Use virStorageFileGetMetadata() to find any backing stores for images
and re-label them

Without this, qemu cannot access qcow2 backing files, see:

  https://bugzilla.redhat.com/497131

* src/security/security_selinux.c: re-label backing store files in
  SELinuxSetSecurityImageLabel()

15 years agoAdd virStorageFileGetMetadata() helper
Mark McLoughlin [Tue, 29 Sep 2009 08:41:23 +0000 (09:41 +0100)]
Add virStorageFileGetMetadata() helper

* src/util/storage_file.c: add virStorageFileGetMetadata() so that
  the caller does not need to open the file

15 years agoMove virStorageGetMetadataFromFD() to libvirt_util
Mark McLoughlin [Tue, 29 Sep 2009 08:34:48 +0000 (09:34 +0100)]
Move virStorageGetMetadataFromFD() to libvirt_util

Finally, we get to the point of all this.

Move virStorageGetMetadataFromFD() to virStorageFileGetMetadataFromFD()
and move to src/util/storage_file.[ch]

There's no functional changes in this patch, just code movement

* src/storage/storage_backend_fs.c: move code from here ...

* src/util/storage_file.[ch]: ... to here

* src/libvirt_private.syms: export virStorageFileGetMetadataFromFD()

15 years agoIntroduce virStorageFileMetadata structure
Mark McLoughlin [Tue, 29 Sep 2009 08:23:04 +0000 (09:23 +0100)]
Introduce virStorageFileMetadata structure

Introduce a metadata structure and make virStorageGetMetadataFromFD()
fill it in.

* src/util/storage_file.h: add virStorageFileMetadata

* src/backend/storage_backend_fs.c: virStorageGetMetadataFromFD() now
  fills in the virStorageFileMetadata structure

15 years agoSplit virStorageGetMetadataFromFD() from virStorageBackendProbeTarget()
Mark McLoughlin [Tue, 29 Sep 2009 08:07:14 +0000 (09:07 +0100)]
Split virStorageGetMetadataFromFD() from virStorageBackendProbeTarget()

Prepare the code probing a file's format and associated metadata for
moving into libvirt_util.

* src/storage/storage_backend_fs.c: re-factor the format and metadata
  probing code in preparation for moving it

15 years agoMove file format enum to libvirt_util
Mark McLoughlin [Fri, 25 Sep 2009 13:20:13 +0000 (14:20 +0100)]
Move file format enum to libvirt_util

Rename virStorageVolFormatFileSystem to virStorageFileFormat and
move to src/util/storage_file.[ch]

* src/Makefile.am: add src/util/storage_file.[ch]

* src/conf/storage_conf.[ch]: move enum from here ...

* src/util/storage_file.[ch]: .. to here

* src/libvirt_private.syms: update To/FromString exports

* src/storage/storage_backend.c, src/storage/storage_backend_fs.c,
  src/vbox/vbox_tmpl.c: update for above changes

15 years agoFix memory leaks in libvirtd's message processing
Matthias Bolte [Wed, 30 Sep 2009 00:17:27 +0000 (02:17 +0200)]
Fix memory leaks in libvirtd's message processing

Commit 47cab734995fa9521b1df05d37e9978eedd8d3a2 changed the way how
qemud_client_message objects were reused. Before this commit
remoteDispatchClientRequest() reused the received message for normal responses
and to report non-fatal errors. If a fatal error occurred qemudWorker() frees
the message. After this commit non-fatal errors are reported by
remoteSerializeReplyError() using a new qemud_client_message object and the
original message leaks.

To fix this leak the original message has to be freed if
remoteSerializeReplyError() succeeds. If remoteSerializeReplyError()
fails the original message is freed in qemudWorker().

* daemon/dispatch.c: free qemud_client_message objects that will not be reused
  and would leak otherwise, also free the allocated qemud_client_message object
  in remoteSerializeError() if an error occurs

15 years agoFix QEMU test suite with new VNC env variable
Daniel P. Berrange [Tue, 29 Sep 2009 16:15:52 +0000 (17:15 +0100)]
Fix QEMU test suite with new VNC env variable

* qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.args,
  qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.args,
  qemuxml2argvdata/qemuxml2argv-graphics-vnc.args,
  qemuxml2argvdata/qemuxml2argv-input-xen.args: Add in
  QEMU_AUDIO_DRV=none env variable

15 years agoVBox vboxDomainDestroy forgot to wait for completion
Pritesh Kothari [Tue, 29 Sep 2009 15:41:04 +0000 (17:41 +0200)]
VBox vboxDomainDestroy forgot to wait for completion

* src/vbox/vbox_tmpl.c: the vboxDomainDestroy forgot to wait for
  completion of the PowerDown command

15 years agoRemove hand-crafted UUID parsers
Daniel P. Berrange [Thu, 24 Sep 2009 13:24:57 +0000 (14:24 +0100)]
Remove hand-crafted UUID parsers

* src/libvirt.c: Remove hand-crafted UUID parsers in favour of
  calling virParseUUID

15 years agoAllow control over QEMU audio backend
Daniel P. Berrange [Mon, 14 Sep 2009 10:23:20 +0000 (11:23 +0100)]
Allow control over QEMU audio backend

When using VNC for graphics + keyboard + mouse, we shouldn't
then use the host OS for audio. Audio should go back over
VNC.

When using SDL for graphics, we should use the host OS for
audio since that's where the display is. We need to allow
certain QEMU env variables to be passed through to guest
too to allow choice of QEMU audio backend.

* qemud/libvirtd.sysconf: Mention QEMU/SDL audio env vars
* src/qemu_conf.c: Passthrough QEMU/SDL audio env for SDL display,
  disable host audio for VNC display

15 years agoHandle data streams in remote client
Daniel P. Berrange [Fri, 7 Aug 2009 14:13:46 +0000 (15:13 +0100)]
Handle data streams in remote client

* src/remote_internal.c: Add helper APIs for processing data streams

15 years agoHandle outgoing data streams in libvirtd
Daniel P. Berrange [Mon, 24 Aug 2009 19:57:16 +0000 (20:57 +0100)]
Handle outgoing data streams in libvirtd

* daemon/dispatch.c: Set streamTX flag on outgoing data packets
* daemon/qemud.h: Add streamTX flag to track outgoing data
* daemon/qemud.c: Re-enable further TX when outgoing data packet
  has been fully sent.
* daemon/stream.h, daemon/stream.c: Add method for enabling TX.
  Support reading from streams and transmitting data out to client

15 years agoHandle incoming data streams in libvirtd
Daniel P. Berrange [Mon, 24 Aug 2009 19:53:48 +0000 (20:53 +0100)]
Handle incoming data streams in libvirtd

* daemon/stream.c: Handle incoming stream data packets, queuing until
  stream becomes writable. Handle stream completion handshake
* po/POTFILES.in: Add daemon/stream.c

15 years agoHelper functions for processing data streams in libvirtd
Daniel P. Berrange [Fri, 10 Jul 2009 12:06:36 +0000 (13:06 +0100)]
Helper functions for processing data streams in libvirtd

Defines the extensions to the remote protocol for generic
data streams. Adds a bunch of helper code to the libvirtd
daemon for working with data streams.

* daemon/Makefile.am: Add stream.c/stream.h to build
* daemon/stream.c, qemud/stream.h: Generic helper functions for
  creating new streams, associating streams with clients, finding
  existing streams for a client and removing/deleting streams.
* src/remote/remote_protocol.x: Add a new 'REMOTE_STREAM' constant
  for the 'enum remote_message_type' for encoding stream data
  in wire messages. Add a new 'REMOTE_CONTINUE' constant to
  'enum remote_message_status' to indicate further data stream
  messsages are expected to follow.  Document how the
  remote_message_header is used to encode data streams
* src/remote/remote_protocol.h: Regenerate
* daemon/dispatch.c: Remove assumption that a error message
  sent to client is always type=REMOTE_REPLY. It may now
  also be type=REMOTE_STREAM. Add convenient method for
  sending outgoing stream data packets. Log and ignore
  non-filtered incoming stream packets. Add a method for
  serializing a stream error message
* daemon/dispatch.h:  Add API for serializing stream errors
  and sending stream data packets
* daemon/qemud.h: Add struct qemud_client_stream for tracking
  active data streams for clients. Tweak filter function
  operation so that it accepts a client object too.
* daemon/qemud.c: Refactor code for free'ing message objects
  which have been fully transmitted into separate method.
  Release all active streams when client shuts down. Change
  filter function to be responsible for queueing the message

15 years agoAdd public API definition for data stream handling
Daniel P. Berrange [Fri, 10 Jul 2009 11:18:12 +0000 (12:18 +0100)]
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

15 years agoVbox call OpenHardDisk with "" instead of NULL
Pritesh Kothari [Tue, 29 Sep 2009 13:17:51 +0000 (15:17 +0200)]
Vbox call OpenHardDisk with "" instead of NULL

* src/vbox/vbox_tmpl.c: UTF-16 fixed version of Florian Vichot initial
  patch

15 years agoAvoid double free in errors in virsh
Jim Fehlig [Tue, 29 Sep 2009 11:42:42 +0000 (13:42 +0200)]
Avoid double free in errors in virsh

* tools/virsh.c: it was possible to get vshDeinit to call itself back
  via vshError, remove the doexit parameter of vshError to avoid the
  possibility and make sure to exit directly after in those case.

15 years agoFix crash in device hotplug cleanup code
Daniel P. Berrange [Thu, 24 Sep 2009 14:42:25 +0000 (15:42 +0100)]
Fix crash in device hotplug cleanup code

* src/qemu/qemu_driver.c: Fix crash in scenario where XML
  parsing of hotplugged device failed & thus 'dev' is NULL

15 years agoStandardize debugging messages in QEMU monitor code
Daniel P. Berrange [Thu, 24 Sep 2009 14:37:05 +0000 (15:37 +0100)]
Standardize debugging messages in QEMU monitor code

* src/qemu/qemu_monitor_text.c: Always print command and reply
  in qemuMonitorCommandWithHandler. Print all args in each monitor
  command API & remove redundant relpy printing

15 years agoRemove low level monitor APIs from header file
Daniel P. Berrange [Wed, 23 Sep 2009 16:39:07 +0000 (17:39 +0100)]
Remove low level monitor APIs from header file

* src/qemu/qemu_monitor_text.h: Remove qemudMonitorCommand,
  qemudMonitorCommandWithFd, qemudMonitorCommandWithHandler,
  qemudMonitorCommandExtra low level APIs
* src/qemu/qemu_monitor_text.c: Replace s/qemud/qemuMonitor/

15 years agoAdd API for issuing 'host_net_remove' monitor command
Daniel P. Berrange [Wed, 23 Sep 2009 16:32:50 +0000 (17:32 +0100)]
Add API for issuing 'host_net_remove' monitor command

* src/qemu/qemu_monitor.h, src/qemu/qemu_monitor.c: Add new
  qemuMonitorRemoveHostNetwork() command for removing host
  networks
* src/qemu/qemu_driver.c: Convert NIC hotplug methods over
  to use qemuMonitorRemoveHostNetwork()

15 years agoAdd API for issuing 'host_net_add' monitor command
Daniel P. Berrange [Wed, 23 Sep 2009 16:25:28 +0000 (17:25 +0100)]
Add API for issuing 'host_net_add' monitor command

* src/qemu/qemu_conf.h, src/qemu/qemu_conf.c: Remove prefix arg
  from qemuBuildHostNetStr which is no longer required
* src/qemu/qemu_driver.c: Refactor to use qemuMonitorAddHostNetwork()
  API for adding host network
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new
  qemuMonitorAddHostNetwork() method for adding host networks

15 years agoAdd API for issuing 'pci_add nic' monitor command
Daniel P. Berrange [Wed, 23 Sep 2009 16:01:39 +0000 (17:01 +0100)]
Add API for issuing 'pci_add nic' monitor command

* src/qemu/qemu_conf.c: Remove separator from qemuBuildNicStr()
  args, and remove hardcoded 'nic' prefix. Leave it upto callers
  instead
* src/qemu/qemu_driver.c: Switch over to using the new
  qemuMonitorAddPCINetwork() method for NIC hotplug
* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new
  qemuMonitorAddPCINetwork API for PCI network device hotplug

15 years agoAdd API for issuing 'getfd' and 'closefd' monitor commands
Daniel P. Berrange [Wed, 23 Sep 2009 15:51:10 +0000 (16:51 +0100)]
Add API for issuing 'getfd' and 'closefd' monitor commands

* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new
  qemuMonitorCloseFileHandle and qemuMonitorSendFileHandle
  APIs for processing file handles
* src/qemu/qemu_driver.c: Convert NIC hotplug method over to
  use   qemuMonitorCloseFileHandle and qemuMonitorSendFileHandle

15 years agoAdd API for issuing 'pci_add storage' monitor command
Daniel P. Berrange [Wed, 23 Sep 2009 15:38:44 +0000 (16:38 +0100)]
Add API for issuing 'pci_add storage' monitor command

* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new
  API qemuMonitorAddPCIDisk()
* src/qemu/qemu_driver.c: Convert over to using the new
  qemuMonitorAddPCIDisk() method, and remove now obsolete
  qemudEscape() method

15 years agoAdd API for issuing 'pci_del' monitor command
Daniel P. Berrange [Wed, 23 Sep 2009 15:25:05 +0000 (16:25 +0100)]
Add API for issuing 'pci_del' monitor command

* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new API
  qemuMonitorRemovePCIDevice() for removing PCI device
* src/qemu/qemu_driver.c: Convert all places removing PCI devices
  over to new qemuMonitorRemovePCIDevice() API

15 years agoAdd API for issuing 'pci_add host' monitor command
Daniel P. Berrange [Wed, 23 Sep 2009 15:15:51 +0000 (16:15 +0100)]
Add API for issuing 'pci_add host' monitor command

* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new
  API qemuMonitorAddPCIHostDevice()
* src/qemu/qemu_driver.c: Switch to using qemuMonitorAddPCIHostDevice()
  for PCI host device hotplug

15 years agoAdd APIs for sending 'usb_add' command for host devices
Daniel P. Berrange [Wed, 23 Sep 2009 15:04:55 +0000 (16:04 +0100)]
Add APIs for sending 'usb_add' command for host devices

One API adds an exact device based on bus+dev, the other adds
any device matching vendor+product

* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new
  qemuMonitorAddUSBDeviceExact() and qemuMonitorAddUSBDeviceMatch()
  commands.
* src/qemu/qemu_driver.c: Switch over to using the new
    qemuMonitorAddUSBDeviceExact() and qemuMonitorAddUSBDeviceMatch()

15 years agoAdd API for using 'usb_add' for disk devices
Daniel P. Berrange [Wed, 23 Sep 2009 14:38:43 +0000 (15:38 +0100)]
Add API for using 'usb_add' for disk devices

* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new
  qemuMonitorAddUSBDisk() API
* src/qemu/qemu_driver.c: Switch USB disk hotplug to the new
  src/qemu/qemu_driver.c API.