1. 25 11月, 2014 6 次提交
  2. 24 11月, 2014 7 次提交
  3. 22 11月, 2014 5 次提交
    • J
      libxl: destroy domain in migration finish phase on failure · 42874fa4
      Jim Fehlig 提交于
      This patch contains three domain cleanup improvements in the migration
      finish phase, ensuring a domain is properly disposed when a failure is
      detected or the migration is cancelled.
      
      The check for virDomainObjIsActive is moved to libxlDomainMigrationFinish,
      where cleanup can occur if migration failed and the domain is inactive.
      
      The 'cleanup' label was missplaced in libxlDomainMigrationFinish, causing
      a migrated domain to remain in the event of an error or cancelled migration.
      
      In cleanup, the domain was not removed from the driver's list of domains.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      42874fa4
    • J
      libxl: start domain paused on migration dst · 60386825
      Jim Fehlig 提交于
      During the perform phase of migration, the domain is started on
      the dst host in a running state if VIR_MIGRATE_PAUSED flag is not
      specified.  In the finish phase, the domain is also unpaused if
      VIR_MIGRATE_PAUSED flag is unset.  I've noticed this second unpause
      fails if the domain was already unpaused following the perform phase.
      
      This patch changes the perform phase to always start the domain
      paused, and defers unpausing, if requested, to the finish phase.
      Unpausing should occur in the finish phase anyhow, where the domain
      can be properly destroyed if the perform phase fails and migration
      is cancelled.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      60386825
    • J
      libxl: acquire job in migration finish phase · a1f38951
      Jim Fehlig 提交于
      Moving data reception of the perform phase of migration to a
      thread introduces a race with the finish phase, where checking
      if the domain is active races with the thread finishing the
      perform phase.  The race is easily solved by acquiring a job in
      the finish phase, which must wait for the perform phase job to
      complete.
      
      While wrapping the finish phase in a job, noticed the virDomainObj
      was being unlocked in a callee - libxlDomainMigrationFinish.  Move
      the unlocking to libxlDomainMigrateFinish3Params, where the lock
      is acquired.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      a1f38951
    • J
      libxl: Receive migration data in a thread · cb88d433
      Jim Fehlig 提交于
      The libxl driver receives migration data within an IO callback invoked
      by the event loop, effectively disabling the event loop while migration
      occurs.
      
      This patch moves receving of the migration data to a thread.  The
      incoming connection is still accepted in the IO callback, but control
      is immediately returned to the event loop after spawning the thread.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      cb88d433
    • I
      libxl: Allow libxl to find pygrub binary. · d70a51d5
      Ian Campbell 提交于
      Specifying an explicit path to pygrub (e.g. BINDIR "/pygrub") only works if
      Xen and libvirt happen to be installed to the same prefix. A more flexible
      approach is to simply specify "pygrub" which will cause libxl to use the
      correct path which it knows (since it is built with the same prefix as pygrub).
      
      This is particular problematic in the Debian packaging, since the Debian Xen
      package relocates pygrub into a libexec dir, however I think this change makes
      sense upstream.
      Signed-off-by: NIan Campbell <ian.campbell@citrix.com>
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      d70a51d5
  4. 21 11月, 2014 15 次提交
    • P
      storage: rbd: Implement support for passing config file option · b7d1bee2
      Peter Krempa 提交于
      To be able to express some use cases of the RBD backing with libvirt, we
      need to be able to specify a config file for the RBD client to qemu as
      that is one of the commonly used options.
      b7d1bee2
    • P
      storage: rbd: qemu: Add support for specifying internal RBD snapshots · 02556606
      Peter Krempa 提交于
      Some storage systems have internal support for snapshots. Libvirt should
      be able to select a correct snapshot when starting a VM.
      
      This patch adds a XML element to select a storage source snapshot for
      the RBD protocol which supports this feature.
      02556606
    • P
      storage: Allow parsing of RBD backing strings when building backing chain · 930b7759
      Peter Krempa 提交于
      As we now have a common function to parse backing store string for RBD
      backing store we can reuse it in the backing store walker so that we
      don't fail on files backed by RBD storage.
      
      This patch also adds a few tests to verify that the parsing works as
      expected.
      930b7759
    • P
      util: storagefile: Split out parsing of NBD string into a separate func · b327df87
      Peter Krempa 提交于
      Split out the code so that the function looks homogenous after adding
      more protocol specific parsers.
      b327df87
    • P
      util: split out qemuParseRBDString into a common helper · 5604c056
      Peter Krempa 提交于
      To allow reuse this non-trivial parser code in the backing store parser
      this part of the command line parser needs to be split out into a
      separate funciton.
      5604c056
    • P
      qemu: Refactor qemuBuildNetworkDriveURI to take a virStorageSourcePtr · dc0175f5
      Peter Krempa 提交于
      Instead of splitting out various fields, pass the complete structure and
      let the function pick various things of it.
      
      As one of the callers isn't using virStorageSourcePtr to store the data,
      this patch adds glue code that fills the data into a dummy
      virStorageSourcePtr before calling the func.
      
      This change will help when adding new fields that need output processing
      in the future.
      dc0175f5
    • P
      util: storage: Copy hosts of a storage file only if they exist · c264ea58
      Peter Krempa 提交于
      If there are no hosts for a storage source virStorageSourceCopy and
      virStorageSourceNewFromBackingRelative would try to copy them anyways.
      As the success of virStorageNetHostDefCopy is determined by returning
      a pointer and malloc of 0 elements might return NULL according to the
      implementation, the result of the copy function may vary.
      
      Fix this by copying the hosts array only if there are hosts defined.
      c264ea58
    • P
      util: storage: Add notice for extension of struct virStorageSource · ceb3e595
      Peter Krempa 提交于
      As we now have a deep copy function for struct virStorageSource add a
      notice that extensions of the structure require also appropriate changes
      to the virStorageSourceCopy func.
      ceb3e595
    • P
      util: buffer: Clarify scope of the escape operation in virBufferEscape · 7be41e78
      Peter Krempa 提交于
      The escaping is applied only to the string, not the format argument.
      State this fact in the docs.
      7be41e78
    • P
      qemu: Add handling for VSERPORT_CHANGE event · 15bbaaf0
      Peter Krempa 提交于
      New qemu added a new event that is emitted when a virtio serial channel
      is opened in the guest OS. This allows us to update the state of the
      port in the output-only XML element.
      
      This patch implements the monitor callbacks and necessary handlers to
      update the state in the definition.
      15bbaaf0
    • P
      conf: Add channel state for virtio channels to the XML · 24c25a68
      Peter Krempa 提交于
      To track state of virtio channels this patch adds a new output-only
      attribute called 'state' to the <target> element of virtio channels.
      
      This will be later populated with the guest state of the channel.
      24c25a68
    • P
      qemu: monitor: Rename and improve qemuMonitorGetPtyPaths · e9a45069
      Peter Krempa 提交于
      To unify future additions that require information from "query-chardev"
      rename qemuMonitorGetPtyPaths and friends to qemuMonitorGetChardevInfo
      and move the allocation of the returned hash into the top level
      function.
      e9a45069
    • P
      conf: Annotate source enums for character device struct members · df44e3ee
      Peter Krempa 提交于
      Add a comment to track which values may be present in certain members of
      a struct _virDomainChrDef.
      df44e3ee
    • P
      qemu: process: report useful error if alias formatting fails · 6692ba73
      Peter Krempa 提交于
      When retrieving the paths for PTY devices the alias gets formatted into
      a static string. If it doesn't fit we wouldn't report an error.
      6692ba73
    • P
      storage: qemu: Fix security labelling of new image chain elements · 7e130e8b
      Peter Krempa 提交于
      When creating a disk image snapshot the libvirt code would blindly copy
      the parents label to the newly created image. This runs into problems
      when you start a VM from an image hosted on NFS (or other storage system
      that doesn't support selinux labels) and the snapshot destination is on
      a storage system that does support selinux labels. Libvirt's code in
      that case generates a different security label for the image hosted on
      NFS. This label is valid only for NFS images and doesn't allow access in
      case of a locally stored image.
      
      To fix this issue libvirt needs to refrain from copying security
      information in cases where the default domain seclabel is a better
      choice.
      
      This patch repurposes the now unused @force argument of
      virStorageSourceInitChainElement to denote whether a copy of the
      security labelling stuff should be attempted or not. This allows to
      fine-control the copy operation for cases where we need to keep the
      label of the old disk vs. the cases where we need to keep the label
      unset to use the default domain imagelabel.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1151718
      7e130e8b
  5. 20 11月, 2014 7 次提交
    • E
      build: fix build when not using dbus · be90aa00
      Eric Blake 提交于
      Commit c0e70221 breaks on a machine that lacks dbus headers:
      
      In file included from util/virdbus.c:24:0:
      util/virdbuspriv.h:31:3: error: unknown type name 'dbus_int16_t'
      
      * src/util/virdbuspriv.h (DBusBasicValue): Only provide fallback
      when dbus is compiled.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      be90aa00
    • J
      storage: Add thread to refresh for createVport · 512b8747
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1152382
      
      When libvirt create's the vport (VPORT_CREATE) for the vHBA, there isn't
      enough "time" between the creation and the running of the following
      backend->refreshPool after a backend->startPool in order to find the LU's.
      Population of LU's happens asynchronously when udevEventHandleCallback
      discovers the "new" vHBA port.  Creation of the infrastructure by udev
      is an iterative process creating and discovering actual storage devices and
      adjusting the environment.
      
      Because of the time it takes to discover and set things up, the backend
      refreshPool call done after the startPool call will generally fail to
      find any devices. This leaves the newly started pool appear empty when
      querying via 'vol-list' after startup. The "workaround" has always been
      to run pool-refresh after startup (or any time thereafter) in order to
      find the LU's. Depending on how quickly run after startup, this too may
      not find any LUs in the pool. Eventually though given enough time and
      retries it will find something if LU's exist for the vHBA.
      
      This patch adds a thread to be executed after the VPORT_CREATE which will
      attempt to find the LU's without requiring the external run of refresh-pool.
      It does this by waiting for 5 seconds and searching for the LU's. If any
      are found, then the thread completes; otherwise, it will retry once more
      in another 5 seconds.  If none are found in that second pass, the thread
      gives up.
      
      Things learned while investigating this... No need to try and fill the
      pool too quickly or too many times. Over the course of creation, the udev
      code may 'add', 'change', and 'delete' the same device. So if the refresh
      code runs and finds something, it may display it only to have a subsequent
      refresh appear to "lose" the device. The udev processing doesn't seem to
      have a way to indicate that it's all done with the creation processing of a
      newly found vHBA. Only the Lone Ranger has silver bullets to fix everything.
      512b8747
    • J
      storage: Fix issue finding LU's when block doesn't exist · 20870417
      John Ferlan 提交于
      Fix a problem in the getBlockDevice and processLU where retval initialized
      to zero causing some failures to erroneously continue through to the
      virStorageBackendSCSINewLun with an attempt to find a path for "/dev/(null)".
      This would fail approximately 10 seconds later with debug message:
      
      virStorageBackendSCSINewLun:203 :
           No stable path found for '/dev/(null)' in '/dev/disk/by-path'
      
      The root cause of the issue is for many /sys/bus/scsi/devices/<lun path>
      there is no "block*" device found for the vHBA's, where "<lun path>" are
      the various paths created for the vHBA, such as "17:0:0:0", "17:0:1:0",
      "17:0:2:0", "17:0:3:0", etc.  If the block device isn't found, then the
      directory should just be ignored rather than attempting to process it.
      
      The bug was that in getBlockDevice the assumption was "block" would exist
      and either getNewStyleBlockDevice or getOldStyleBlockDevice would fill in
      @block_device. However, if 'block*' doesn't exist, then the code returned
      NULL for block_device *and* a good (zero) retval value.  This caused the
      processLU code to attempt the virStorageBackendSCSINewLun which failed
      "at some point in time" in the future.
      
      After this change - on test system the refresh-pool didn't have a noticable
      pause of about 20 seconds - it completed within a second since no longer
      was there an attempt/need to find "/dev/(null)".
      
      Additionally, the virStorageBackendSCSIFindLU's shouldn't be declaring
      found unless the processLU actually returns success. This will be
      important in the followup patch which relies on whether a LU was found.
      20870417
    • E
      build: fix build with older dbus headers · c0e70221
      Eric Blake 提交于
      Compilation on a RHEL 5 host failed, due to the older dbus headers
      present on that machine, and triggered by commit 2aa167ca:
      
      util/virdbus.c: In function 'virDBusMessageIterDecode':
      util/virdbus.c:952: error: 'DBusBasicValue' undeclared (first use in this function)
      
      * m4/virt-dbus.m4 (LIBVIRT_CHECK_DBUS): Check for DBusBasicValue.
      * src/util/virdbuspriv.h (DBusBasicValue): Provide fallback.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      c0e70221
    • G
      rpc: do not fail if the pid of the connecting process is not set · 225f4833
      Giuseppe Scrivano 提交于
      getsockopt(sock->fd, SOL_SOCKET, SO_PEERCRED, ...) sets the pid to 0
      when the process that opens the connection is in another container.
      Signed-off-by: NGiuseppe Scrivano <gscrivan@redhat.com>
      225f4833
    • E
      util: don't log failure when older iptables lacks -w · 5bc033e2
      Eric Blake 提交于
      Commit dc33e6e4 caused older platforms like Fedora 20 to emit
      scary log messages at startup:
      
      2014-11-19 23:12:58.800+0000: 28906: error : virCommandWait:2532 : internal error: Child process (/usr/sbin/iptables -w -L -n) unexpected exit status 2: iptables v1.4.19.1: unknown option "-w"
      Try `iptables -h' or 'iptables --help' for more information.
      
      Since we are probing and expect to handle the case where -w is not
      supported, we should not let virCommand log it as an error.
      
      * src/util/virfirewall.c (virFirewallCheckUpdateLock): Handle
      non-zero status ourselves.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      5bc033e2
    • J
      qemu: Really fix crash in tunnelled migration · 800454e4
      Jiri Denemark 提交于
      Oops, I forgot to squash one more instance of the same check in the
      previous commit (v1.2.10-144-g52691f99).
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1147331Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      800454e4