1. 11 12月, 2009 6 次提交
    • P
      retrieve paused/running state at migration start · 5de41c06
      Paolo Bonzini 提交于
      This patch fixes the bug where paused/running state is not
      transmitted during migration.  As a result, in the QEMU driver
      for example the machine was always started on the destination
      end.
      
      In order to do so, just read the state and if it is appropriate and
      set the VIR_MIGRATE_PAUSED flag.
      
      * src/libvirt.c (virDomainMigrateVersion1, virDomainMigrateVersion2):
        Automatically add VIR_MIGRATE_PAUSED when appropriate.
      * src/xen/xend_internal.c (xenDaemonDomainMigratePerform): Give a nicer
        error message when migration of paused domains is attempted.
      5de41c06
    • P
      add virsh --suspend arg to migrate command · edc9e78b
      Paolo Bonzini 提交于
      This adds a new flag, VIR_MIGRATE_PAUSED, that mandates pausing
      the migrated VM before starting it.
      
      * include/libvirt/libvirt.h.in (virDomainMigrateFlags): Add VIR_MIGRATE_PAUSED.
      * src/qemu/qemu_driver.c (qemudDomainMigrateFinish2): Handle VIR_MIGRATE_PAUSED.
      * tools/virsh.c (opts_migrate): Add --suspend. (cmdMigrate): Handle it.
      * tools/virsh.pod (migrate): Document it.
      edc9e78b
    • P
      fix migration of paused vms upon failure · ba7d82c6
      Paolo Bonzini 提交于
      This makes a small change on the failed-migration path.  Up to now,
      all VMs that failed non-live migration after the "stop" command
      were restarted.  This must not be done when the VM was paused in
      the first place.
      
      * src/qemu/qemu_driver.c (qemudDomainMigratePerform): Do not restart
        a paused VM that fails migration.  Set paused state after "stop",
        reset it after failure.
      ba7d82c6
    • D
      Small change of RNG syntax for domain · 25f7fa05
      Diego Elio Pettenò 提交于
      * docs/schemas/domain.rng: As trang seems to bug with <optional><oneOrMore>
        replace it with <zeroOrMore>
      25f7fa05
    • R
    • D
      Fix a wellformedness problem in secret.rng · 51ea18a8
      Diego Elio Pettenò 提交于
      * docs/schemas/secret.rng: ref tag for usagevolume wasn't closed
      51ea18a8
  2. 10 12月, 2009 5 次提交
    • M
      remove iptablesReloadRules() and related code · 4ecf9c65
      Mark McLoughlin 提交于
      We don't use this method of reloading rules anymore, so we can just
      kill the code.
      
      This simplifies things a lot because we no longer need to keep a
      table of the rules we've added.
      
      * src/util/iptables.c: kill iptablesReloadRules()
      4ecf9c65
    • M
      remove all traces of lokkit support · 3b3305d8
      Mark McLoughlin 提交于
      Long ago we tried to use Fedora's lokkit utility in order to register
      our iptables rules so that 'service iptables restart' would
      automatically load our rules.
      
      There was one fatal flaw - if the user had configured iptables without
      lokkit, then we would clobber that configuration by running lokkit.
      
      We quickly disabled lokkit support, but never removed it. Let's do
      that now.
      
      The 'my virtual network stops working when I restart iptables' still
      remains. For all the background on this saga, see:
      
        https://bugzilla.redhat.com/227011
      
      * src/util/iptables.c: remove lokkit support
      
      * configure.in: remove --enable-lokkit
      
      * libvirt.spec.in: remove the dirs used only for saving rules for lokkit
      
      * src/Makefile.am: ditto
      
      * src/libvirt_private.syms, src/network/bridge_driver.c,
        src/util/iptables.h: remove references to iptablesSaveRules
      3b3305d8
    • M
      reload iptables rules on libvirtd restart · 534664c3
      Mark McLoughlin 提交于
      This is the expected behaviour, I think - reloading libvirtd should
      be a subset of restarting it.
      
      Note, we reload the rules after we've determined which networks
      are active (because we only add the rules for active networks)
      and before we start autostart networks (to avoid re-adding the
      rules).
      
      * src/network/bridge_driver.c: reload iptables rules on startup
      534664c3
    • M
      reload iptables rules simply by re-adding them · 98895e93
      Mark McLoughlin 提交于
      Currently, when we add iptables rules, we keep them on a list so that
      we can easily reload them on e.g. 'service libvirtd reload'.
      
      However, we don't save this list to disk, so if libvirtd is restarted
      we lose the ability to reload the rules.
      
      The fix is simple - just re-add the damn things on reload.
      
      Note, we delete the rules before re-adding them, just like the current
      behaviour of iptRulesReload().
      
      * src/network/bridge_driver.c: re-add the iptables rules on reload.
      98895e93
    • M
      Add virBufferFreeAndReset() and replace free() · 1b9d0744
      Matthias Bolte 提交于
      Replace free(virBufferContentAndReset()) with virBufferFreeAndReset().
      Update documentation and replace all remaining calls to free() with
      calls to VIR_FREE(). Also add missing calls to virBufferFreeAndReset()
      and virReportOOMError() in OOM error cases.
      1b9d0744
  3. 09 12月, 2009 7 次提交
    • J
      Plumb domain description tag in xend backend · 723bfda1
      Jim Fehlig 提交于
      xen-unstable changesets 20321 and 20521 added support for
      description in xend domain config.  This patch extends that
      support in xend backend.
      * src/xen/xend_internal.c: add parse and output of domain description
      723bfda1
    • R
      Update location of C# bindings. · 16387171
      Richard Jones 提交于
      16387171
    • D
      Make QEMU text monitor parsing more robust · cce1998a
      Daniel P. Berrange 提交于
      The QEMU 0.10.0 release (and possibly other 0.10.x) has a bug where
      it sometimes/often forgets to display the initial monitor greeting
      line, soley printing a (qemu).  This in turn confuses the text
      console parsing because it has a '(qemu)' it is not expecting. The
      confusion results in a negative malloc. Bad things follow.
      
      This re-writes the text console handling to be more robust. The key
      idea is that it should only look for a (qemu), once it has seen the
      original command echo'd back. This ensures it'll skip the bogus stray
      (qemu) with broken QEMUs.
      
      * src/qemu/qemu_monitor.c: Add some (disabled) debug code
      * src/qemu/qemu_monitor_text.c: Re-write way command replies
        are detected
      cce1998a
    • D
      Fix virDomainObj ref handling in QEMU driver · 8e7d1495
      Daniel P. Berrange 提交于
      Since the monitor I/O is processed out of band from the main
      thread(s) invoking monitor  commands, the virDomainObj may be
      deleted by the I/O thread. The qemuDomainObjBeginJob takes an
      extra reference to protect against final deletion, but this
      reference is released by the corresponding EndJob call. THus
      after the EndJob call it may not be valid to reference the
      virDomainObj any more. To allow callers to detect this, the
      EndJob call is changed to return the remaining reference count.
      
      * src/conf/domain_conf.c: Make virDomainObjUnref return the
        remaining reference count
      * src/qemu/qemu_driver.c: Avoid referencing virDomainObjPtr
        after qemuDomainObjEndJob if it has been deleted.
      8e7d1495
    • D
      Fix the news file non-ascii characters · 604c70fd
      Daniel Veillard 提交于
      by adding an explicit HTML encoding meta description
      604c70fd
    • M
      Use AM_PATH_PYTHON and python-config to detect Python configuration · 66137344
      Matthias Bolte 提交于
      Using AM_PATH_PYTHON solves the site-packages directory problem. At least
      in Ubuntu with Python 2.6 and later site-packages is renamed to dist-packages
      and site-packages is not part of sys.path anymore. So installing the libvirt
      Python bindings to site-packages renders them unusable, because they can be
      imported from there without manually including site-packages into sys.path.
      
      AM_PATH_PYTHON detects the correct site-packages/dist-packages directory.
      
      python-config --includes gives the correct include path for the Python header
      files. The old probing code stays there as fallback mechanism.
      
      * configure.in: use AM_PATH_PYTHON and python-config
      * python/Makefile.am: remove -I because PYTHON_INCLUDES contains it now
      66137344
    • M
      Add missing commas to the 0.7.4 news section · 10616d7a
      Matthias Bolte 提交于
      10616d7a
  4. 08 12月, 2009 20 次提交
    • D
      Change generated HTML to UTF-8 encoding · 5362edd4
      Daniel Veillard 提交于
      * docs/ChangeLog.xsl docs/newapi.xsl docs/site.xsl: change all
        stylesheets to output UTF-8 HTML instead of ISO Latin 1 which was
        breaking on some people names.
      5362edd4
    • D
      Avoid an type-punned pointer aliasing pbm · 2b2dae81
      Daniel Veillard 提交于
      Fix this warning, there is no need to use an intermediate,
      different array pointer.
      network.c: In function 'getIPv6Addr':
      network.c:50: warning: dereferencing type-punned pointer will break strict-aliasing rules
      * src/util/network.c: avoid an intermediary pointer cast
      2b2dae81
    • D
      Hook up JSON monitor to emit basic lifecycle events · 421d9950
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor_json.c: Hook up reset, shutdown,
        poweroff and stop events
      421d9950
    • D
      Add QEMU monitor callbacks for basic lifecycle events · 89832303
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add callbacks
        for reset, shutdown, poweroff and stop events. Add convenience
        methods for emiting those events
      89832303
    • D
      Switch over to passing a callback table to QEMU monitor · e9f4c943
      Daniel P. Berrange 提交于
      With addition of events there will be alot of callbacks.
      To avoid having to add many APIs to register callbacks,
      provide them all at once in a big table
      
      * src/qemu/qemu_driver.c: Pass in a callback table to QEMU
        monitor code
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h Replace
        the EOF and disk secret callbacks with a callback table
      e9f4c943
    • D
      Support for JSON mode monitor · 3a4f172f
      Daniel P. Berrange 提交于
      Initial support for the new QEMU monitor protocol  using JSON
      as the data encoding format instead of plain text
      
      * po/POTFILES.in: Add src/qemu/qemu_monitor_json.c
      * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Hack to turn on QMP
        mode. Replace with a version number check on >= 0.12 later
      * src/qemu/qemu_monitor.c: Delegate to json monitor if enabled
      * src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h: Add
        impl of QMP protocol
      * src/Makefile.am: Add src/qemu/qemu_monitor_json.{c,h}
      3a4f172f
    • D
      Introduce callbacks for serializing domain object private data to XML · c5358c0e
      Daniel P. Berrange 提交于
      Now that drivers are using a private domain object state blob,
      the virDomainObjFormat/Parse methods are no longer able to
      directly serialize all neccessary state to/from XML. It is
      thus neccessary to introduce a pair of callbacks fo serializing
      private state.
      
      The code for serializing vCPU PIDs and the monitor device
      config can now move out of domain_conf.c and into the
      qemu_driver.c where they belong.
      
      * src/conf/capabilities.h: Add callbacks for serializing private
        state to/from XML
      * src/conf/domain_conf.c, src/conf/domain_conf.h: Remove the
        monitor, monitor_chr, monitorWatch, nvcpupids and vcpupids
        fields from virDomainObjPtr. Remove code that serialized
        those fields
      * src/libvirt_private.syms: Export virXPathBoolean
      * src/qemu/qemu_driver.c: Add callbacks for serializing monitor
        and vcpupid data to/from XML
      * src/qemu/qemu_monitor.h, src/qemu/qemu_monitor.c: Pass monitor
        char device config into qemuMonitorOpen directly.
      c5358c0e
    • D
      Switch LXC driver to use a private data blob for virDomainObj state · e4b07fd6
      Daniel P. Berrange 提交于
      * src/lxc/lxc_driver.c: Introduce lxcDomainObjPrivate for storing
        monitor device state
      e4b07fd6
    • D
      Switch UML driver to use a private data blob for virDomainObj state · f248c965
      Daniel P. Berrange 提交于
      * src/uml/uml_driver.c: Introduce umlDomainObjPrivateData for storing
        monitor device state. Remove unneccessary VIR_FREE on vcpupids
      f248c965
    • D
      Pull code to start CPUs executing out of qemudInitCpuAffinity() · 5697aa84
      Daniel P. Berrange 提交于
      The code to start CPUs executing has nothing todo with CPU
      affinity masks, so pull it out of the qemudInitCpuAffinity()
      method and up into qemudStartVMDaemon()
      
      * src/qemu/qemu_driver.c: Pull code to start CPUs executing out
        of qemudInitCpuAffinity()
      5697aa84
    • D
      Add a 'format' arg to qemuMonitorChangeMedia() since JSON will support it · 8c12b20c
      Daniel P. Berrange 提交于
      The current QEMU disk media change does not support setting the
      disk format. The new JSON monitor will support this, so add an
      extra parameter to pass this info in
      
      * src/qemu/qemu_driver.c: Pass in disk format when changing media
      * src/qemu/qemu_monitor.h, src/qemu/qemu_monitor.c,
        src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h:
        Add a 'format' arg to qemuMonitorChangeMedia()
      8c12b20c
    • D
      Fix migration cancellation for QEMU · 3fa3cff7
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor_text.c: Add missing underscore in the
        migrate_cancel monitor command impl
      3fa3cff7
    • D
      Move qemuMonitorEscape + migrate status enum into shared monitor code · fa1e4759
      Daniel P. Berrange 提交于
      The qemuMonitorEscape() method, and the VIR_ENUM for migration
      status will be needed by the JSON monitor too, so move that code
      into the shared qemu_monitor.c file instead of qemu_monitor_text.c
      
      * src/qemu/qemu_monitor.h: Declare qemuMonitorMigrationStatus enum
        and qemuMonitorEscapeArg and qemuMonitorEscapeShell methods
      * src/qemu/qemu_monitor.c: Implement qemuMonitorMigrationStatus enum
        and qemuMonitorEscapeArg and qemuMonitorEscapeShell methods
      * src/qemu/qemu_monitor_text.c: Remove above methods/enum
      fa1e4759
    • D
      Fix crash when deleting monitor while a command is in progress · 79533da1
      Daniel P. Berrange 提交于
      If QEMU shuts down while we're in the middle of processing a
      monitor command, the monitor will be freed, and upon cleaning
      up we attempt to do  qemuMonitorUnlock(priv->mon) when priv->mon
      is NULL.
      
      To address this we introduce proper reference counting into
      the qemuMonitorPtr object, and hold an extra reference whenever
      executing a command.
      
      * src/qemu/qemu_driver.c: Hold a reference on the monitor while
        executing commands, and only NULL-ify the priv->mon field when
        the last reference is released
      * src/qemu/qemu_monitor.h, src/qemu/qemu_monitor.c: Add reference
        counting to handle safe deletion of monitor objects
      79533da1
    • G
      udev_device_get_devpath might return NULL · 1f604116
      Guido Günther 提交于
      Fix crash on strdup in that case.
      1f604116
    • D
      Fix a compilation failure if yajl not avail · a4e09c1e
      Daniel Veillard 提交于
      configure:     yajl: no
      CC     libvirt_util_la-json.lo
      util/json.c:32:27: error: yajl/yajl_gen.h: No such file or directory
      util/json.c:33:29: error: yajl/yajl_parse.h: No such file or directory
      
      * src/util/json.c: remove the includes if yajl not configured in
      a4e09c1e
    • M
      Fix compilation for configure --disable-nls · 1449392d
      Matthias Bolte 提交于
      1449392d
    • M
      vbox: Update IIDs from version 3.1-beta2 to 3.1-final · 74c1c534
      Matthias Bolte 提交于
      This solves the 'nsIEventQueue object is null' error when trying
      to connect to a VirtualBox 3.1 hypervisor instance.
      74c1c534
    • D
      Fix ReprotError vs ReportError typo in JSON code · 0a4283cb
      Daniel P. Berrange 提交于
      * src/util/json.c: Fix ReprotError typo when YAJL is not available
      0a4283cb
    • D
      Fix inverted conditional test in configure.ac check for yajl · 6e547d54
      Daniel P. Berrange 提交于
      * configure.in: Fix inverted conditional test when yajl is not
        found
      6e547d54
  5. 07 12月, 2009 2 次提交
    • D
      Introduce a simple API for handling JSON data · 9428f2ce
      Daniel P. Berrange 提交于
      This introduces simple API for handling JSON data. There is
      an internal data structure 'virJSONValuePtr' which stores a
      arbitrary nested JSON value (number, string, array, object,
      nul, etc).  There are APIs for constructing/querying objects
      and APIs for parsing/formatting string formatted JSON data.
      
      This uses the YAJL library for parsing/formatting from
      
       http://lloyd.github.com/yajl/
      
      * src/util/json.h, src/util/json.c: Data structures and APIs
        for representing JSON data, and parsing/formatting it
      * configure.in: Add check for yajl library
      * libvirt.spec.in: Add build requires for yajl
      * src/Makefile.am: Add json.c/h
      * src/libvirt_private.syms: Export JSON symbols to drivers
      9428f2ce
    • D
      Add --system flag to autogen.sh to make it easy to build with right prefix · 563dc565
      Daniel P. Berrange 提交于
      Add a --system flag to autogen.sh which gets turned into the args
      --prefix=/usr --sysconfdir=/etc --localstatedir=/var to make it
      easy to build with settings that match an RPM build
      
      * autogen.sh: Add --system flag
      563dc565