1. 09 10月, 2015 3 次提交
    • M
      virJSONValueArraySize: return ssize_t · 4f77c48c
      Michal Privoznik 提交于
      The internal representation of a JSON array counts the items in
      size_t. However, for some reason, when asking for the count it's
      reported as int. Firstly, we need the function to return a signed
      type as it's returning -1 on an error. But, not every system has
      integer the same size as size_t. Therefore, lets return ssize_t.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      4f77c48c
    • A
      src: Remove $(builddir) usage · 6c928996
      Andrea Bolognani 提交于
      Commit 4e803227 used $(builddir) in the header search
      path to fix a build issue; however, $(builddir) is not defined
      by old autoconf versions such as the one available in CentOS 5,
      resulting in the following error:
      
        cc1: error: /util: No such file or directory
        make[3]: *** [libvirt_driver_la-fdstream.lo] Error 1
      
      Since $(builddir) is defined to always be '.', just use that
      value directly instead.
      6c928996
    • A
      src: Include $(builddir)/util in the header search path · 4e803227
      Andrea Bolognani 提交于
      Since a9fe6203, we are generating virkeymaps.h at build
      time; however, we are not including $(builddir)/util in the
      header search path, so when doing a VPATH build the compiler
      is unable to locate the file.
      
      make[2]: Entering directory
      `/home/jenkins/libvirt/systems/libvirt-fedora-20/build/src'
        GEN      util/virkeymaps.h
        ...
        CC       util/libvirt_util_la-virkeycode.lo
        CC       util/libvirt_util_la-virkeyfile.lo
        CC       util/libvirt_util_la-virlockspace.lo
        CC       util/libvirt_util_la-virlog.lo
      ../../src/util/virkeycode.c:27:24: fatal error: virkeymaps.h: No such file or directory
       #include "virkeymaps.h"
                              ^
      compilation terminated.
      4e803227
  2. 08 10月, 2015 4 次提交
  3. 07 10月, 2015 7 次提交
  4. 06 10月, 2015 10 次提交
  5. 05 10月, 2015 13 次提交
    • J
      storage: Adjust calculation of alloc/capacity for disk · 1895b421
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1247987
      
      Calculation of the extended and logical partition values for the disk
      pool is complex. As the bz points out an extended partition should have
      it's allocation initialized to 0 (zero) and keep the capacity as the size
      dictated by the extents read.  Then for each logical partition found,
      adjust the allocation of the extended partition.
      
      Finally, previous logic tried to avoid recalculating things if a logical
      partition was deleted; however, since we now have special logic to handle
      the allocation of the extended partition, just make life easier by reading
      the partition table again - rather than doing the reverse adjustment.
      1895b421
    • J
      storage: Introduce virStorageBackendDiskStartPool · 657f3bea
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1251461
      
      When 'starting' up a disk pool, we need to make sure the label on the
      device is valid; otherwise, the followup refreshPool will assume the
      disk has been properly formatted for use. If we don't find the valid
      label, then refuse the start and give a proper reason.
      657f3bea
    • J
      storage: Add additional errors/checks for disk label · fba2076f
      John Ferlan 提交于
      Let's check to ensure we can find the Partition Table in the label
      and that libvirt actually recognizes that type; otherwise, when we
      go to read the partitions during a refresh operation we may not be
      reading what we expect.
      
      This will expand upon the types of errors or reason that a build
      would fail, so we can create more direct error messages.
      fba2076f
    • J
      storage: Add param to check whether we can write a disk label · 05c46f5c
      John Ferlan 提交于
      Modify virStorageBackendDiskValidLabel to add a 'writelabel' parameter.
      While initially for the purpose of determining whether the label should
      be written during DiskBuild, a future use during DiskStart could determine
      whether the pool should be started using the label found. Augment the
      error messages also to give a hint as to what someone may need to do
      or why the command failed.
      05c46f5c
    • J
      storage: Refactor disk label checking · 2f177c5a
      John Ferlan 提交于
      Create a new function virStorageBackendDiskValidLabel to handle checking
      whether there is a label on the device and whether it's valid or not.
      While initially for the purpose of determining whether the label can be
      overwritten during DiskBuild, a future use during DiskStart could determine
      whether the pool should be started using the label found.
      2f177c5a
    • J
      storage: Prior to creating a volume, refresh the pool · fdda3760
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1233003
      
      Although perhaps bordering on a don't do that type scenario, if
      someone creates a volume in a pool outside of libvirt, then uses that
      same name to create a volume in the pool via libvirt, then the creation
      will fail and in some cases cause the same name volume to be deleted.
      
      This patch will refresh the pool just prior to checking whether the
      named volume exists prior to creating the volume in the pool. While
      it's still possible to have a timing window to create a file after the
      check - at least we tried.  At that point, someone is being malicious.
      fdda3760
    • J
      virfile: Fix error path for forked virFileRemove · cb19cff4
      John Ferlan 提交于
      As it turns out the caller in this case expects a return < 0 for failure
      and to get/use "errno" rather than using the negative of returned status.
      Again different than the create path.
      
      If someone "deleted" a file from the pool without using virsh vol-delete,
      then the unlink/rmdir would return an error (-1) and set errno to ENOENT.
      The caller checks errno for ENOENT when determining whether to throw an
      error message indicating the failure.  Without the change, the error
      message is:
      
      error: Failed to delete vol $vol
      error: cannot unlink file '/$pathto/$vol': Success
      
      This patch thus allows the fork path to follow the non-fork path
      where unlink/rmdir return -1 and errno.
      cb19cff4
    • J
      virfile: Add extra check for direct delete in virFileRemove · c6b32d68
      John Ferlan 提交于
      Unlike create options, if the file to be removed is already in the
      pool, then the uid/gid will come from the pool. If it's the same as the
      currently running process, then just do the unlink/rmdir directly
      rather than going through the fork processing unnecessarily
      c6b32d68
    • A
      qemu: Add conditions for qemu-kvm use on ppc64 · 938368f8
      Andrea Bolognani 提交于
      qemu-kvm can be used to run ppc64 guests on ppc64le hosts and vice
      versa, since the hardware is actually the same and the endianness
      is chosen by the guest kernel.
      
      Up until now, however, libvirt didn't allow the use of qemu-kvm
      to run guests if their endianness didn't match the host's.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1267882
      938368f8
    • P
      rpc: libssh2: Fix regression in ssh host key verification · 9869f24d
      Peter Krempa 提交于
      Commit 792f81a4 caused a regression in the libssh2 host key
      verification code by changing the variable type of 'i' to unsigned.
      Since one of the loops used -1 as a special value if the asking
      callback was found the conversion made a subsequent test always fail.
      
      The bug was stealth enough to pass review, compilers and coverity.
      
      Refactor the condition to avoid problems.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1047861
      9869f24d
    • P
      rpc: libssh2: Add more debugging info · 387c316e
      Peter Krempa 提交于
      387c316e
    • P
      conf: Reuse virDomainDefCheckDuplicateDiskWWN to check disk serial too · 34315608
      Peter Krempa 提交于
      Rename the function to virDomainDefCheckDuplicateDiskInfo and make it
      check disk serials too.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1245013
      34315608
    • P
      qemu: Perform the disk WWN check only on fresh starts · 199d17de
      Peter Krempa 提交于
      Since we'd disallow migration of a guest that would have possibly
      invalid config but still be able to work, relax the WWN check to be
      performed only on new starts of the VM.
      199d17de
  6. 02 10月, 2015 3 次提交
    • L
      interface: let netcf pre-filter for active vs. inactive · ce692d5e
      Laine Stump 提交于
      If a system has a large number of active or active interfaces, it can
      be a big waste of time to retrieve and qualify all interfaces if the
      caller only wanted one subset. Since netcf has a simple flag for this,
      translate the libvirt flag into a netcf flag and let netcf pre-filter.
      ce692d5e
    • L
      interface: re-use name and mac address rather than re-retrieving · 07073273
      Laine Stump 提交于
      Getting the MAC address of an interface is actually fairly expensive,
      and we've already gotten it and stored it into def, so just keep def
      around a bit longer and retrieve it from there.
      
      This reduces the time for "virsh iface-list --all" from 28 to 23
      seconds when there are 400 interfaces.
      07073273
    • L
      interface: report correct interface count when not returning list · 6fda6699
      Laine Stump 提交于
      The spec for virConnectListAllInterfaces says that if the pointer that
      is supposed to hold the list of interfaces is NULL, the function
      should just return the count of interfaces that matched the filter,
      but the code never increments the count if the list pointer is NULL.
      6fda6699