1. 11 10月, 2012 3 次提交
    • J
      conf: Rename life cycle actions to event actions · d0ea530b
      Jiri Denemark 提交于
      While current on_{poweroff,reboot,crash} action configuration is about
      configuring life cycle actions, they can all be considered events and
      actions that need to be done on a particular event. Let's generalize the
      code by renaming life cycle actions to event actions so that it can be
      reused later for non-lifecycle events.
      d0ea530b
    • Z
      0ec6aebb
    • C
      storage: Report UUID/name consistently in driver errors · 3af8280b
      Cole Robinson 提交于
      Done with:
      
      sed -i -e "s/no pool with matching uuid/no storage pool with matching uuid/g" src/storage/storage_driver.c
      sed -i -e 's/"%s", _("no storage pool with matching uuid")/_("no storage pool with matching uuid %s"), obj->uuid/g' src/storage/storage_driver.c
      sed -i -e 's/"%s", _("storage pool is not active")/_("storage pool '%s' is not active"), pool->def->name/g' src/storage/storage_driver.c
      
      And a couple fixups before, during, and after, and a manual inspection
      pass to make sure nothing was wonky.
      3af8280b
  2. 10 10月, 2012 4 次提交
    • D
      Change qemuSetSchedularParameters to use AFFECT_CURRENT · 4da9b2c1
      Daniel P. Berrange 提交于
      When adding variants of parameter setting APIs which accepted
      flags, the existing APIs were all adapted internally to pass
      VIR_DOMAIN_AFFECT_CURRENT to the new API. The QEMU impl
      qemuSetSchedularParameters was an exception, which instead
      used VIR_DOMAIN_AFFECT_LIVE. Change this to match other
      compatibility scenarios, so that calling
      
         virDomainSetSchedularParameters(dom, params, nparams);
      
      Has the same semantics as
      
         virDomainSetSchedularParametersFlags(dom, params, nparams, 0);
      
      And
      
         virDomainSetSchedularParametersFlags(dom, params, nparams, VIR_DOMAIN_AFFECT_CURRENT);
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      4da9b2c1
    • M
      win32: Pretend that close-on-exec works · fcfa4bfb
      Matthias Bolte 提交于
      Currently virNetSocketNew fails because virSetCloseExec fails as there
      is no proper implementation for it on Windows at the moment. Workaround
      this by pretending that setting close-on-exec on the fd works. This can
      be done because libvirt currently lacks the ability to create child
      processes on Windows anyway. So there is no point in failing to set a
      flag that isn't useful at the moment anyway.
      fcfa4bfb
    • M
      esx: Fix dynamic dispatch for types with more than one level of inheritance · 69037428
      Matthias Bolte 提交于
      Traverse the whole inheritance hierarchy for dynamic dispatch as it is
      already done for the dynamic cast.
      
      Also make AnyType cast errors more verbose.
      
      Reported by Ata Bohra.
      69037428
    • D
      interface: add udevIfaceIsActive() to udev backend · ba96d277
      Doug Goldstein 提交于
      Add support to check if a specific interface is active by supporting the
      following API function in the udev based virInterface backend:
      * virConnectInterfaceIsActive()
      ba96d277
  3. 09 10月, 2012 14 次提交
    • D
      interface: always build all available backends · 43dbcb15
      Doug Goldstein 提交于
      Always build all available backends to avoid bit-rot. At run time we
      select the correct backend and load it by attempting netcf first and
      then udev.
      43dbcb15
    • D
      interface: fix netcf based backend naming · b871830a
      Doug Goldstein 提交于
      All other backends for virInterface or other HVs implementations of
      virInterface list their own names for the name instead of the generic
      'Interface' value. This does the same for the netcf based backend.
      Also, report any errors during registration.
      b871830a
    • D
      interface: add udev based backend for virInterface · 5a33366f
      Doug Goldstein 提交于
      Add a read-only udev based backend for virInterface. Useful for distros
      that do not have netcf support yet. Multiple libvirt based utilities use
      a HAL based fallback when virInterface is not available which is less
      than ideal. This implements:
      * virConnectNumOfInterfaces()
      * virConnectListInterfaces()
      * virConnectNumOfDefinedInterfaces()
      * virConnectListDefinedInterfaces()
      * virConnectListAllInterfaces()
      * virConnectInterfaceLookupByName()
      * virConnectInterfaceLookupByMACString()
      5a33366f
    • E
      hooks: let virCommand do the error reporting · 9c74414d
      Eric Blake 提交于
      The code was reporting raw exit status without decoding it into
      normal vs. signal exit.  virCommandRun already does this, but
      with a different error type, so all we have to do is recast
      the error to the correct type.
      Reported by li guang.
      
      * src/util/hooks.c (virHookCall): Simplify.
      9c74414d
    • M
      doc: update description about user/group in qemu.conf · 60dea2c6
      Marcelo Cerri 提交于
      As a side effect of changes in the functions virGetUserID and
      virGetGroupID, the user and group configurations for DAC in qemu.conf
      are now able to accept both names and IDs, supporting a leading plus
      sign to ensure that a numeric value will not be interpreted as a name.
      
      This patch updates the comments in qemu.conf, including a description of
      this new behavior.
      60dea2c6
    • M
      docs: Drop useless </p> in drvphyp.html.in · c5eed5dc
      Michal Privoznik 提交于
      c5eed5dc
    • M
      nodeinfo: Fully convert to new virReportError · 84a8917b
      Michal Privoznik 提交于
      With our latest s/[a-z]+ReportError/virReportError/ rewrite
      (47ab34e2) we forgot to update arm part of the code.
      84a8917b
    • J
      qemu: Fix QMP detection of QXL graphics · 844cdf22
      Jiri Denemark 提交于
      With the recent introduction of QMP capabilities probing, libvirt failed
      to detect support for QXL graphics in QEMU 1.2 and newer. In addition to
      fixing that, this patch also causes libvirt to detect QXL support for
      qemu-kvm-0.13.0, which doesn't advertise it in -help output but mentions
      it in device list. Since qemu-kvm-0.13.0 supported -spice, it looks like
      not having qxl in -help was a bug.
      844cdf22
    • E
      virsh: add qemu-monitor-command --pretty · 2a1aaa60
      Eric Blake 提交于
      I was using qemu-monitor-command during development, and found it quite
      hard to use.  Compare the results of this patch on ease of reading:
      
      $ virsh qemu-monitor-command          dom '{"execute":"query-version"}'
      {"return":{"qemu":{"micro":1,"minor":12,"major":0},"package":"(qemu-kvm-0.12.1.2)"},"id":"libvirt-7683"}
      
      $ virsh qemu-monitor-command --pretty dom '{"execute":"query-version"}'
      {
          "return": {
              "qemu": {
                  "micro": 1,
                  "minor": 12,
                  "major": 0
              },
              "package": "(qemu-kvm-0.12.1.2)"
          },
          "id": "libvirt-7674"
      }
      
      * tools/virsh-host.c (cmdQemuMonitorCommand): New option.
      * tools/virsh.pod (qemu-monitor-command): Document it.
      2a1aaa60
    • M
      security: update user and group parsing in security_dac.c · 7c035625
      Marcelo Cerri 提交于
      The functions virGetUserID and virGetGroupID are now able to parse
      user/group names and IDs in a similar way to coreutils' chown. So, user
      and group parsing in security_dac can be simplified.
      7c035625
    • M
      util: extend virGetUserID and virGetGroupID to support names and IDs · 0b237296
      Marcelo Cerri 提交于
      This patch updates virGetUserID and virGetGroupID to be able to parse a
      user or group name in a similar way to coreutils' chown. This means that
      a numeric value with a leading plus sign is always parsed as an ID,
      otherwise the functions try to parse the input first as a user or group
      name and if this fails they try to parse it as an ID.
      
      This patch includes Peter Krempa's changes to correctly handle errors
      returned by getpwnam_r and getgrnam_r.
      0b237296
    • M
      Call curl_global_init from virInitialize to avoid thread-safety issues · 458c4998
      Matthias Bolte 提交于
      curl_global_init is not thread-safe. curl_easy_init might call
      curl_global_init when it was no called before. But curl_easy_init
      can be called from different threads by the ESX driver. Therefore,
      call curl_global_init from virInitialize to stop curl_easy_init from
      calling it.
      
      Reported by Benjamin Wang.
      458c4998
    • M
      fix kvm_pv_eoi with kvmclock · 5d692cc7
      Martin Kletzander 提交于
      When both kvmclock and kvm_pv_eoi are configured (either disabled or
      enabled) libvirt will generate invalid CPU specification due to the
      fact that even though kvmclock causes the CPU to be specified, it
      doesn't set have_cpu flag to true (and the new kvm_pv_eoi as well).
      This patch fixes the issue and adds a test exactly for that to show
      that it is fixed correctly (and also to keep it that way in the future
      of course).
      5d692cc7
    • A
      Fix typo in HAVE_DBUS automake conditional · 53d5ad94
      Alexander Larsson 提交于
      The variable that is set in the script is with_dbus, not have_dbus.
      53d5ad94
  4. 08 10月, 2012 2 次提交
    • G
      python: keep consistent handling of Python integer conversion · 283f1c4a
      Guannan Ren 提交于
      libvirt_ulonglongUnwrap requires the integer type of python obj.
      But libvirt_longlongUnwrap still could handle python obj of
      Pyfloat_type which causes the float value to be rounded up
      to an integer.
      
      For example
       >>> dom.setSchedulerParameters({'vcpu_quota': 0.88})
       0
      libvirt_longlongUnwrap treats 0.88 as a valid value 0
      
      However
       >>> dom.setSchedulerParameters({'cpu_shares': 1000.22})
      libvirt_ulonglongUnwrap will throw out an error
      "TypeError: an integer is required"
      
      The patch make this consistent.
      283f1c4a
    • G
      python: cleanup vcpu related binding APIs · 2832663f
      Guannan Ren 提交于
      libvirt_virDomainGetVcpus: add error handling, return -1 instead of None
      libvirt_virDomainPinVcpu and libvirt_virDomainPinVcpuFlags:
        check the type of argument
        make use of libvirt_boolUnwrap
      
        Set bitmap according to these values which are contained in given
        argument of vcpu tuple and turn off these bit corresponding to
        missing vcpus in argument tuple
      
        The original way ignored the error info from PyTuple_GetItem
        if index is out of range.
        "IndexError: tuple index out of range"
        The error message will only be raised on next command in interactive mode.
      2832663f
  5. 07 10月, 2012 1 次提交
    • M
      esx: Disable libcurl's use of signals to fix a segfault · 0821ea6b
      Matthias Bolte 提交于
      libcurl uses a SIGALRM in combination with sigsetjmp/siglongjmp to be
      able to abort a DNS lookup when it takes too long. The problem with this
      in a multi-threaded application is that the signal handler for SIGALRM
      and the call to siglongjmp can be executed on a thread that is different
      from the one that initially did the SIGALRM setup and the call to
      sigsetjmp. In the reported case this triggered a segfault.
      
      Disable libcurl's use of signals to avoid this situation. This has the
      disadvantage of losing the ability to abort synchronous DNS lookups which
      might result in libcurl getting stuck in a DNS lookup in the worst case.
      When libcurl was build with an asynchronous DNS backend such as c-ares
      then there is no problem because the timeout mechanism works without
      signals here anyway.
      
      Reported by Benjamin Wang.
      0821ea6b
  6. 05 10月, 2012 6 次提交
    • V
      S390: Buffer too small for large CPU numbers. · 4bdc8606
      Viktor Mihajlovski 提交于
      The output buffer for virFileReadAll was too small for systems with
      more than 30 CPUs which leads to a log entry and incorrect behavior.
      The new size will be sufficient for the current
      architectural limits.
      Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      4bdc8606
    • E
      build: fix VPATH builds · a86c039d
      Eric Blake 提交于
      This reverts part of commit 5468594f; the perl changes in that
      patch were sufficient.  Since libvirt.syms is already a generated
      file created in part from libvirt_private.syms, we don't need a
      second pass over libvirt_private.syms in isolation.
      
      * src/Makefile.am: Undo addition of check-private-symfile.
      a86c039d
    • M
      Check for private symbols presence as well · 5468594f
      Michal Privoznik 提交于
      Currently, we are checking if libvirt.so contains public symbols.
      However, sometimes we rename an internal symbol and forget to
      change libvirt_private.syms accordingly. Hence, it's safer to check
      for internal symbols as well.
      5468594f
    • E
      spec: prefer canonical name of util-linux · a9087ad1
      Eric Blake 提交于
      I noticed that in two places, we require util-linux, and in a third,
      we require util-linux-ng.  On Fedora (I tested F15 through rawhide),
      util-linux-ng is obsoleted by util-linux; on RHEL 6, util-linux
      is obsoleted by util-linux-ng.  That is, on either platform, either
      name will get you the correct package installed (where the preferred
      name on fedora is util-linux, and on RHEL 6 is util-linux-ng).  But
      on RHEL 5, there is no util-linux-ng
      
      * libvirt.spec.in (Requires): Use util-linux, not util-linux-ng.
      a9087ad1
    • M
      private.syms: Drop virKillProcess · fcd64772
      Michal Privoznik 提交于
      After it got renamed to virProcessKill (cf470068)
      it is no longer needed in the private syms file.
      fcd64772
    • E
      docs: fix links in migration.html TOC · eeb8c924
      Eric Blake 提交于
      Use of the wrong attribute name caused the table of contents to
      be useless.  Fix suggested by Daniel P. Berrange.
      
      * docs/migration.html.in: Use correct anchoring attribute.
      eeb8c924
  7. 04 10月, 2012 4 次提交
  8. 03 10月, 2012 2 次提交
    • M
      doc: update description about security labels on formatdomain.html · 0d0a7cdc
      Marcelo Cerri 提交于
      This patch adds a brief description about labels for each security
      driver.
      0d0a7cdc
    • M
      security: also parse user/group names instead of just IDs for DAC labels · 60469dd1
      Marcelo Cerri 提交于
      The DAC driver is missing parsing of group and user names for DAC labels
      and currently just parses uid and gid. This patch extends it to support
      names, so the following security label definition is now valid:
      
        <seclabel type='static' model='dac' relabel='yes'>
            <label>qemu:qemu</label>
            <imagelabel>qemu:qemu</imagelabel>
        </seclabel>
      
      When it tries to parse an owner or a group, it first tries to resolve it as
      a name, if it fails or it's an invalid user/group name then it tries to
      parse it as an UID or GID. A leading '+' can also be used for both owner and
      group to force it to be parsed as IDs, so the following example is also
      valid:
      
        <seclabel type='static' model='dac' relabel='yes'>
            <label>+101:+101</label>
            <imagelabel>+101:+101</imagelabel>
        </seclabel>
      
      This ensures that UID 101 and GUI 101 will be used instead of an user or
      group named "101".
      60469dd1
  9. 02 10月, 2012 4 次提交
    • E
      build: avoid -Wno-format on new-enough gcc · 814a8dea
      Eric Blake 提交于
      Commit c579d6b3 added a sledgehammer to silence spurious warnings from
      gcc 4.2, but in the process, it also silenced useful warnings from
      gcc 4.3 through 4.5.  As a result, a bug slipped in to commit 0caccb58.
      
      Tested with FreeBSD (gcc 4.2.1), RHEL 6.3 (gcc 4.4), and F17 (gcc 4.7.2),
      where the former didn't trip on spurious warnings, and where the latter
      two detected a revert of 2b804cfa.
      
      * m4/virt-compile-warnings.m4 (-Wno-format): Probe for the actual
      spurious message, to once again allow gcc 4.4 to use -Wformat.
      814a8dea
    • E
      build: fix typo in debug message · 2b804cfa
      Eric Blake 提交于
      Introduced in commit 0caccb58.
      
        CC     libvirt_driver_qemu_impl_la-qemu_capabilities.lo
      ../../src/qemu/qemu_capabilities.c: In function 'qemuCapsInitQMP':
      ../../src/qemu/qemu_capabilities.c:2327:13: error: format '%d' expects argument of type 'int', but argument 8 has type 'const char *' [-Werror=format]
      
      * src/qemu/qemu_capabilities.c (qemuCapsInitQMP): Use correct format.
      2b804cfa
    • J
      qemu: Kill processes used for QMP caps probing · 0caccb58
      Jiri Denemark 提交于
      Since libvirt switched to QMP capabilities probing recently, it starts
      QEMU process used for this probing with -daemonize, which means
      virCommandAbort can no longer reach these processes. As a result of
      that, restarting libvirtd will leave several new QEMU processes behind.
      Let's use QEMU's -pidfile and use it to kill the process when QMP caps
      probing is done.
      0caccb58
    • P
      qemu: Use proper agent entering function when freezing filesystems · e0316b5e
      Peter Krempa 提交于
      When doing snapshots, the filesystem freeze function used the agent
      entering function that expects the qemud_driver unlocked. This might
      cause a deadlock of the qemu driver if the agent does not respond.
      
      The only call path of this function has the qemud_driver locked, so this
      patch changes the entering functions to those expecting the driver
      locked.
      e0316b5e