1. 30 7月, 2010 11 次提交
    • C
      Fix a memory leak in the qemudBuildCommandLine. · 4313e1b9
      Chris Lalancette 提交于
      ADD_ARG_LIT should only be used for literal arguments,
      since it duplicates the memory.  Since virBufferContentAndReset
      is already allocating memory, we should only use ADD_ARG.
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      4313e1b9
    • M
      esx: Fix freeing of heterogeneous lists · 5cff36e3
      Matthias Bolte 提交于
      Always call the free function of the base type. The base type
      function then dynamically dispatches the call to the free function
      for the actual type.
      5cff36e3
    • M
      c38e2f7a
    • M
      esx: Improve blocked task detection and fix race condition · 25e34b70
      Matthias Bolte 提交于
      esxVI_WaitForTaskCompletion can take a UUID to lookup the
      corresponding domain and check if the current task for it
      is blocked by a question. It calls another function to do
      this: esxVI_LookupAndHandleVirtualMachineQuestion looks up
      the VirtualMachine and checks for a question. If there is
      a question it calls esxVI_HandleVirtualMachineQuestion to
      handle it.
      
      If there was no question or it has been answered the call
      to esxVI_LookupAndHandleVirtualMachineQuestion returns 0.
      If any error occurred during the lookup and answering
      process -1 is returned. The problem with this is, that -1
      is also returned when there was no error but the question
      could not be answered. So esxVI_WaitForTaskCompletion cannot
      distinguish between this two situations and reports that a
      question is blocking the task even when there was actually
      another problem.
      
      This inherent problem didn't surface until vSphere 4.1 when
      you try to define a new domain. The driver tries to lookup
      the domain that is just in the process of being registered.
      There seems to be some kind of race condition and the driver
      manages to issue a lookup command before the ESX server was
      able to register the domain. This used to work before.
      
      Due to the return value problem described above the driver
      reported a false error message in that case.
      
      To solve this esxVI_WaitForTaskCompletion now takes an
      additional occurrence parameter that describes whether or
      not to expect the domain to be existent. Also add a new
      parameter to esxVI_LookupAndHandleVirtualMachineQuestion
      that allows to distinguish if the call returned -1 because
      of an actual error or because the question could not be
      answered.
      25e34b70
    • E
      esx: silence spurious compiler warning · 2c216d95
      Eric Blake 提交于
      * src/esx/esx_vi_types.c (_DESERIALIZE_NUMBER)
      (ESX_VI__TEMPLATE__DESERIALIZE_NUMBER): Add range check to shut up
      gcc 4.5.0 regarding long long.
      2c216d95
    • E
      build: distribute libvirt_qemu.syms · 701f356a
      Eric Blake 提交于
      * src/Makefile.am (EXTRA_DIST): Ensure 'make distcheck' and
      'rpmbuild' can reproduce a build.
      * daemon/Makefile.am (DAEMON_SOURCES): Likewise.
      701f356a
    • E
      build: restore operation of bit-rotted 'make cov' · e7064aa6
      Eric Blake 提交于
      './autobuild.sh' with lcov installed discovered that our
      coverage support has been bit-rotting for a while.  This
      restores it back to a successful state, although I have
      not yet spent any time looking through the resulting files to
      look for low-hanging fruit in the unit test coverage front.
      
      * configure.ac: Clear COMPILER_FLAGS at right place.
      * Makefile.am (cov): Newer genhtml no longer likes plain -s.
      * m4/compiler-flags.m4 (gl_COMPILER_FLAGS): Don't AC_SUBST
      COMPILER_FLAGS; it is a shell variable for use in configure only.
      * src/Makefile.am (AM_CFLAGS, AM_LDFLAGS): New variables, to make
      it easier to provide global flag additions.  Use throughout, to
      uniformly apply coverage flags.
      * .gitignore: Globally ignore gcov output.
      * daemon/.gitignore: Simplify.
      * src/.gitignore: Likewise.
      * tests/.gitignore: Likewise.
      e7064aa6
    • E
      xen: fix logic bug · 08ae41e9
      Eric Blake 提交于
      The recent switch to enable -Wlogical-op paid off again.
      gcc 4.5.0 (rawhide) is smarter than 4.4.4 (Fedora 13).
      
      * src/xen/xend_internal.c (xenDaemonAttachDeviceFlags)
      (xenDaemonUpdateDeviceFlags, xenDaemonDetachDeviceFlags): Use
      correct operator.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      08ae41e9
    • E
      build: fix 'make syntax-check' failure · d580eafc
      Eric Blake 提交于
      src/lxc/veth.c:150:        VIR_DEBUG(_("Failed to delete '%s' (%d)"),
      src/lxc/veth.c:188:            VIR_DEBUG(_("Failed to disable '%s' (%d)"),
      maint.mk: do not mark these strings for translation
      
      * src/lxc/veth.c (vethDelete, vethInterfaceUpOrDown): Don't
      translate VIR_DEBUG.
      d580eafc
    • R
      lxc: Fix return values of veth.c functions · 938f2dbd
      Ryota Ozaki 提交于
      Previously, the functions in src/lxc/veth.c could sometimes return
      positive values on failure rather than -1. This made accurate error
      reporting difficult, and led to one failure to catch an error in a
      calling function.
      
      This patch makes all the functions in veth.c consistently return 0 on
      success, and -1 on failure. It also fixes up the callers to the veth.c
      functions where necessary.
      
      Note that this patch may be related to the bug:
      
        https://bugzilla.redhat.com/show_bug.cgi?id=607496.
      
      It will not fix the bug, but should unveil what happens.
      
      * po/POTFILES.in - add veth.c, which previously had no translatable strings
      * src/lxc/lxc_controller.c
      * src/lxc/lxc_container.c
      * src/lxc/lxc_driver.c    - fixup callers to veth.c, and remove error logs,
                                  as they are now done in veth.c
      * src/lxc/veth.c - make all functions consistently return -1 on error.
      * src/lxc/veth.h - use ATTRIBUTE_NONNULL to protect against NULL args.
      938f2dbd
    • L
      Eliminate memory leak in xenUnifiedDomainInfoListFree · 1999e4f8
      Laine Stump 提交于
      This fixes a leak described in
      
         https://bugzilla.redhat.com/show_bug.cgi?id=590073
      
      xenUnifiedDomainInfoList has a pointer to a list of pointers to
      xenUnifiedDomain. We were freeing up all the domains, but neglecting
      to free the list.
      
      This was found by Paolo Bonzini <pbonzini@redhat.com>.
      1999e4f8
  2. 29 7月, 2010 7 次提交
  3. 28 7月, 2010 6 次提交
  4. 27 7月, 2010 5 次提交
    • C
      Force FLR on for buggy SR-IOV devices. · 71e92a15
      Chris Lalancette 提交于
      Some buggy PCI devices actually support FLR, but
      forget to advertise that fact in their PCI config space.
      However, Virtual Functions on SR-IOV devices are
      *required* to support FLR by the spec, so force has_flr
      on if this is a virtual function.
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      71e92a15
    • C
      pciResetDevice: use inactive devices to determine safe reset · 46bcdb96
      Chris Wright 提交于
      When doing a PCI secondary bus reset, we must be sure that there are no
      active devices on the same bus segment.  The active device tracking is
      designed to only track host devices that are active in use by guests.
      This ignores host devices that are actively in use by the host.  So the
      current logic will reset host devices.
      
      Switch this logic around and allow sbus reset when we are assigning all
      devices behind a bridge to the same guest at guest startup or as a result
      of a single attach-device command.
      
      * src/util/pci.h: change signature of pciResetDevice to add an
        inactive devices list
      * src/qemu/qemu_driver.c src/xen/xen_driver.c: use (or not) the new
        functionality of pciResetDevice() depending on the place of use
      * src/util/pci.c: implement the interface and logic changes
      46bcdb96
    • C
      qemudDomainAttachHostPciDevice refactor to use new helpers · 042b2083
      Chris Wright 提交于
      - src/qemu/qemu_driver.c: Eliminate code duplication by using the new
        helpers qemuPrepareHostdevPCIDevices and qemuDomainReAttachHostdevDevices.
        This reduces the number of open coded calls to pciResetDevice.
      042b2083
    • C
      Add helpers qemuPrepareHostdevPCIDevice and qemuDomainReAttachHostdevDevices · f1365b55
      Chris Wright 提交于
      - src/qemu/qemu_driver.c: These new helpers take hostdev list and count
        directly rather than getting them indirectly from domain definition.
        This will allow reuse for the attach-device case.
      f1365b55
    • C
      qemuGetPciHostDeviceList take hostdev list directly · 8bd00c0e
      Chris Wright 提交于
      - src/qemu/qemu_driver.c: Update qemuGetPciHostDeviceList to take a
        hostdev list and count directly, rather than getting this indirectly
        from domain definition. This will allow reuse for the attach-device case.
      8bd00c0e
  5. 25 7月, 2010 2 次提交
    • M
      esx: Support vSphere 4.1 · d3864c37
      Matthias Bolte 提交于
      Also accept version > 4.1, but output a warning.
      d3864c37
    • M
      esx: Add vpx:// scheme to allow direct connection to a vCenter · 3827f7f0
      Matthias Bolte 提交于
      Add a pointer to the primary context of a connection and use it in all
      driver functions that don't dependent on the context type. This includes
      almost all functions that deal with a virDomianPtr. Therefore, using
      a vpx:// connection allows you to perform all the usual domain related
      actions like start, destroy, suspend, resume, dumpxml etc.
      
      Some functions that require an explicitly specified ESX server don't work
      yet. This includes the host UUID, the hostname, the general node info, the
      max vCPU count and the free memory. Also not working yet are migration and
      defining new domains.
      3827f7f0
  6. 24 7月, 2010 9 次提交
    • M
      esx: Don't ignore the vcenter query parameter · 1b38e92b
      Matthias Bolte 提交于
      Since 070f6100 the vcenter query
      parameter has been ignored, because the refactoring to use
      esxUtil_ParseQuery was incomplete. This effectively broke migration,
      because the vcenter query parameter is essential for a migration.
      1b38e92b
    • M
      esx: Add autodetection for the SCSI controller model · cf8cf8a5
      Matthias Bolte 提交于
      This works for file-backed SCSI disk device with a datastore
      related source path.
      cf8cf8a5
    • M
      esx: Allow 'vmpvscsi' as SCSI controller model · afb85c58
      Matthias Bolte 提交于
      afb85c58
    • M
      virt-aa-helper: Make getopt accept the p option · d01340e7
      Matthias Bolte 提交于
      Commit 68719c4b added the
      p option to control disk format probing, but it wasn't added
      to the getopt_long optstring parameter.
      
      Add the p option to the getopt_long optstring parameter.
      d01340e7
    • M
      virt-aa-helper: Fix return value of add_file_path · adde0e2c
      Matthias Bolte 提交于
      Commit a8853344 added this
      function and wrapped vah_add_file in it. vah_add_file may
      return -1, 0, 1. It returns 1 in case the call to valid_path
      detects a restricted file. The original code treated a return
      value != 0 as error. The refactored code treats a return
      value < 0 as error. This triggers segfault in virt-aa-helper
      and breaks virt-aa-helper-test for the restricted file tests.
      
      Make sure that add_file_path returns -1 on error.
      adde0e2c
    • M
      virt-aa-helper: Ignore open errors again · 05c9a413
      Matthias Bolte 提交于
      virt-aa-helper used to ignore errors when opening files.
      Commit a8853344 refactored
      the related code and changed this behavior. virt-aa-helper
      didn't ignore open errors anymore and virt-aa-helper-test
      fails.
      
      Make sure that virt-aa-helper ignores open errors again.
      05c9a413
    • E
      qemu-api: avoid build failure · 80f7a45c
      Eric Blake 提交于
      * src/remote_protocol-structs: Tweak to match intentional type
      change (with no ABI change) in remote protocol.
      80f7a45c
    • C
      Add tests for the new Qemu namespace XML. · a71be01f
      Chris Lalancette 提交于
      Thanks to DV for knocking together the Relax-NG changes
      quickly for me.
      
      Changes since v1:
       - Change the domain.rng to correspond to the new schema
       - Don't allocate caps->ns in testQemuCapsInit since it is a static table
      
      Changes since v2:
       - Change domain.rng to add restrictions on allowed environment names
      
      Changes since v3:
       - Remove a bogus comment in the tests
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      a71be01f
    • C
      Qemu remote protocol. · 337d201e
      Chris Lalancette 提交于
      Since we are adding a new "per-hypervisor" protocol, we
      make it so that the qemu remote protocol uses a new
      PROTOCOL and PROGRAM number.  This allows us to easily
      distinguish it from the normal REMOTE protocol.
      
      This necessitates changing the proc in remote_message_header
      from a "remote_procedure" to an "unsigned", which should
      be the same size (and thus preserve the on-wire protocol).
      
      Changes since v1:
       - Fixed up a couple of script problems in remote_generate_stubs.pl
       - Switch an int flag to a bool in dispatch.c
      
      Changes since v2:
       - None
      
      Changes since v3:
       - Change unsigned proc to signed proc, to conform to spec
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      337d201e