1. 24 11月, 2011 15 次提交
  2. 23 11月, 2011 15 次提交
    • P
      qemu: Avoid dereference of NULL pointer · c4b32641
      Peter Krempa 提交于
      If something fails while initializing qemu job object in
      qemuDomainObjPrivateAlloc(), memory to the private pointer is freed, but
      after that, the pointer is still dereferenced, which may result in a
      segfault.
      
      * qemuDomainObjPrivateAlloc() - Don't dereference NULL pointer.
      c4b32641
    • E
      qemu: fix a const-correctness issue · db2f6807
      Eric Blake 提交于
      Generally, functions which return malloc'd strings should be typed
      as 'char *', not 'const char *', to make it obvious that the caller
      is responsible to free things.  free(const char *) fails to compile,
      and although we have a cast embedded in VIR_FREE to work around poor
      code that frees const char *, it's better to not rely on that hack.
      
      * src/qemu/qemu_driver.c (qemuDiskPathToAlias): Change return type.
      (qemuDomainBlockJobImpl): Update caller.
      db2f6807
    • E
      API: prefer 'disk' over 'block' or 'path' · 3ac26e26
      Eric Blake 提交于
      Given that we can now handle the target's disk shorthand, in addition
      to an absolute path to the file or block device used on the host,
      the term 'disk' fits a bit better as the parameter name than 'path'.
      
      * include/libvirt/libvirt.h.in: Update some parameter names.
      * src/libvirt.c (virDomainBlockStats, virDomainBlockStatsFlags)
      (virDomainBlockPeek, virDomainGetBlockInfo, virDomainBlockJobAbort)
      (virDomainGetBlockJobInfo, virDomainBlockJobSetSpeed)
      (virDomainBlockPull): Likewise.
      3ac26e26
    • E
      blockstats: support lookup by path in blockstats · c725e2dc
      Eric Blake 提交于
      Commit 89b6284f made it possible to pass either a source name or
      the target device to most API demanding a disk designation, but
      forgot to update the documentation.  It also failed to update
      virDomainBlockStats to take both forms. This patch fixes both the
      documentation and the remaining function.
      
      Xen continues to use just device shorthand (that is, I did not
      implement path lookup there, since xen does not track a domain_conf
      to quickly tie a path back to the device shorthand).
      
      * src/libvirt.c (virDomainBlockStats, virDomainBlockStatsFlags)
      (virDomainGetBlockInfo, virDomainBlockPeek)
      (virDomainBlockJobAbort, virDomainGetBlockJobInfo)
      (virDomainBlockJobSetSpeed, virDomainBlockPull): Document
      acceptable disk naming conventions.
      * src/qemu/qemu_driver.c (qemuDomainBlockStats)
      (qemuDomainBlockStatsFlags): Allow lookup by source name.
      * src/test/test_driver.c (testDomainBlockStats): Likewise.
      c725e2dc
    • M
      nwfilter: Initialize virNWFilterAddIpAddrForIfname return variable · 489e14f2
      Michal Privoznik 提交于
      Latest nwfilter patch ad6c67cf introduced uninitialized return
      value. This was spotted by 4.6.2 gcc.
      489e14f2
    • D
      Fix disabling of virtual port profile code on old hosts · aad764e1
      Daniel P. Berrange 提交于
      The WITH_VIRTUALPORT macro is defined to 0 when disabled, not
      left undefined. So #if must be used instead of #ifdef
      
      * src/util/virnetdevvportprofile.c: s/#ifdef/#if/
      aad764e1
    • D
      Fix uninitialized variable in NWfilter IP learning code · 3fb94eee
      Daniel P. Berrange 提交于
      * src/nwfilter/nwfilter_learnipaddr.c: Initialize ret variable
      3fb94eee
    • S
      Enable detection of multiple IP addresses · ad6c67cf
      Stefan Berger 提交于
      In preparation of DHCP Snooping and the detection of multiple IP
      addresses per interface:
      
      The hash table that is used to collect the detected IP address of an
      interface can so far only handle one IP address per interface. With
      this patch we extend this to allow it to handle a list of IP addresses.
      
      Above changes the returned variable type of virNWFilterGetIpAddrForIfname()
      from char * to virNWFilterVarValuePtr; adapt all existing functions calling
      this function.
      ad6c67cf
    • E
      fix error message when using wrong URI alias · 5c5e07b8
      Eli Qiao 提交于
      Signed-off-by: NEli Qiao <taget@linux.vnet.ibm.com>
      
      When configuring a URI alias like this in 'libvirt.conf':
      
      uri_aliases = [
        "jj#j=qemu+ssh://root@127.0.0.1/system",
        "sleet=qemu+ssh://root@sleet.cloud.example.com/system",
      ]
      virsh -c jj#j
      
      It will show this error message:
      'no connection driver available for No connection for URI jj#j'
      Actually,we expect this message below:
      Malformed 'uri_aliases' config entry 'jj#j=qemu+ssh://root@127.0.0.1/system', aliases may only contain 'a-Z, 0-9, _, -'
      
      Give this patch to fix this error.
      5c5e07b8
    • S
      Pass additional parameter into applyDHCPOnly function · 7ca82ecb
      Stefan Berger 提交于
      In preparation for the DHCP Snooping code:
      Pass an additional parameter into the applyDHCPOnly function
      of the 'techdriver'.
      7ca82ecb
    • S
      nwfilter: use shell variable to invoke 'ip(6)tables' command · aa1cb7e7
      Stefan Berger 提交于
      Introduce a shell variable 'IBT' to invoke the ip(6)tables command.
      
      Tested with libvirt-tck.
      aa1cb7e7
    • S
      nwfilter: use shell variable to invoke 'ebtables' command · 970b417a
      Stefan Berger 提交于
      Introduce a shell variable 'EBT' to invoke the ebtables command.
      Hard-code the used ebtables table to '-t nat'.
      
      Tested with libvirt-tck.
      970b417a
    • S
      Improve error reporting of failures to apply filtering rules · fa69eb5f
      Stefan Berger 提交于
      Display the executed command and failure message if a command failed to
      execute.
      Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
      fa69eb5f
    • S
      Add support for STP filtering · ba3bf00a
      Stefan Berger 提交于
      This patch adds support for filtering of STP (spanning tree protocol) traffic
      to the parser and makes us of the ebtables support for STP filtering. This code
      now enables the filtering of traffic in chains with prefix 'stp'.
      Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
      ba3bf00a
    • S
      Add a 'mac' chain · af37ce3d
      Stefan Berger 提交于
      With hunks borrowed from one of David Steven's previous patches, we now
      add the capability of having a 'mac' chain which is useful to filter
      for multiple valid MAC addresses.
      Signed-off-by: NDavid L Stevens <dlstevens@us.ibm.com>
      Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
      af37ce3d
  3. 22 11月, 2011 5 次提交
    • D
      Add strings.h include to capabilities.h for ffs() function prototype · 720442e2
      Daniel P. Berrange 提交于
      On Mingw32 the ffs() function was not declared due to missing header
      include
      
      * src/conf/capabilities.c: The ffs() function lives in strings.h
      720442e2
    • C
      storage: Fallback to use lvchange first if lvremove fails · 3c540514
      Chang Liu 提交于
      virStorageBackendLogicalDeleteVol() could not remove the lv with error
      "could not remove open logical volume" sometimes. Generally it's caused
      by the volume is still active, even if lvremove tries to remove it with
      option "--force".
      
      This patch is to fix it by disbale the lv first using "lvchange -aln"
      and "lvremove -f" afterwards if the direct "lvremove -f" failed.
      3c540514
    • S
      Export KVM Host Power Management capabilities · e352b164
      Srivatsa S. Bhat 提交于
      This patch exports KVM Host Power Management capabilities as XML so that
      higher-level systems management software can make use of these features
      available in the host.
      
      The script "pm-is-supported" (from pm-utils package) is run to discover if
      Suspend-to-RAM (S3) or Suspend-to-Disk (S4) is supported by the host.
      If either of them are supported, then a new tag "<power_management>" is
      introduced in the XML under the <host> tag.
      
      However in case the query to check for power management features succeeded,
      but the host does not support any such feature, then the XML will contain
      an empty <power_management/> tag. In the event that the PM query itself
      failed, the XML will not contain any "power_management" tag.
      
      To use this, new APIs could be implemented in libvirt to exploit power
      management features such as S3/S4.
      e352b164
    • E
      conf: don't modify cpu set string during parsing · 693d22d4
      Eric Blake 提交于
      None of the callers cared if str was updated to point to the next
      byte after the parsed cpuset; simplifying this results in quite
      a few code simplifications.  Additionally, virCPUDefParseXML was
      strdup()'ing a malloc()'d string; avoiding a memory copy resulted
      in less code.
      
      * src/conf/domain_conf.h (virDomainCpuSetParse): Alter signature.
      * src/conf/domain_conf.c (virDomainCpuSetParse): Don't modify str.
      (virDomainVcpuPinDefParseXML, virDomainDefParseXML): Adjust
      callers.
      * src/conf/cpu_conf.c (virCPUDefParseXML): Likewise.
      * src/xen/xend_internal.c (sexpr_to_xend_topology): Likewise.
      * src/xen/xm_internal.c (xenXMDomainPinVcpu): Likewise.
      * src/xenxs/xen_sxpr.c (xenParseSxpr): Likewise.
      * src/xenxs/xen_xm.c (xenParseXM): Likewise.
      693d22d4
    • R
      qemu: don't release network actual device twice · 334c539b
      Roopa Prabhu 提交于
      For direct attach devices, in qemuBuildCommandLine, we seem to be freeing
      actual device on error path (with networkReleaseActualDevice). But the actual
      device is not deleted.
      
      qemuProcessStop eventually deletes the direct attach device and releases
      actual device. But by the time qemuProcessStop is called qemuBuildCommandLine
      has already freed actual device, leaving stray macvtap devices behind on error.
      So the simplest fix is to remove the networkReleaseActualDevice in
      qemuBuildCommandLine. This patch does just that.
      Signed-off-by: NRoopa Prabhu <roprabhu@cisco.com>
      334c539b
  4. 21 11月, 2011 4 次提交
    • M
      qemu: Copy console definition from serial · 2e37bf42
      Michal Privoznik 提交于
      Now, when we support multiple consoles per domain,
      the vm->def->console[0] can still remain an alias
      for vm->def->serial[0]; However, we need to copy
      it's source definition as well otherwise we'll regress
      on virDomainOpenConsole.
      2e37bf42
    • D
      Fix distribution of .syms files for previous commit · b7458176
      Daniel P. Berrange 提交于
      * src/Makefile.am: Remove libvirt_bridge.syms and libvirt_macvtap.syms
        from EXTRA_DIST. Add libvirt_dbus.syms
      b7458176
    • D
      Fix build on Mingw32 wrt export of virNetServerGetDBusConn · 66d5d3f1
      Daniel P. Berrange 提交于
      Mingw32 complains if you request export of a symbol which does
      not in fact exist.
      
      * src/libvirt_bridge.syms, src/libvirt_macvtap.syms: Delete
        obsolete files
      * src/libvirt_private.syms: Remove virNetServerGetDBusConn
      * src/libvirt_dbus.syms: Add virNetServerGetDBusConn
      66d5d3f1
    • O
      storage: Skips backingStore of virtual snapshot lv · d26b73ca
      Osier Yang 提交于
      lvs outputs "[$lvname_vorigin]" for the virtual snapshot lv
      (created with "--virtualsize"), and the original device pointed
      by "$lvname_vorigin" is just for lvm internal use, one should
      never use it.
      
      Per lvm's nameing rules, "[" is not valid as part of the vg/lv name.
      (man 8 lvm).
      
      <quote>
      VALID NAMES
      The following characters are valid for VG and LV names: a-z A-Z 0-9 + _
      . -
      
      VG and LV names cannot begin with a hyphen.   There  are  also  various
      reserved  names that are used internally by lvm that can not be used as
      LV or VG names.  A VG cannot be called anything that exists in /dev/ at
      the time of creation, nor can it be called '.' or '..'.  A LV cannot be
      called '.' '..' 'snapshot' or 'pvmove'. The LV name may also  not  con‐
      tain the strings '_mlog' or '_mimage'
      </quote>
      
      So we can skip the set the lv's backingStore by checking if the name
      begins with a "[".
      d26b73ca
  5. 19 11月, 2011 1 次提交