1. 01 1月, 2012 1 次提交
  2. 30 12月, 2011 5 次提交
    • D
      Fix build on s390(x) and other stange arches · c4ac050f
      Daniel Veillard 提交于
      The blocks to extract node information on a per-arch
      basis wasn't well balanced leading to a compilation
      failure if not on one of the handled arches (PCs and PPCs)
      c4ac050f
    • E
      seclabel: honor device override in selinux · 904e05a2
      Eric Blake 提交于
      This wires up the XML changes in the previous patch to let SELinux
      labeling honor user overrides, as well as affecting the live XML
      configuration in one case where the user didn't specify anything
      in the offline XML.
      
      I noticed that the logs contained messages like this:
      
      2011-12-05 23:32:40.382+0000: 26569: warning : SELinuxRestoreSecurityFileLabel:533 : cannot lookup default selinux label for /nfs/libvirt/images/dom.img
      
      for all my domain images living on NFS.  But if we would just remember
      that on domain creation that we were unable to set a SELinux label (due to
      NFSv3 lacking labels, or NFSv4 not being configured to expose attributes),
      then we could avoid wasting the time trying to clear the label on
      domain shutdown.  This in turn is one less point of NFS failure,
      especially since there have been documented cases of virDomainDestroy
      hanging during an attempted operation on a failed NFS connection.
      
      * src/security/security_selinux.c (SELinuxSetFilecon): Move guts...
      (SELinuxSetFileconHelper): ...to new function.
      (SELinuxSetFileconOptional): New function.
      (SELinuxSetSecurityFileLabel): Honor override label, and remember
      if labeling failed.
      (SELinuxRestoreSecurityImageLabelInt): Skip relabeling based on
      override.
      904e05a2
    • E
      seclabel: allow a seclabel override on a disk src · b4343293
      Eric Blake 提交于
      Implement the parsing and formatting of the XML addition of
      the previous commit.  The new XML doesn't affect qemu command
      line, so we can now test round-trip XML->memory->XML handling.
      
      I chose to reuse the existing structure, even though per-device
      override doesn't use all of those fields, rather than create a
      new structure, in order to reuse more code.
      
      * src/conf/domain_conf.h (_virDomainDiskDef): Add seclabel member.
      * src/conf/domain_conf.c (virDomainDiskDefFree): Free it.
      (virSecurityLabelDefFree): New function.
      (virDomainDiskDefFormat): Print it.
      (virSecurityLabelDefFormat): Reduce output if model not present.
      (virDomainDiskDefParseXML): Alter signature, and parse seclabel.
      (virSecurityLabelDefParseXML): Split...
      (virSecurityLabelDefParseXMLHelper): ...into new helper.
      (virDomainDeviceDefParse, virDomainDefParseXML): Update callers.
      * tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic-override.args:
      New file.
      * tests/qemuxml2xmltest.c (mymain): Enhance test.
      * tests/qemuxml2argvtest.c (mymain): Likewise.
      b4343293
    • E
      seclabel: move seclabel stuff earlier · e8383794
      Eric Blake 提交于
      Pure code motion; no semantic change.
      
      * src/conf/domain_conf.h (virDomainSeclabelType)
      (virSecurityLabelDefPtr): Declare earlier.
      * src/conf/domain_conf.c (virSecurityLabelDefClear)
      (virSecurityLabelDefParseXML): Move earlier.
      (virDomainDefParseXML): Move seclabel parsing earlier.
      e8383794
    • E
      seclabel: refactor existing domain_conf usage · 336df796
      Eric Blake 提交于
      A future patch will parse and output <seclabel> in more than one
      location in a <domain> xml; make it easier to reuse code.
      
      * src/conf/domain_conf.c (virSecurityLabelDefFree): Rename...
      (virSecurityLabelDefClear): ...and make static.
      (virSecurityLabelDefParseXML): Alter signature.
      (virDomainDefParseXML, virDomainDefFree): Adjust callers.
      (virDomainDefFormatInternal): Split output...
      (virSecurityLabelDefFormat): ...into new helper.
      336df796
  3. 29 12月, 2011 5 次提交
  4. 28 12月, 2011 1 次提交
  5. 25 12月, 2011 1 次提交
  6. 23 12月, 2011 1 次提交
  7. 22 12月, 2011 1 次提交
  8. 21 12月, 2011 10 次提交
  9. 20 12月, 2011 1 次提交
    • E
      rpc: handle param_int, plug memory leaks · 4e394dea
      Eric Blake 提交于
      The RPC code had several latent memory leaks and an attempt to
      free the wrong string, but thankfully nothing triggered them
      (blkiotune was the only one returning a string, and always as
      the last parameter).  Also, our cleanups for rpcgen ended up
      nuking a line of code that renders VIR_TYPED_PARAM_INT broken,
      because it was the only use of 'i' in a function, even though
      it was a member usage rather than a standalone declaration.
      
      * daemon/remote.c (remoteSerializeTypedParameters): Free the
      correct array element.
      (remoteDispatchDomainGetSchedulerParameters)
      (remoteDispatchDomainGetSchedulerParametersFlags)
      (remoteDispatchDomainBlockStatsFlags)
      (remoteDispatchDomainGetMemoryParameters): Don't leak strings.
      * src/rpc/genprotocol.pl: Don't nuke member-usage of 'buf' or 'i'.
      4e394dea
  10. 19 12月, 2011 8 次提交
    • D
      Only add the timer when a callback is registered · 707781fe
      Daniel P. Berrange 提交于
      The lifetime of the virDomainEventState object is tied to
      the lifetime of the driver, which in stateless drivers is
      tied to the lifetime of the virConnectPtr.
      
      If we add & remove a timer when allocating/freeing the
      virDomainEventState object, we can get a situation where
      the timer still triggers once after virDomainEventState
      has been freed. The timeout callback can't keep a ref
      on the event state though, since that would be a circular
      reference.
      
      The trick is to only register the timer when a callback
      is registered with the event state & remove the timer
      when the callback is unregistered.
      
      The demo for the bug is to run
      
        while true ; do date ; ../tools/virsh -q -c test:///default 'shutdown test; undefine test; dominfo test' ; done
      
      prior to this fix, it will frequently hang and / or
      crash, or corrupt memory
      707781fe
    • D
      Hide use of timers for domain event dispatch · 34ad1353
      Daniel P. Berrange 提交于
      Currently all drivers using domain events need to provide a callback
      for handling a timer to dispatch events in a clean stack. There is
      no technical reason for dispatch to go via driver specific code. It
      could trivially be dispatched directly from the domain event code,
      thus removing tedious boilerplate code from all drivers
      
      Also fix the libxl & xen drivers to pass 'true' when creating the
      virDomainEventState, since they run inside the daemon & thus always
      expect events to be present.
      
      * src/conf/domain_event.c, src/conf/domain_event.h: Internalize
        dispatch of events from timer callback
      * src/libxl/libxl_driver.c, src/lxc/lxc_driver.c,
        src/qemu/qemu_domain.c, src/qemu/qemu_driver.c,
        src/remote/remote_driver.c, src/test/test_driver.c,
        src/uml/uml_driver.c, src/vbox/vbox_tmpl.c,
        src/xen/xen_driver.c: Remove all timer dispatch functions
      34ad1353
    • D
      Remove decl of all APIs related to domain event callbacks & queues · 2c2d5337
      Daniel P. Berrange 提交于
      The virDomainEventCallbackList and virDomainEventQueue APIs are
      now solely helpers used internally by virDomainEventState APIs.
      Remove their decls from domain_event.h since no driver code should
      need to use them any more.
      
      * src/conf/domain_event.c: Make virDomainEventCallbackList and
        virDomainEventQueue APIs static & remove some unused APIs
      * src/conf/domain_event.h, src/libvirt_private.syms: Remove
        virDomainEventCallbackList and virDomainEventQueue APIs
      2c2d5337
    • D
      Remove all domain event structs from header · 06eb22df
      Daniel P. Berrange 提交于
      No caller of the domain events APIs should need to poke at the
      struct internals. Thus they should all be removed from the
      header file
      
      * src/conf/domain_event.h: Remove struct definitions
      * src/conf/domain_event.c: Add struct definitions
      06eb22df
    • D
      Convert drivers to thread safe APIs for adding callbacks · 7b87a30f
      Daniel P. Berrange 提交于
      * src/libxl/libxl_driver.c, src/lxc/lxc_driver.c,
        src/qemu/qemu_driver.c, src/remote/remote_driver.c,
        src/test/test_driver.c, src/uml/uml_driver.c,
        src/vbox/vbox_tmpl.c, src/xen/xen_driver.c: Convert
        to threadsafe APIs
      7b87a30f
    • D
      Add APIs to allow management of callbacks purely with virDomainEventState · 4f5326c3
      Daniel P. Berrange 提交于
      While virDomainEventState has APIs for managing removal of callbacks,
      while locked, adding callbacks in the first place requires direct
      access to the virDomainEventCallbackList structure. This is not
      threadsafe since it is bypassing the virDomainEventState locks
      
      * src/conf/domain_event.c, src/conf/domain_event.h,
        src/libvirt_private.syms: Add APIs for managing callbacks
        via virDomainEventState.
      4f5326c3
    • D
      Return count of callbacks when registering callbacks · d09f6ba5
      Daniel P. Berrange 提交于
      When registering a callback for a particular event some callers
      need to know how many callbacks already exist for that event.
      While it is possible to ask for a count, this is not free from
      race conditions when threaded. Thus the API for registering
      callbacks should return the count of callbacks. Also rename
      virDomainEventStateDeregisterAny to virDomainEventStateDeregisterID
      
      * src/conf/domain_event.c, src/conf/domain_event.h,
        src/libvirt_private.syms: Return count of callbacks when
        registering callbacks
      * src/libxl/libxl_driver.c, src/libxl/libxl_driver.c,
        src/qemu/qemu_driver.c, src/remote/remote_driver.c,
        src/remote/remote_driver.c, src/uml/uml_driver.c,
        src/vbox/vbox_tmpl.c, src/xen/xen_driver.c: Update
        for change in APIs
      d09f6ba5
    • D
      Convert Xen & VBox drivers to use virDomainEventState · a86bbc60
      Daniel P. Berrange 提交于
      The Xen & VBox drivers deal with callbacks & dispatching of
      events directly. All the other drivers use a timer to dispatch
      events from a clean stack state, rather than deep inside the
      drivers. Convert Xen & VBox over to virDomainEventState so
      that they match behaviour of other drivers
      
      * src/conf/domain_event.c: Return count of remaining
        callbacks when unregistering event callback
      * src/vbox/vbox_tmpl.c, src/xen/xen_driver.c,
        src/xen/xen_driver.h: Convert to virDomainEventState
      a86bbc60
  11. 17 12月, 2011 1 次提交
  12. 16 12月, 2011 4 次提交
    • P
      migration: Add more specific error code/message on migration abort · 8fb2aeb6
      Peter Krempa 提交于
      A generic error code was returned, if the user aborted a migration job.
      This made it hard to distinguish between a user requested abort and an
      error that might have occured. This patch introduces a new error code,
      which is returned in the specific case of a user abort, while leaving
      all other failures with their existing code. This makes it easier to
      distinguish between failure while mirgrating and an user requested
      abort.
      
       * include/libvirt/virterror.h: - add new error code
       * src/util/virterror.c: - add message for the new error code
       * src/qemu/qemu_migration.h: - Emit operation aborted error instead of
                                      operation failed, on migration abort
      8fb2aeb6
    • E
      qemu: detect truncated file as invalid save image · d99fe011
      Eric Blake 提交于
      If managed save fails at the right point in time, then the save
      image can end up with 0 bytes in length (no valid header), and
      our attempts in commit 55d88def to detect and skip invalid save
      files missed this case.
      
      * src/qemu/qemu_driver.c (qemuDomainSaveImageOpen): Also unlink
      empty file as corrupt.  Reported by Dennis Householder.
      d99fe011
    • M
      qemu: Don't drop hostdev config until security label restore · 13d5a6b8
      Michal Privoznik 提交于
      Currently, on device detach, we parse given XML, find the device
      in domain object, free it and try to restore security labels.
      However, in some cases (e.g. usb hostdev) parsed XML contains
      less information than freed device. In usb case it is bus & device
      IDs. These are needed during label restoring as a symlink into
      /dev/bus is generated from them. Therefore don't drop device
      configuration until security labels are restored.
      13d5a6b8
    • J
      Fix default migration speed in qemu driver · d8916dc8
      Jim Fehlig 提交于
      In commit 6f84e110 I mistakenly set default migration speed to
      33554432 Mb!  The units of migMaxBandwidth is Mb, with conversion
      handled in qemuMonitor{JSON,Text}SetMigrationSpeed().
      
      Also, remove definition of QEMU_DOMAIN_FILE_MIG_BANDWIDTH_MAX since
      it is no longer used after reverting commit ef1065cf.
      d8916dc8
  13. 15 12月, 2011 1 次提交
    • J
      qemu: Fix race between async and query jobs · 6948b725
      Jiri Denemark 提交于
      If an async job run on a domain will stop the domain at the end of the
      job, a concurrently run query job can hang in qemu monitor and nothing
      can be done with that domain from this point on. An attempt to start
      such domain results in "Timed out during operation: cannot acquire state
      change lock" error.
      
      However, quite a few things have to happen at the right time... There
      must be an async job running which stops a domain at the end. This race
      was reported with dump --crash but other similar jobs, such as
      (managed)save and migration, should be able to trigger this bug as well.
      While this async job is processing its last monitor command, that is a
      query-migrate to which qemu replies with status "completed", a new
      libvirt API that results in a query job must arrive and stay waiting
      until the query-migrate command finishes. Once query-migrate is done but
      before the async job closes qemu monitor while stopping the domain, the
      other thread needs to wake up and call qemuMonitorSend to send its
      command to qemu. Before qemu gets a chance to respond to this command,
      the async job needs to close the monitor. At this point, the query job
      thread is waiting for a condition that no-one will ever signal so it
      never finishes the job.
      6948b725