1. 14 12月, 2010 2 次提交
    • E
      daemon: plug a memory leak · 24384a75
      Eric Blake 提交于
      * daemon/libvirtd.c (qemudFreeClient): Avoid a leak.
      (qemudDispatchServer): Avoid null dereference.
      24384a75
    • R
      802.1Qbh: Add support for IFLA_VF_MAC · 013c000a
      Roopa Prabhu 提交于
      Current code does not pass VM mac address to a 802.1Qbh direct attach
      interface using IFLA_VF_MAC.  This patch adds support in macvtap code to
      send IFLA_VF_MAC netlink request during port profile association on a
      802.1Qbh interface.
      
      Stefan Cc'ed for comments because this patch changes a condition for
      802.1Qbg
      
      802.1Qbh support for IFLA_VF_MAC in enic driver has been posted and is
      pending acceptance at http://marc.info/?l=linux-netdev&m=129185244410557&w=2
      013c000a
  2. 11 12月, 2010 7 次提交
    • E
      command: ease use with virBuffer, and fix qemu leak · e8d05c97
      Eric Blake 提交于
      * src/util/command.h (virCommandAddArgBuffer)
      (virCommandAddEnvBuffer): New prototypes.
      * src/util/command.c (virCommandAddArgBuffer)
      (virCommandAddEnvBuffer): Implement them.
      * src/libvirt_private.syms (command.h): Export them.
      * src/qemu/qemu_conf.c (qemudBuildCommandLine): Use them, plugging
      a memory leak on rbd_hosts in the process.
      e8d05c97
    • E
      conf: plug memory leaks · 20eb73e9
      Eric Blake 提交于
      * src/conf/domain_conf.c (virDomainGraphicsDefParseXML)
      (virDomainDeviceVirtioSerialAddressParseXML)
      (virDomainDiskDefFree): Free various leaks.
      20eb73e9
    • E
      tests: plug memory leaks · 7d5e79ff
      Eric Blake 提交于
      * tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Don't
      allocate, since we don't use virDomainChrDefFree.
      7d5e79ff
    • E
      virExec: avoid undefined behavior · c3568ec2
      Eric Blake 提交于
      * src/util/util.c (__virExec): Don't use FD_ISSET on out-of-bounds fd.
      c3568ec2
    • L
      Convert dhcpStartDhcpDaemon from virRun to virCommand · 044f2011
      Laine Stump 提交于
      This is pretty straightforward - even though dnsmasq gets daemonized
      and uses a pid file, those things are both handled by the dnsmasq
      binary itself. And libvirt doesn't need any of the output of the
      dnsmasq command either, so we just setup the args and call
      virRun(). Mainly it was just a (mostly) mechanical job of replacing
      the APPEND_ARG() macro (and some other *printfs()) with
      virCommandAddArg*().
      044f2011
    • M
      c9006b6b
    • M
      esx: Improve error reporting for failed tasks · 2a151699
      Matthias Bolte 提交于
      Instead of just reporting that a task failed get the
      localized message from the TaskInfo error and include
      it in the reported error message.
      
      Implement minimal deserialization support for the
      MethodFault type in order to obtain the actual fault
      type.
      
      For example, this changes the reported error message
      when trying to create a volume with zero size from
      
        Could not create volume
      
      to
      
        Could not create volume: InvalidArgument - A specified parameter was not correct.
      
      Not perfect yet, but better than before.
      2a151699
  3. 10 12月, 2010 12 次提交
    • E
      command: plug memory leak · f12d4169
      Eric Blake 提交于
      * src/util/command.c (virCommandFree): Free data from
      virCommandSetInputBuffer.
      f12d4169
    • E
      build: distribute commandtest files · 2a5ccbef
      Eric Blake 提交于
      * tests/Makefile.am (SUBDIRS): Add commanddata.
      * tests/commandtest.c (checkoutput): Delete correct file.
      (test4): Delete pid file.
      (mymain): Delete unused variable.
      * tests/commanddata/Makefile.am: New file.
      * configure.ac (AC_OUTPUT): Build new makefile.
      Reported by Dominik Klein.
      2a5ccbef
    • H
      Update documentation of watchdog dump option and add test data for it · e8e9397c
      Hu Tao 提交于
      The xml watchdog dump option is converted to qemu watchdog pause arg
      but it is not reasonable to convert it back from qemu watchdog pause
      arg since there already is a xml watchdog pause option, so a test for
      the dump option to convert it from arg to xml is not added.
      e8e9397c
    • D
      spec: do not start libvirt-guests if that service is off · 91b3e103
      Dan Kenigsberg 提交于
      starting a service during rpm installation is impolite. It is even worse if done
      during upgrade, for a service that was explicitly turned off.
      91b3e103
    • J
      tests: Add tests for network disks · 715bf452
      Josh Durgin 提交于
      Signed-off-by: NJosh Durgin <joshd@hq.newdream.net>
      715bf452
    • J
      qemu: Add RBD support and some network disk fixes · 85400fb9
      Josh Durgin 提交于
      Changes common to all network disks:
      -Make source name optional in the domain schema, since NBD doesn't use it
      -Add a hostName type to the domain schema, and use it instead of genericName, which doesn't include .
      -Don't leak host names or ports
      -Set the source protocol in qemuParseCommandline
      Signed-off-by: NJosh Durgin <joshd@hq.newdream.net>
      85400fb9
    • M
      add network disk support · 036ad505
      MORITA Kazutaka 提交于
      This patch adds network disk support to libvirt/QEMU.  The currently
      supported protocols are nbd, rbd, and sheepdog.  The XML syntax is like
      this:
      
          <disk type="network" device="disk">
            <driver name="qemu" type="raw" />
            <source protocol='rbd|sheepdog|nbd' name="...some image identifier...">
              <host name="mon1.example.org" port="6000">
              <host name="mon2.example.org" port="6000">
              <host name="mon3.example.org" port="6000">
            </source>
            <target dev="vda" bus="virtio" />
          </disk>
      Signed-off-by: NMORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
      036ad505
    • W
      correct the signal's name · 85d5fb19
      Wen Congyang 提交于
      The signal's name is wrong...
      Signed-off-by: NWen Congyang <wency@cn.fujitsu.com>
      85d5fb19
    • H
      Add a watchdog action `dump' · e19cdbfc
      Hu Tao 提交于
      `dump' watchdog action lets libvirtd to dump the guest when receives a
      watchdog event (which probably means a guest crash)
      
      Currently only qemu is supported.
      e19cdbfc
    • H
      Add a new function doCoreDump · b4560bf2
      Hu Tao 提交于
      This patch prepares for the next patch.
      b4560bf2
    • H
      threadpool impl · 482380b5
      Hu Tao 提交于
      * src/util/threadpool.c, src/util/threadpool.h: Thread pool
        implementation
      * src/Makefile.am: Build thread pool
      * src/libvirt_private.syms: Export public functions
      482380b5
    • E
      command: avoid memory leak · 8e9ee30e
      Eric Blake 提交于
      * src/util/command.c (virCommandRun): Fix yesterday's regression
      on logging, and avoid leaking log-only output captures.
      Reported by Hu Tao.
      8e9ee30e
  4. 09 12月, 2010 4 次提交
    • J
      qemu: Distinguish between domain shutdown and crash · c778fe96
      Jiri Denemark 提交于
      When we get an EOF event on monitor connection, it may be a result of
      either crash or graceful shutdown. QEMU which supports async events
      (i.e., we are talking to it using JSON monitor) emits SHUTDOWN event on
      graceful shutdown. In case we don't get this event by the time monitor
      connection is closed, we assume the associated domain crashed.
      c778fe96
    • R
      qemu: call drive_del in DetachPciDiskDevice · aefaeb3d
      Ryan Harper 提交于
      Currently libvirt doesn't confirm whether the guest has responded to the
      disk removal request.  In some cases this can leave the guest with
      continued access to the device while the mgmt layer believes that it has
      been removed.  With a recent qemu monitor command[1] we can
      deterministically revoke a guests access to the disk (on the QEMU side)
      to ensure no futher access is permitted.
      
      This patch adds support for the drive_del() command and introduces it
      in the disk removal paths.  If the guest is running in a QEMU without this
      command we currently explicitly check for unknown command/CommandNotFound
      and log the issue.
      
      If QEMU supports the command we issue the drive_del command after we attempt
      to remove the device.  The guest may respond and remove the block device
      before we get to attempt to call drive_del.  In that case, we explicitly check
      for 'Device not found' from the monitor indicating that the target drive
      was auto-deleted upon guest responds to the device removal notification.
      
      1. http://thread.gmane.org/gmane.comp.emulators.qemu/84745Signed-off-by: NRyan Harper <ryanh@us.ibm.com>
      aefaeb3d
    • R
      qemu: call drive_unplug in DetachPciDiskDevice · 0cdc9829
      Ryan Harper 提交于
      Currently libvirt doesn't confirm whether the guest has responded to the
      disk removal request.  In some cases this can leave the guest with
      continued access to the device while the mgmt layer believes that it has
      been removed.  With a recent qemu monitor command[1] we can
      deterministically revoke a guests access to the disk (on the QEMU side)
      to ensure no futher access is permitted.
      
      This patch adds support for the drive_unplug() command and introduces it
      in the disk removal paths.  There is some discussion to be had about how
      to handle the case where the guest is running in a QEMU without this
      command (and the fact that we currently don't have a way of detecting
      what monitor commands are available).
      
      Changes since v2:
       - use VIR_ERROR to report when unplug command not found
      Changes since v1:
       - return > 0 when command isn't present, < 0 on command failure
       - detect when drive_unplug command isn't present and log error
         instead of failing entire command
      Signed-off-by: NRyan Harper <ryanh@us.ibm.com>
      0cdc9829
    • A
      qemud: fix memory leak in io error events · 560ed3eb
      Anthony Liguori 提交于
      The extra data isn't being free()'d for IO error events that have a reason.
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      560ed3eb
  5. 08 12月, 2010 15 次提交
    • O
      qemu: Only build devstr when needs (attach PCI controller) · 981f7c8c
      Osier Yang 提交于
      - qemudDomainAttachPciControllerDevice: Don't build "devstr"
        if "-device" of qemu is not available, as "devstr" will only
        be used by "qemuMonitorAddDevice", which depends on "-device"
        argument of qemu is supported.
      
      - "qemudDomainSaveImageOpen": Fix indent problem.
      
      * src/qemu/qemu_driver.c
      981f7c8c
    • J
      qemu: Enable disabled debug messages · e8785146
      Jiri Denemark 提交于
      e8785146
    • J
      qemu: Use -vga none only if it is supported · 2cfb1079
      Jiri Denemark 提交于
      Commit febc5916 introduced -vga none in
      case no video card is included in domain XML. However, old qemu
      versions do not support this and such domain cannot be successfully
      started.
      2cfb1079
    • J
      virsh: fix a typo in the memtune help description · 6f7c6f8c
      Justin Clift 提交于
      6f7c6f8c
    • J
      docs: updated virsh command reference download links to new version · 3b45eec5
      Justin Clift 提交于
      The new version lists every virsh command, its description, and
      the version of libvirt where it became available.
      3b45eec5
    • J
      configure: improve misleading libnl missing error message · b113d279
      Justin Clift 提交于
      This fixes a misleading error message saying the libnl package
      needs to be installed, when it's really the libnl-devel package
      needing to be installed.
      b113d279
    • E
      maint: update to latest gnulib · 8f636752
      Eric Blake 提交于
      * .gnulib: Update to latest, for at least a stdint.h fix
      * src/storage/storage_driver.c (storageVolumeZeroSparseFile)
      (storageWipeExtent): Use better type, although it still triggers
      spurious -Wformat warning on MacOS's gcc.
      8f636752
    • J
      e3cb5a26
    • E
      openvz: avoid potential buffer overflow · a0ac00f4
      Eric Blake 提交于
      * src/openvz/openvz_conf.c (openvzLoadDomains): Replace unsafe
      sscanf with safe direct parsing.
      (openvzGetVEID): Avoid lost integer overflow detection.
      (openvzAssignUUIDs): Likewise, and detect readdir failure.
      a0ac00f4
    • E
      openvz: convert popen to virCommand · bfd6267b
      Eric Blake 提交于
      popen must be matched with pclose (not fclose), or it will leak
      resources.  Furthermore, it is a lousy interface when it comes to
      signal handling.  We're much better off using our decent command
      wrapper.  Note that virCommand guarantees that VIR_FREE(outbuf) is
      both required and safe to call, whether virCommandRun succeeded or
      failed.
      
      * src/openvz/openvz_conf.c (openvzLoadDomains, openvzGetVEID):
      Replace popen with virCommand usage.
      bfd6267b
    • E
      command: improve behavior on no output · cc5e2a84
      Eric Blake 提交于
      Guarantee that outbuf/errbuf are allocated on success, even if to the
      empty string.  Caller always has to free the result, and empty output
      check requires checking if *outbuf=='\0'.  Makes the API easier to use
      safely.  Failure is best effort allocation (some paths, like
      out-of-memory, cannot allocate a buffer, but most do), so caller must
      free buffer on failure.
      
      * docs/internals/command.html.in: Update documentation.
      * src/util/command.c (virCommandSetOutputBuffer)
      (virCommandSetErrorBuffer, virCommandProcessIO) Guarantee empty
      string on no output.
      * tests/commandtest.c (test17): New test.
      cc5e2a84
    • E
      command: enforce fd vs. buffer considerations · ee11729d
      Eric Blake 提交于
      * docs/internals/command.html.in: Better documentation of buffer
      vs. fd considerations.
      * src/util/command.c (virCommandRunAsync): Reject raw execution
      with string io.
      (virCommandRun): Reject execution with user-specified fds not
      visiting a regular file.
      ee11729d
    • J
      tests: Fix commandtest in VPATH build · ea8389dd
      Jiri Denemark 提交于
      ea8389dd
    • E
      tests: fix leaks in commandtest · 3c63a15b
      Eric Blake 提交于
      Most leaks could only occur on error cleanup paths.
      3c63a15b
    • E
      command: improve allocation failure reporting · c426d13b
      Eric Blake 提交于
      * src/util/command.c (virCommandAddEnvString): Remove duplicate
      code.
      (virCommandToString, virCommandRun, virCommandRunAsync)
      (virCommandWait): Report NULL command as ENOMEM, not invalid
      usage.
      Reported by Jiri Denemark.
      c426d13b