1. 21 1月, 2014 5 次提交
  2. 20 1月, 2014 15 次提交
  3. 18 1月, 2014 1 次提交
  4. 17 1月, 2014 8 次提交
    • M
      virSecuritySELinuxSetFileconHelper: Don't fail on read-only NFS · d1fdecb6
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=996543
      
      When starting up a domain, the SELinux labeling is done depending on
      current configuration. If the labeling fails we check for possible
      causes, as not all labeling failures are fatal. For example, if the
      labeled file is on NFS which lacks SELinux support, the file can still
      be readable to qemu process. These cases are distinguished by the errno
      code: NFS without SELinux support returns EOPNOTSUPP. However, we were
      missing one scenario. In case there's a read-only disk on a read-only
      NFS (and possibly any FS) and the labeling is just optional (not
      explicitly requested in the XML) there's no need to make the labeling
      error fatal. In other words, read-only file on read-only NFS can fail to
      be labeled, but be readable at the same time.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      d1fdecb6
    • E
      maint: replace remaining virLib*Error with better names · 42358e3a
      Eric Blake 提交于
      Finish the cleanup of libvirt.c; all uses of virLib*Error have
      now been converted to more canonical conventions.
      
      * src/libvirt.c: Use virReportError in remaining errors.
      (virLibConnError, virLibDomainError): Delete unused macros.
      * cfg.mk (msg_gen_function): Drop unused names.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      42358e3a
    • E
      maint: simplify driver registration at startup · 323c2cc4
      Eric Blake 提交于
      We had a lot of repetition of errors that would occur if we
      ever register too many drivers; this is unlikely to occur
      unless we start adding a lot of new hypervisor modules, but
      if it does occur, it's better to have uniform handling of the
      situation, so that a one-line change is all that would be
      needed if we decide that an internal error is not the best.
      
      * src/libvirt.c (virDriverCheckTabMaxReturn): New define.
      (virRegister*Driver): Use it for less code duplication.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      323c2cc4
    • E
      maint: clean up error reporting in migration · 27553573
      Eric Blake 提交于
      The choice of error message and category was not consistent
      in the migration code; furthermore, the use of virLibConnError
      is no longer necessary now that we have a generic virReportError.
      
      * src/qemu/qemu_migration.c (virDomainMigrate*): Prefer
      virReportError over virLibConnError.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      27553573
    • E
      maint: don't lose error on canceled migration · c8ed177a
      Eric Blake 提交于
      While auditing the error reporting, I noticed that migration
      had some issues.  Some of the static helper functions tried
      to call virDispatchError(), even though their caller will also
      report the error.  Also, if a migration is cancelled early
      because a uri was not set, we did not guarantee that the finish
      stage would not overwrite the first error message.
      
      * src/qemu/qemu_migration.c (doPeer2PeerMigrate2)
      (doPeer2PeerMigrate3): Preserve first error when cancelling.
      * src/libvirt.c (virDomainMigrateVersion3Full): Likewise.
      (virDomainMigrateVersion1, virDomainMigrateVersion2)
      (virDomainMigrateDirect): Avoid redundant error dispatch.
      (virDomainMigrateFinish2, virDomainMigrateFinish3)
      (virDomainMigrateFinish3Params): Don't report error on cleanup
      path.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      c8ed177a
    • E
      maint: avoid nested use of virConnect{Ref,Close} · 25221a1b
      Eric Blake 提交于
      The public virConnectRef and virConnectClose API are just thin
      wrappers around virObjectRef/virObjectRef, with added object
      validation and an error reset.  Within our backend drivers, use
      of the object validation is just an inefficiency since we always
      pass valid objects.  More important to think about is what
      happens with the error reset; our uses of virConnectRef happened
      to be safe (since we hadn't encountered any earlier errors), but
      in several cases the use of virConnectClose could lose a real
      error.
      
      Ideally, we should also avoid calling virConnectOpen() from
      within backend drivers - but that is a known situation that
      needs much more design work.
      
      * src/qemu/qemu_process.c (qemuProcessReconnectHelper)
      (qemuProcessReconnect): Avoid nested public API call.
      * src/qemu/qemu_driver.c (qemuAutostartDomains)
      (qemuStateInitialize, qemuStateStop): Likewise.
      * src/qemu/qemu_migration.c (doPeer2PeerMigrate): Likewise.
      * src/storage/storage_driver.c (storageDriverAutostart):
      Likewise.
      * src/uml/uml_driver.c (umlAutostartConfigs): Likewise.
      * src/lxc/lxc_process.c (virLXCProcessAutostartAll): Likewise.
      (virLXCProcessReboot): Likewise, and avoid leaking conn on error.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      25221a1b
    • E
      maint: don't leave garbage on early API exit · c05aebfd
      Eric Blake 提交于
      Several APIs clear out a user input buffer before attempting to
      populate it; but in a few cases we missed this memset if we
      detect a reason for an early exit.  Note that these APIs
      check for non-NULL arguments, and exit early with an error
      message when NULL is passed in; which means that we must be
      careful to avoid a NULL deref in order to get to that error
      message.  Also, we were inconsistent on the use of
      sizeof(virType) vs. sizeof(expression); the latter is more
      robust if we ever change the type of the expression (although
      such action is unlikely since these types are part of our
      public API).
      
      * src/libvirt.c (virDomainGetInfo, virDomainGetBlockInfo)
      (virStoragePoolGetInfo, virStorageVolGetInfo)
      (virDomainGetJobInfo, virDomainGetBlockJobInfo): Move memset
      before any returns.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      c05aebfd
    • M
      qemu: Change the default unix monitor timeout · fe89b687
      Martin Kletzander 提交于
      There is a number of reported issues when we fail starting a domain.
      Turns out that, in some scenarios like high load, 3 second timeout is
      not enough for qemu to start up to the phase where the socket is
      created.  Since there is no downside of waiting longer, raise the
      timeout right to 30 seconds.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      fe89b687
  5. 16 1月, 2014 11 次提交