1. 13 9月, 2016 1 次提交
  2. 12 9月, 2016 12 次提交
    • D
      qemu: avoid parameter named 'listen' · 92513bc2
      Daniel P. Berrange 提交于
      previous commit:
      
        commit 2c322378
        Author: John Ferlan <jferlan@redhat.com>
        Date:   Mon Jun 13 12:30:34 2016 -0400
      
          qemu: Add the ability to hotplug the TLS X.509 environment
      
      added a parameter "bool listen" in some methods. This
      unfortunately clashes with the listen() method, causing
      compile failures on certain platforms (RHEL-6 for example)
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      92513bc2
    • J
      storage: Need to properly read the crypt offset value · 2f6b750e
      John Ferlan 提交于
      Commit id 'a48c7141' altered how to determine if a volume was encrypted
      by adding a peek at an offset into the file at a specific buffer location.
      Unfortunately, all that was compared was the first "char" of the buffer
      against the expect "int" value.
      
      Restore the virReadBufInt32BE to get the complete field in order to
      compare against the expected value from the qcow2EncryptionInfo or
      qcow1EncryptionInfo "modeValue" field.
      
      This restores the capability to create a volume with encryption, then
      refresh the pool, and still find the encryption for the volume.
      2f6b750e
    • J
      storage: Need to refresh secret for luks volume after volume refresh · b68487c9
      John Ferlan 提交于
      A LUKS volume uses the volume secret type just like the QCOW2 secret, so
      adjust the loading of the default secrets to handle any volume that the
      virStorageFileGetMetadataFromBuf code has deemed to be an encrypted volume
      to search for the volume's secret. This lookup is done by volume usage
      where the usage is expected to be the path to volume.
      b68487c9
    • N
      log: Fix reporting OOM error incorrectly when defining a logging filter · b6daacf6
      Nikolay Shirokovskiy 提交于
      When a new filter is being defined, the return code is not handled properly,
      thus triggering OOM error reporting routine (bug introduced by 51b2606f).
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      b6daacf6
    • J
      qemu: Don't use query-migrate on destination · 56258a38
      Jiri Denemark 提交于
      When migration fails, we need to poke QEMU monitor to check for a reason
      of the failure. We did this using query-migrate QMP command, which is
      not supposed to return any meaningful result on the destination side.
      Thus if the monitor was still functional when we detected the migration
      failure, parsing the answer from query-migrate always failed with the
      following error message:
      
          "info migration reply was missing return status"
      
      This irrelevant message was then used as the reason for the migration
      failure replacing any message we might have had.
      
      Let's use harmless query-status for poking the monitor to make sure we
      only get an error if the monitor connection is broken.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1374613Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      56258a38
    • J
      util: Quiet the logging if perf file doesn't exist · c8b8bbc3
      John Ferlan 提交于
      Commit id 'b00d7f29' shifted the opening of the /sys/devices/intel_cqm/type
      file from event enable to perf event initialization. If the file did not
      exist, then an error would be written to the domain log:
      
      2016-09-06 20:51:21.677+0000: 7310: error : virFileReadAll:1360 : Failed to open file '/sys/devices/intel_cqm/type': No such file or directory
      
      Since the error is now handled in virPerfEventEnable by checking if the
      event_attr->attrType == 0 for CMT, MBML, and MBMT events - we can just
      use the Quiet API in order to not log the error we're going to throw away.
      
      Additionally, rather than using virReportSystemError, use virReportError
      and VIR_ERR_ARGUMENT_UNSUPPORTED in order to signify that support isn't there
      for that type of perf event - adjust the error message as well.
      c8b8bbc3
    • J
      libxl: implement virConnectBaselineCPU · 69f4030a
      Joao Martins 提交于
      Akin to previous commit but for "virsh cpu-baseline" which
      computes a baseline CPU for a set of host cpu elements.
      Signed-off-by: NJoao Martins <joao.m.martins@oracle.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      69f4030a
    • J
      libxl: implement virConnectCompareCPU · 5822b740
      Joao Martins 提交于
      Implement support for "virsh cpu-compare" so that we can calculate
      common cpu element between a pool of hosts, which had a requirement
      of providing host cpu description.
      Signed-off-by: NJoao Martins <joao.m.martins@oracle.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      5822b740
    • J
      libxl: describe host cpu features based on hwcaps · 17322e55
      Joao Martins 提交于
      Parse libxl_hwcap accounting for versions since Xen 4.4 - Xen 4.7.
      libxl_hwcaps is a set of cpuid leaves output that is described in [0] or
      [1] in Xen 4.7. This is a collection of CPUID leaves that we version
      in libvirt whenever feature words are reordered or added. Thus we keep the
      common ones in one struct and others for each version. Since
      libxl_hwcaps doesn't appear to have a stable format across all supported
      versions thus we need to keep track of changes as a compromise until it's
      exported in xen libxl API. We don't fail in initializing the driver in case
      parsing of hwcaps failed for that reason. In addition, change the notation
      on PAE feature such that is easier to read which bit it corresponds.
      
      [0] xen/include/asm-x86/cpufeature.h
      [1] xen/include/public/arch-x86/cpufeatureset.h
      Signed-off-by: NJoao Martins <joao.m.martins@oracle.com>
      17322e55
    • J
      libxl: describe host topology in capabilities · 3d54305e
      Joao Martins 提交于
      Add support for describing cpu topology in host cpu element.  In doing
      so, refactor hwcaps part to its own helper namely libxlCapsInitCPU to
      handle all host cpu related operations, including topology.
      Signed-off-by: NJoao Martins <joao.m.martins@oracle.com>
      3d54305e
    • P
      qemu: hotplug: Don't wait if cdrom tray is opened forcibly · 85c82612
      Peter Krempa 提交于
      Qemu always opens the tray if forced to. Skip the waiting step in such
      case.
      
      This also helps if qemu does not report the tray change event when
      opening the cdrom forcibly (the documentation says that the event will
      not be sent although qemu in fact does trigger it even if @force is
      selceted).
      
      This is a workaround for a qemu issue where qemu does not send the tray
      change event in some cases (after migration with empty closed locked
      drive) and thus renders the cdrom useless from libvirt's point of view.
      
      Partially resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1368368
      85c82612
    • P
      qemu: domain: Clear startup policy for dropped removable media · 6e19cc59
      Peter Krempa 提交于
      When a source image is dropped when missing due to startup policy the
      policy needs to be cleared since it was relevant only for the given
      storage source. New sources need to update it if needed.
      6e19cc59
  3. 09 9月, 2016 10 次提交
  4. 08 9月, 2016 5 次提交
  5. 07 9月, 2016 7 次提交
    • Y
      storage: Delete extra wrap after vol-resize error · ed8ba91e
      Yanqiu Zhang 提交于
      This patch is to delete the extra wrap "\n" after failed vol-resize
      error for both "Failed to change size of volume to" and "Failed to change
      size of volume by". For error with wrap, there will be an extra wrap
      between two errors, such as:
      
         (1)# virsh vol-resize --pool default --vol vol-test 5M
              error: Failed to change size of volume 'vol-test' to 5M
      
              error: invalid argument: Can't shrink capacity below current capacity unless shrink flag explicitly specified
      
         (2)# virsh vol-resize /var/lib/libvirt/images/volds --shrink --delta 10M
              error: Failed to change size of volume 'volds' by 10M
      
              error: invalid argument: can't shrink capacity below existing allocation
      ed8ba91e
    • P
      qemu: driver: Remove unnecessary condition · b871b789
      Peter Krempa 提交于
      At this point it's guaranteed that 'persistentDef' is non-NULL so we
      don't need to check it again.
      b871b789
    • P
      qemu: process: Fix start with unpluggable vcpus with NUMA pinning · 68115fe0
      Peter Krempa 提交于
      Similarly to vcpu hotplug the emulator thread cgroup numa mapping needs
      to be relaxed while hot-adding vcpus so that the threads can allocate
      data in the DMA zone.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1370084
      68115fe0
    • P
      qemu: cgroup: Extract temporary relaxing of cgroup setting for vcpu hotplug · eb5dee35
      Peter Krempa 提交于
      When hot-adding vcpus qemu needs to allocate some structures in the DMA
      zone which may be outside of the numa pinning. Extract the code doing
      this in a set of helpers so that it can be reused.
      eb5dee35
    • E
      virt-admin: Output srv-clients-set data as unsigned int rather than signed · e2c63714
      Erik Skultety 提交于
      Unfortunately, commit a8962f70 only fixed first half of the reported issue of
      virt-admin outputting negative values where unsigned int is expected by
      BZ below, so this commit represents the other missing half of the fix.
      
      resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1356769Signed-off-by: NErik Skultety <eskultet@redhat.com>
      e2c63714
    • M
      util: fix crash in virClassIsDerivedFrom for CloseCallbacks objects · f47b9114
      Maxim Nestratov 提交于
      There is a possibility that qemu driver frees by unreferencing its
      closeCallbacks pointer as it has the only reference to the object,
      while in fact not all users of CloseCallbacks called thier
      virCloseCallbacksUnset.
      
      Backtrace is the following:
      Thread #1:
      0  in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
      1  in virCondWait (c=<optimized out>, m=<optimized out>)
          at util/virthread.c:154
      2  in virThreadPoolFree (pool=0x7f0810110b50)
          at util/virthreadpool.c:266
      3  in qemuStateCleanup () at qemu/qemu_driver.c:1116
      4  in virStateCleanup () at libvirt.c:808
      5  in main (argc=<optimized out>, argv=<optimized out>)
          at libvirtd.c:1660
      
      Thread #2:
      0  in virClassIsDerivedFrom (klass=0xdeadbeef, parent=0x7f0837c694d0) at util/virobject.c:169
      1  in virObjectIsClass (anyobj=anyobj@entry=0x7f08101d4760, klass=<optimized out>) at util/virobject.c:365
      2  in virObjectLock (anyobj=0x7f08101d4760) at util/virobject.c:317
      3  in virCloseCallbacksUnset (closeCallbacks=0x7f08101d4760, vm=vm@entry=0x7f08101d47b0, cb=cb@entry=0x7f081d078fc0 <qemuProcessAutoDestroy>) at util/virclosecallbacks.c:163
      4  in qemuProcessAutoDestroyRemove (driver=driver@entry=0x7f081018be50, vm=vm@entry=0x7f08101d47b0) at qemu/qemu_process.c:6368
      5  in qemuProcessStop (driver=driver@entry=0x7f081018be50, vm=vm@entry=0x7f08101d47b0, reason=reason@entry=VIR_DOMAIN_SHUTOFF_SHUTDOWN, asyncJob=asyncJob@entry=QEMU_ASYNC_JOB_NONE, flags=flags@entry=0) at qemu/qemu_process.c:5854
      6  in processMonitorEOFEvent (vm=0x7f08101d47b0, driver=0x7f081018be50) at qemu/qemu_driver.c:4585
      7  qemuProcessEventHandler (data=<optimized out>, opaque=0x7f081018be50) at qemu/qemu_driver.c:4629
      8  in virThreadPoolWorker (opaque=opaque@entry=0x7f0837c4f820) at util/virthreadpool.c:145
      9  in virThreadHelper (data=<optimized out>) at util/virthread.c:206
      10 in start_thread () from /lib64/libpthread.so.0
      
      Let's reference CloseCallbacks object in virCloseCallbacksSet and
      unreference in virCloseCallbacksUnset.
      Signed-off-by: NMaxim Nestratov <mnestratov@virtuozzo.com>
      f47b9114
    • Y
      qemu: guest agent: introduce new error code VIR_ERR_AGENT_UNSYNCED · 914d5e1c
      Yuri Pudgorodskiy 提交于
      A separate error code will help recognize real failures from
      necessity to try again
      Signed-off-by: NMaxim Nestratov <mnestratov@virtuozzo.com>
      914d5e1c
  6. 06 9月, 2016 5 次提交
    • M
      Make sure sys/types.h is included after sys/sysmacros.h · f3f15cc2
      Michal Privoznik 提交于
      In the latest glibc, major() and minor() functions are marked as
      deprecated (glibc commit dbab6577):
      
        CC       util/libvirt_util_la-vircgroup.lo
      util/vircgroup.c: In function 'virCgroupGetBlockDevString':
      util/vircgroup.c:768:5: error: '__major_from_sys_types' is deprecated:
        In the GNU C Library, `major' is defined by <sys/sysmacros.h>.
        For historical compatibility, it is currently defined by
        <sys/types.h> as well, but we plan to remove this soon.
        To use `major', include <sys/sysmacros.h> directly.
        If you did not intend to use a system-defined macro `major',
        you should #undef it after including <sys/types.h>.
        [-Werror=deprecated-declarations]
           if (virAsprintf(&ret, "%d:%d ", major(sb.st_rdev), minor(sb.st_rdev)) < 0)
           ^~
      In file included from /usr/include/features.h:397:0,
                       from /usr/include/bits/libc-header-start.h:33,
                       from /usr/include/stdio.h:28,
                       from ../gnulib/lib/stdio.h:43,
                       from util/vircgroup.c:26:
      /usr/include/sys/sysmacros.h:87:1: note: declared here
       __SYSMACROS_DEFINE_MAJOR (__SYSMACROS_FST_IMPL_TEMPL)
       ^
      
      Moreover, in the glibc commit, there's suggestion to keep
      ordering of including of header files as implemented here.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      f3f15cc2
    • N
      tools: Pass opaque data in vshCompleter and introduce autoCompleteOpaque · cbbaa17f
      Nishith Shah 提交于
      This patch changes the signature of vshCompleters, allowing to pass along
      some data that we might want to along with the completers; for example,
      we might want to pass the autocomplete vshControl along with the
      completer, in case the completer requires a connection to libvirtd.
      Signed-off-by: NNishith Shah <nishithshah.2211@gmail.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      cbbaa17f
    • R
      util: hostcpu: improve CPU freq code for FreeBSD · f8435a43
      Roman Bogorodskiy 提交于
      Current implementation uses the dev.cpu.0.freq sysctl that is
      provided by the cpufreq(4) framework and returns the actual
      CPU frequency. However, there are environments where it's not available,
      e.g. when running nested in KVM. In this case fall back to hw.clockrate
      that reports CPU frequency at the boot time.
      
      Resolves (hopefully):
      https://bugzilla.redhat.com/show_bug.cgi?id=1369964
      f8435a43
    • A
      libvirt-guests.service: Add Requires=libvirtd.service · fb2025ed
      Andrea Bolognani 提交于
      Having After=libvirtd.service merely ensures that, if both
      services are asked to start, libvirtd.service will start
      first.
      
      What we really want is for libvirtd.service to be started
      whenever libvirt-guests.service is asked to start. Adding a
      Requires= relationship guarantees that will happen.
      fb2025ed
    • A
      libvirt-guests.service: Split After= relationship · 7fbe9fa5
      Andrea Bolognani 提交于
      We use a separate line for each After= relationship in other
      unit files: do the same here for consistency's sake, and also
      to make future changes nicer to diff
      7fbe9fa5