1. 05 10月, 2015 9 次提交
    • 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
  2. 02 10月, 2015 16 次提交
  3. 29 9月, 2015 4 次提交
  4. 26 9月, 2015 3 次提交
    • J
      conf: Fix virtType check · 5e06a4f0
      John Ferlan 提交于
      Commit id '7383b8cc' changed virDomainDef 'virtType' to an enum, that
      caused a build failure on some archs due to comparing an unsigned value
      to < 0.  Adjust the fetch of 'type' to be into temporary 'int virtType'
      and then assign that virtType to the def->virtType
      5e06a4f0
    • S
      qemu: Make virtType of type virDomainVirtType · 7383b8cc
      Shivangi Dhir 提交于
      Earlier virtType was of type int. After, introducing the enum VIR_DOMAIN_VIRT_NONE,
      the type of virtType is modified to virDomainVirtType.
      7383b8cc
    • S
      conf: Add new VIR_DOMAIN_VIRT_NONE enum · 62569e45
      Shivangi Dhir 提交于
      Introduce VIR_DOMAIN_VIRT_NONE to give domaintype the default value of zero.
      This is specially helpful in constructing better error messages
      when we don't want to look up the default emulator by virtType.
      
      The test data in vircapstest.c is also modified to reflect this change.
      62569e45
  5. 25 9月, 2015 3 次提交
  6. 24 9月, 2015 5 次提交
    • J
      domain: Fix migratable XML with graphics/@listen · c0806dc3
      Jiri Denemark 提交于
      As of commit 69929941, we set graphics/@listen attribute according to the
      first listen child element even if that element is of type='network'.
      This was done for backward compatibility with applications which only
      support the original listen attribute. However, by doing so we broke
      migration to older libvirt which tried to check that the listen
      attribute matches one of the listen child elements but which did not
      take type='network' elements into account.
      
      We are not concerned about compatibility with old applications when
      formatting domain XML for migration for two reasons. The XML is consumed
      only by libvirtd and the IP address associated with type='network'
      listen address on the source host is just useless on the destination
      host. Thus, we can safely avoid propagating the type='network' IP
      address to graphics/@listen attribute when creating migratable XML.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1265111Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      c0806dc3
    • E
      vsh: create a noinstall libvirt_shell library · 2d9fcb31
      Erik Skultety 提交于
      Instead of referencing vsh sources in all relevant client targets,
      create a library that the client can link against.
      2d9fcb31
    • J
      qemu: Resolve Coverity RESOURCE_LEAK · a73c67b6
      John Ferlan 提交于
      This seemed to be more of a false positive as for some reason Coverity
      was missing the "ret < 0" goto error condition and somehow believing that
      event could be overwritten.  At first I thought it was just the ret != 0
      condition difference, but it wasn't.
      
      In any case, make use of the recent change to qemuDomainEventQueue to
      check event == NULL and just pass it as a parameter directly in the
      error path. That avoids the error.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      a73c67b6
    • J
      qemu: Clean up ret in qemuDomainSaveMemory and qemuDomainSaveInternal · 83cbbbef
      John Ferlan 提交于
      As it turns out, ret can only be 0 or -1, so rather than have some comparisons
      be "ret < 0" and others be "ret != 0", make them all "ret < 0".
      83cbbbef
    • J
      qemu: Resolve Coverity CHECKED_RETURN · ace8e227
      John Ferlan 提交于
      Coverity complains that return from virHookCall is not checked in
      one place in qemuProcessStop.  Since the comment notes that we cannot
      stop the operation even it if fails, just added the ignore_value.
      ace8e227