1. 29 5月, 2014 9 次提交
  2. 28 5月, 2014 1 次提交
  3. 27 5月, 2014 2 次提交
  4. 26 5月, 2014 6 次提交
    • D
      Fix an extra ' in a translated string · f07d24a6
      Daniel Veillard 提交于
      Raised by ukrainian translator Yuri Chornoivan
      https://fedora.transifex.com/projects/p/libvirt/translate/#uk/strings/25483059
      f07d24a6
    • J
      Clean up chardev sockets on QEMU shutdown · 205010c4
      Ján Tomko 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1088787
      
      Clean up unix socket files for chardevs using mode='bind',
      like we clean up the monitor socket.
      They are created by QEMU on startup and not really useful
      after shutting it down.
      205010c4
    • L
      qemu: fix <clock offset='variable' basis='localtime'/> · cde8ca2d
      Laine Stump 提交于
      For a clock element as above, libvirt simply converts current system
      time with localtime_r(), then starts qemu with a time string that
      doesn't contain any timezone information. So, from qemu's point of
      view, the -rtc string it gets for:
      
         <clock offset='variable' basis='utc' adjustment='10800'/>
      
      is identical to the -rtc string it gets for:
      
         <clock offset='variable' basis='localtime' adjustment='0'/>
      
      (assuming the host is in a timezone that is 10800 seconds ahead of
      UTC, as is the case on the machine where this message is being
      written).
      
      Since the commandlines are identical, qemu will behave identically
      after this point in either case.
      
      There are two problems in the case of basis='localtime' though:
      
      Problem 1) If the guest modifies its RTC, for example to add 20
      seconds, the RTC_CHANGE event from qemu will then contain offset:20 in
      both cases. But libvirt will have saved the original adjustment into
      adjustment0, and will add that value onto the offset in the
      event. This means that in the case of basis=;utc', it will properly
      emit an event with offset:10820, but in the case of basis='localtime'
      the event will contain offset:20, which is *not* the new offset of the
      RTC from UTC (as the event it documented to provide).
      
      Problem 2) If the guest is migrated to another host that is in a
      different timezone, or if it is migrated or saved/restored after the
      DST status has changed from what it was when the guest was originally
      started, the newly restarted guest will have a different RTC (since it
      will be based on the new localtime, which could have shifted by
      several hours).
      
      The solution to both of these problems is simple - rather than
      maintaining the original adjustment value along with
      "basis='localtime'" in the domain status, when the domain is started
      we convert the adjustment offset to one relative to UTC, and set the
      status to "basis='utc'". Thus, whatever the RTC offset was from UTC
      when it was initially started, that offset will be maintained when
      migrating across timezones and DST settings, and the RTC_CHANGE events
      will automatically contain the proper offset (which should by
      definition always be relative to UTC).
      
      This fixes a problem that was implied but not openly stated in:
      
        https://bugzilla.redhat.com/show_bug.cgi?id=964177
      cde8ca2d
    • L
      qemu: fix RTC_CHANGE event for <clock offset='variable' basis='utc'/> · b62d67da
      Laine Stump 提交于
      commit e31b5cf3 attempted to fix libvirt's
      VIR_DOMAIN_EVENT_ID_RTC_CHANGE, which is documentated to always
      provide the new offset of the domain's real time clock from UTC. The
      problem was that, in the case that qemu is provided with an "-rtc
      base=x" where x is an absolute time (rather than "utc" or
      "localtime"), the offset sent by qemu's RTC_CHANGE event is *not* the
      new offset from UTC, but rather is the sum of all changes to the
      domain's RTC since it was started with base=x.
      
      So, despite what was said in commit e31b5cf3, if we assume that
      the original value stored in "adjustment" was the offset from UTC at
      the time the domain was started, we can always determine the current
      offset from UTC by simply adding the most recent (i.e. current) offset
      from qemu to that original adjustment.
      
      This patch accomplishes that by storing the initial adjustment in the
      domain's status as "adjustment0". Each time a new RTC_CHANGE event is
      received from qemu, we simply add adjustment0 to the value sent by
      qemu, store that as the new adjustment, and forward that value on to
      any event handler.
      
      This patch (*not* e31b5cf3, which should be reverted prior to
      applying this patch) fixes:
      
      https://bugzilla.redhat.com/show_bug.cgi?id=964177
      
      (for the case where basis='utc'. It does not fix basis='localtime')
      b62d67da
    • L
      Revert "qemu: Report the offset from host UTC for RTC_CHANGE event" · b8efa6f2
      Laine Stump 提交于
      This reverts commit e31b5cf3.
      
      This commit attempted to work around a bug in the offset value
      reported by qemu's RTC_CHANGE event in the case that a variable base
      date was given on the qemu commandline. The patch mixed up the math
      involved in arriving at the corrected offset to report, and in the
      process added an unnecessary private attribute to the clock
      element. Since that element is private/internal and not used by anyone
      else, it makes sense to simplify things by removing it.
      b8efa6f2
    • L
      util: new function virTimeLocalOffsetFromUTC · 1cddaea7
      Laine Stump 提交于
      Since there isn't a single libc API to get this value, this patch
      supplies one which gets the value by grabbing current time, then
      converting that into a struct tm with gmtime_r(), then back to a
      time_t using mktime.
      
      The returned value is the difference between UTC and localtime in
      seconds. If localtime is ahead of UTC (east) the offset will be a
      positive number, and if localtime is behind UTC (west) the offset will
      be negative.
      
      This function should be POSIX-compliant, and is threadsafe, but not
      async signal safe. If it was ever necessary to know this value in a
      child process, we could cache it with a one-time init function when
      libvirtd starts, then just supply the cached value, but that
      complexity isn't needed for current usage; that would also have the
      problem that it might not be accurate after a local daylight savings
      boundary.
      
      (If it weren't for DST, we could simply replace this entire function
      with "-timezone"; timezone contains the offset of the current timezone
      (negated from what we want) but doesn't account for DST. And in spite
      of being guaranteed by POSIX, it isn't available on older versions of
      mingw.)
      Signed-off-by: NEric Blake <eblake@redhat.com>
      1cddaea7
  5. 23 5月, 2014 12 次提交
    • P
      storage: Add storage file API to read file headers · 81271a92
      Peter Krempa 提交于
      Add storage driver based functions to access headers of storage files
      for metadata extraction. Along with this patch a local filesystem and
      gluster via libgfapi implementation is provided. The gluster
      implementation is based on code of the saferead_lim function.
      81271a92
    • P
      storage: Add support for access to files using provided uid/gid · ae26731e
      Peter Krempa 提交于
      To allow using the storage driver APIs to access files on various
      storage sources in a universal fashion possibly on storage such as nfs
      with root squash we'll need to store the desired uid/gid in the
      metadata.
      
      Add new initialisation API that will store the desired uid/gid and a
      wrapper for the current use. Additionally add docs for the two APIs.
      ae26731e
    • P
      storage: Add NONE protocol type for network disks · a01d9357
      Peter Krempa 提交于
      Currently the protocol type with index 0 was NBD which made it hard to
      distinguish whether the protocol type was actually assigned. Add a new
      protocol type with index 0 to distinguish it explicitly.
      a01d9357
    • P
      conf: Fix domain disk path iterator to work with networked storage · b52e1ad9
      Peter Krempa 提交于
      Skip networked storage but continue iteration through backing chain to
      iterate through all the local paths in the backing chain.
      b52e1ad9
    • P
      storage: Rework debugging of storage file access through storage driver · 0620bd42
      Peter Krempa 提交于
      Print the debug statements of individual file access functions from the
      main API functions instead of the individual backend functions.
      
      Also enhance initialization debug messages on a per-backend basis.
      0620bd42
    • P
      storage: Store gluster volume name separately · 1115f975
      Peter Krempa 提交于
      The gluster volume name was previously stored as part of the source path
      string. This is unfortunate when we want to do operations on the path as
      the volume is used separately.
      
      Parse and store the volume name separately for gluster storage volumes
      and use the newly stored variable appropriately.
      1115f975
    • P
      qemu: Make qemuDomainPrepareDiskChainElement aware of remote storage · b8d6ba9b
      Peter Krempa 提交于
      Refactor the function to accept a virStorageSourcePtr instead of just
      the path, add a check to run it only on local storage and fix callers
      (possibly by using a newly introduced wrapper that wraps a path in the
       virStorageSource struct for legacy code)
      b8d6ba9b
    • P
      qemu: process: Refresh backing chain info when reconnecting to qemu · b3e99ad8
      Peter Krempa 提交于
      Refresh the disk backing chains when reconnecting to a qemu process
      after daemon restart. There are a few internal fields that don't get
      refreshed from the XML. Until we are able to do that, let's reload all
      the metadata by the backing chain crawler.
      b3e99ad8
    • J
      qemu: Properly abort migration to a file · 7757d83d
      Jiri Denemark 提交于
      This is similar to the previous commit in that we need to explicitly
      send migrate_cancel when libvirt detects an error other than those
      reported by query-migrate. However, the possibility to hit such error is
      pretty small.
      7757d83d
    • J
      qemu: Send migrate_cancel when aborting migration · e27d2897
      Jiri Denemark 提交于
      When QEMU reports failed or cancelled migration, we don't need to send
      it migrate_cancel QMP command. But in all other error paths, such as if
      we detect broken connection to a destination daemon or something else
      happens inside libvirt, we need to explicitly send migrate_cancel
      command instead of relying on the migration to be implicitly cancelled
      when destination QEMU is killed.
      
      Because we were not doing so, one could end up with a paused domain
      after failed migration.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1098833
      e27d2897
    • J
      Fix error message when TUNNELLED flag is used in non-p2p migration · 7bdc7702
      Jiri Denemark 提交于
      The current error message is
      
          error: use virDomainMigrateToURI3 for peer-to-peer migration
      
      which is correct but a bit misleading because the client did not specify
      VIR_MIGRATE_PEER2PEER flag. This patch changes the error message to
      
          error: cannot perform tunnelled migration without using peer2peer
          flag
      
      which is consistent with the error reported by older migration APIs.
      
      Reported by Rich Jones in
      https://bugzilla.redhat.com/show_bug.cgi?id=1095924
      7bdc7702
    • E
      conf: fix backing store parse off-by-one · aefd9bcf
      Eric Blake 提交于
      Commit 546154e3 parses the type attribute from a <backingStore>
      element, but forgot that the earlier commit 9673418c added a
      placeholder element in the same 1.2.3 release; as a result,
      the C code was mistakenly allowing "none" as a type.
      
      Similarly, the same commit allows "none" as the <format>
      sub-element type, even though that has been a placeholder
      since the 0.10.2 release with commit f772b3d9.
      
      * src/conf/domain_conf.c (virDomainDiskBackingStoreParse): Require
      non-zero types.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      aefd9bcf
  6. 22 5月, 2014 2 次提交
  7. 21 5月, 2014 8 次提交
    • R
      bhyve: fix virObjectUnlock() usage · 344582a8
      Roman Bogorodskiy 提交于
      In a number of places in the bhyve driver, virObjectUnlock()
      is called with an arg without check if the arg is non-NULL, which
      could result in passing NULL value and a warning like:
      
      virObjectUnlock:340 : Object 0x0 ((unknown)) is not a virObjectLockable instance
      
      * src/bhyve/bhyve_driver.c (bhyveDomainGetInfo)
      (bhyveDomainGetState, bhyveDomainGetAutostart)
      (bhyveDomainSetAutostart, bhyveDomainIsActive)
      (bhyveDomainIsPersistent, bhyveDomainGetXMLDesc)
      (bhyveDomainUndefine, bhyveDomainLookupByUUID)
      (bhyveDomainLookupByName, bhyveDomainLookupByID)
      (bhyveDomainCreateWithFlags, bhyveDomainOpenConsole):
      Check if arg is not NULL before calling virObjectUnlock on it.
      344582a8
    • C
      virdbus: Show method name in error message · b5180453
      Cole Robinson 提交于
      If you trigger bug 1033369, we get the error message:
      
        error from service: Invalid argument
      
      Which is a bit too generic to pinpoint what is actually failing. This
      changes it to:
      
        error from service: CreateMachine: Invalid argument
      Acked-by: NEric Blake <eblake@redhat.com>
      b5180453
    • C
      virdbus: Remove redundant error macro · aa7fc495
      Cole Robinson 提交于
      This is the only callsite.
      
      We drop use of localerror.name here, because it's not actually useful
      to us: rather than the parameter name which received an invalid value
      (which was assumed), it's actually the the dbus errno equivalent.
      Just use the error string.
      Acked-by: NEric Blake <eblake@redhat.com>
      aa7fc495
    • E
      tests: avoid dlsym mocking on mingw · fa8701ea
      Eric Blake 提交于
      I got a build failure when cross-compiling to mingw with the
      mingw64-dbus package installed:
      
        CC       virmockdbus_la-virmockdbus.lo
      ../../tests/virmockdbus.c:29:6: error: 'dbus_connection_set_change_sigpipe' redeclared without dllimport attribute: previous dllimport ignored [-Werror=attributes]
       VIR_MOCK_STUB_VOID_ARGS(dbus_connection_set_change_sigpipe,
            ^
      ../../tests/virmockdbus.c:33:18: error: 'dbus_bus_get' redeclared without dllimport attribute: previous dllimport ignored [-Werror=attributes]
       VIR_MOCK_STUB_RET_ARGS(dbus_bus_get,
      ...
      
      Well duh - mingw lacks dlopen and friends, even if it can support
      dbus.  A similar failure occured in virsystemdtest.c; but in that
      file, we know that systemd is a Linux-only concept.
      
      * tests/virmockdbus.c: Cripple on mingw.
      * tests/virsystemdtest.c: Cripple on non-Linux.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      fa8701ea
    • P
      qemu: snapshot: Fix return value of external checkpoint with no disks · cb6681ff
      Peter Krempa 提交于
      When doing an external checkpoint of a VM with no disk selected we'd
      return failure but not set error code. This was a result of ret not
      being set to 0 during walking of the disk array.
      
      Rework early failure checking and set the error code to success before
      iterating the array of disks so that we return success if no disks are
      snapshotted.
      
      Fixes the following symptom (or without --diskspec for diskless VMs)
      
       $ virsh snapshot-create-as snapshot-test  --memspec /tmp/asdf --diskspec hda,snapshot=no
       error: An error occurred, but the cause is unknown
      cb6681ff
    • P
      qemu: snapshot: Forbid empty snapshots · 91b7e068
      Peter Krempa 提交于
      If neither disks nor memory are selected for snapshot we'd record
      metadata in case of external snapshot and do a disk snapshot in case of
      external disk snapshot. Forbid this as it doesn't make much sense.
      91b7e068
    • P
      qemu: snapshot: Forbid partial internal snapshots · 03b4da13
      Peter Krempa 提交于
      qemu's savevm command does a snapshot of all non readonly disks of a VM.
      Libvirt though allowed disabling snapshot for certain disk of a VM.
      03b4da13
    • P
      qemu: snapshot: Use typecasted switch in qemuDomainSnapshotPrepare() · 68c15a4f
      Peter Krempa 提交于
      Convert the switch to a typecasted value so that the compiler tracks
      additions for us.
      68c15a4f