1. 07 6月, 2016 22 次提交
  2. 06 6月, 2016 8 次提交
  3. 04 6月, 2016 1 次提交
  4. 03 6月, 2016 5 次提交
    • D
      Refresh po files from zanata · d57e73d0
      Daniel P. Berrange 提交于
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      d57e73d0
    • M
      Fix building with -Og · 3470cd86
      Martin Kletzander 提交于
      When building using -Og, gcc sees that some variables can be used
      uninitialized  It can be debatable whether it is possible with our
      codeflow, but functions should be self-contained and initializations are
      always good.  The return instead of goto is due to actualType being used
      in the cleanup.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      3470cd86
    • M
      virPerfEventIsEnabled: Don't crash on shut off domains · 5a72397e
      Michal Privoznik 提交于
      So imagine the following. You connect read only to a daemon and
      try to fetch stats for a shut off domain, e.g.:
      
        virsh -r domstats $dom
      
      but all of a sudden, virsh instead of printing the stats throws
      the following error at you:
      
        error: Disconnected from qemu:///system due to I/O error
        error: End of file while reading data: Input/output error
      
      The daemon crashed. This is its backtrace:
      
      #0  0x00007fa43e3751a8 in virPerfEventIsEnabled (perf=0x0, type=VIR_PERF_EVENT_MBMT) at util/virperf.c:241
      #1  0x00007fa424a9f042 in qemuDomainGetStatsPerf (driver=0x7fa3f4022a30, dom=0x7fa3f40e24c0, record=0x7fa41c000e20, maxparams=0x7fa4360b38d0, privflags=1) at qemu/qemu_driver.c:19110
      #2  0x00007fa424a9f2e7 in qemuDomainGetStats (conn=0x7fa41c001b20, dom=0x7fa3f40e24c0, stats=127, record=0x7fa4360b3970, flags=1) at qemu/qemu_driver.c:19213
      #3  0x00007fa424a9f672 in qemuConnectGetAllDomainStats (conn=0x7fa41c001b20, doms=0x7fa41c0017f0, ndoms=1, stats=127, retStats=0x7fa4360b3a50, flags=0) at qemu/qemu_driver.c:19303
      #4  0x00007fa43e4e15f6 in virDomainListGetStats (doms=0x7fa41c0017f0, stats=0, retStats=0x7fa4360b3a50, flags=0) at libvirt-domain.c:11615
      
      Program received signal SIGSEGV, Segmentation fault.
      [Switching to Thread 0x7f28d1a38700 (LWP 16154)]
      0x00007f28da4fa1a8 in virPerfEventIsEnabled (perf=0x0, type=VIR_PERF_EVENT_MBMT) at util/virperf.c:241
      241         return event->enabled;
      
      Problem is, shut off domains don't have priv->perf allocated.
      Therefore if in frame #1 qemuDomainGetStatsPerf() tries to check
      if perf events are enabled, NULL is passed to
      virPerfEventIsEnabled() which due to some incredible
      implementation dereference it. Fix this by checking whether
      passed object is not NULL.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      5a72397e
    • M
      Drop virPerfGetEventFd · 89ef1589
      Michal Privoznik 提交于
      This function is not used anywhere. Moreover, the code that would
      use lives in virperf.c and therefore has access to the FD anyway.
      Well, for instance virPerfReadEvent is doing just that.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      89ef1589
    • M
      virDomainChrGetDomainPtrsInternal: Return an integer · 43395f19
      Michal Privoznik 提交于
      There's this problem on the recent gcc-6.1:
      
      In file included from conf/domain_conf.c:37:0:
      conf/domain_conf.c: In function 'virDomainChrPreAlloc':
      conf/domain_conf.c:14109:35: error: potential null pointer dereference [-Werror=null-dereference]
           return VIR_REALLOC_N(*arrPtr, *cntPtr + 1);
                                         ^~
      ./util/viralloc.h:158:73: note: in definition of macro 'VIR_REALLOC_N'
       # define VIR_REALLOC_N(ptr, count) virReallocN(&(ptr), sizeof(*(ptr)), (count), \
                                                                               ^~~~~
      conf/domain_conf.c: In function 'virDomainChrRemove':
      conf/domain_conf.c:14133:21: error: potential null pointer dereference [-Werror=null-dereference]
           for (i = 0; i < *cntPtr; i++) {
                           ^~~~~~~
      
      GCC basically fails to see, that the
      virDomainChrGetDomainPtrsInternal will never actually return NULL
      because it's never called over a domain char device with _LAST
      type. But to make it shut up, lets turn this function into
      returning an integer and check in the callers if a zero value
      value was returned.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      43395f19
  5. 02 6月, 2016 3 次提交
    • M
      virDomainFormatSchedDef: Avoid false positive NULL dereference · f916194c
      Michal Privoznik 提交于
      Okay, I admit that our code here is complex. It's not easy to
      spot that NULL deref can't really happen here. So it's no wonder
      that a dumb compiler fails to see all the connections and
      produces the following errors:
      
        CC       conf/libvirt_conf_la-domain_conf.lo
      conf/domain_conf.c: In function 'virDomainDefFormatInternal':
      conf/domain_conf.c:22162:22: error: potential null pointer dereference [-Werror=null-dereference]
                   if (sched->policy == i)
                       ~~~~~^~~~~~~~
      <snip/>
      cc1: all warnings being treated as errors
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      f916194c
    • M
      ppc64Compute: Avoid possible NULL dereference · 09258c3c
      Michal Privoznik 提交于
      cpu/cpu_ppc64.c: In function 'ppc64Compute':
      cpu/cpu_ppc64.c:620:27: error: potential null pointer dereference [-Werror=null-dereference]
           if (STRNEQ(guest_model->name, host_model->name)) {
                      ~~~~~~~~~~~^~~
      cpu/cpu_ppc64.c:620:9: note: in expansion of macro 'STRNEQ'
           if (STRNEQ(guest_model->name, host_model->name)) {
               ^~~~~~
      cc1: all warnings being treated as errors
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      09258c3c
    • M
      virNetDevBridgeGet: Don't require users to virNetDevSetupControl · 263a8880
      Michal Privoznik 提交于
      So far, this function has just three callers. Two of them call
      virNetDevSetupControl to create a socket that we can then
      optionally use for ioctl() to fetch data. However, querying sysfs
      is preferred. Therefore it doesn't make much sense to require
      users to set up the socket if they don't even know it will be
      used in favour of sysfs. We can set up the socket iff we need to.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      263a8880
  6. 01 6月, 2016 1 次提交
    • L
      network: restart dnsmasq after adding/removing txt and srv records · 93b59fcf
      Laine Stump 提交于
      Although dns host records are stored in a separate configuration file
      that is reread by dnsmasq when it receives a SIGHUP, the txt and srv
      records are directly in the dnsmasq .conf file which can't be reread
      after initial dnsmasq startup. This means that if an srv or txt record
      is modified in a network config, libvirt needs to restart the dnsmasq
      process rather than just sending a SIGHUP.
      
      This was pointed out in a question in
      https://bugzilla.redhat.com/show_bug.cgi?id=988718 , but no separate
      BZ was filed.
      93b59fcf