1. 13 4月, 2012 1 次提交
  2. 30 3月, 2012 1 次提交
  3. 27 3月, 2012 1 次提交
  4. 09 3月, 2012 1 次提交
    • L
      util: standardize return from functions calling virNetlinkCommand · 0208face
      Laine Stump 提交于
      There are several functions that call virNetlinkCommand, and they all
      follow a common pattern, with three exit labels: err_exit (or
      cleanup), malformed_resp, and buffer_too_small. All three of these
      labels do their own cleanup and have their own return. However, the
      malformed_resp label usually frees the same items as the
      cleanup/err_exit label, and the buffer_too_small label just doesn't
      free recvbuf (because it's known to always be NULL at the time we goto
      buffer_too_small.
      
      In order to simplify and standardize the code, I've made the following
      changes to all of these functions:
      
      1) err_exit is replaced with the more libvirt-ish "cleanup", which
         makes sense because in all cases this code is also executed in the
         case of success, so labelling it err_exit may be confusing.
      
      2) rc is initialized to -1, and set to 0 just before the cleanup
         label. Any code that currently sets rc = -1 is made to instead goto
         cleanup.
      
      3) malformed_resp and buffer_too_small just log their error and goto
         cleanup. This gives us a single return path, and a single place to
         free up resources.
      
      4) In one instance, rather then logging an error immediately, a char*
         msg was pointed to an error string, then goto cleanup (and cleanup
         would log an error if msg != NULL). It takes no more lines of code
         to just log the message as we encounter it.
      
      This patch should have 0 functional effects.
      0208face
  5. 06 3月, 2012 2 次提交
    • R
      util: Changes to support portprofiles for hostdevs · 15bbfd83
      Roopa Prabhu 提交于
      This patch includes the following changes to virnetdevmacvlan.c and
      virnetdevvportprofile.c:
      
       - removes some netlink functions which are now available in
         virnetdev.c
      
       - Adds a vf argument to all port profile functions.
      
      For 802.1Qbh devices, the port profile calls can use a vf argument if
      passed by the caller. If the vf argument is -1 it will try to derive the vf
      if the device passed is a virtual function.
      
      For 802.1Qbg devices, This patch introduces a null check for the device
      argument because during port profile assignment on a hostdev, this argument
      can be null.
      Signed-off-by: NRoopa Prabhu <roprabhu@cisco.com>
      15bbfd83
    • L
      util: eliminate crash in virNetDevMacVLanCreateWithVPortProfile · d2a9d55f
      Laine Stump 提交于
      Commit 723d5c (added after the release of 0.9.10) adds a
      NetlinkEventClient for each interface sent to
      virNetDevMacVLanCreateWithVPortProfile. This should only be done if
      the interface actually *has* a virtPortProfile, otherwise the event
      handler would be a NOP. The bigger problem is that part of the setup
      to create the NetlinkEventClient is to do a memcpy of virtPortProfile
      - if it's NULL, this triggers a segv.
      
      This patch just qualifies the code that adds the client - if
      virtPortProfile is NULL, it's skipped.
      d2a9d55f
  6. 29 2月, 2012 1 次提交
  7. 04 2月, 2012 1 次提交
  8. 28 1月, 2012 1 次提交
  9. 01 12月, 2011 1 次提交
  10. 19 11月, 2011 9 次提交
    • E
      build: fix compile error with no macvtap · f14b4cb5
      Eric Blake 提交于
      Since commit 6ec8288a, compilation has failed on RHEL 5:
      
      util/virnetdevmacvlan.c:672: error: conflicting types for 'virNetDevMacVLanCreateWithVPortProfile'
      
      * src/util/virnetdevmacvlan.c
      (virNetDevMacVLanCreateWithVPortProfile): Add missing parameter.
      f14b4cb5
    • D
      Allow creation of plain macvlan devices · 6ec8288a
      Daniel P. Berrange 提交于
      Update virNetDevMacVLanCreateWithVPortProfile to allow creation
      of plain macvlan devices, as well as macvtap devices. The former
      is useful for LXC containers
      
      * src/qemu/qemu_command.c: Explicitly request a macvtap device
      * src/util/virnetdevmacvlan.c, src/util/virnetdevmacvlan.h: Add
        new flag to allow switching between macvlan and macvtap
        creation
      6ec8288a
    • D
      Move ifaceMacvtapLinkDump and ifaceGetNthParent functions · 91904106
      Daniel P. Berrange 提交于
      Move the ifaceMacvtapLinkDump and ifaceGetNthParent functions
      into virnetdevvportprofile.c since they are specific to that
      code. This avoids polluting the headers with the Linux specific
      netlink data types
      
      * src/util/interface.c, src/util/interface.h: Move
        ifaceMacvtapLinkDump and ifaceGetNthParent functions and delete
        remaining file
      * src/util/virnetdevvportprofile.c: Add ifaceMacvtapLinkDump
        and ifaceGetNthParent functions
      * src/network/bridge_driver.c, src/nwfilter/nwfilter_gentech_driver.c,
        src/nwfilter/nwfilter_learnipaddr.c, src/util/virnetdevmacvlan.c:
        Remove include of interface.h
      91904106
    • D
      Rename ifaceGetIndex and ifaceGetVLAN · ebbb6bd1
      Daniel P. Berrange 提交于
      Rename the ifaceGetIndex method to virNetDevGetIndex and
      ifaceGetVlanID to virNetDevGetVLanID. Also change the error
      reporting behaviour to always raise errors and return -1 on
      failure
      
      * util/interface.c, util/interface.h: Rename ifaceGetIndex
        and ifaceGetVLAN
      * nwfilter/nwfilter_gentech_driver.c, nwfilter/nwfilter_learnipaddr.c,
        nwfilter/nwfilter_learnipaddr.c, util/virnetdevvportprofile.c: Update
        for API renames and error handling changes
      ebbb6bd1
    • D
      Rename interface MAC address replacement APIs · 10462d5c
      Daniel P. Berrange 提交于
      Rename ifaceReplaceMacAddress to virNetDevReplaceMacAddress
      and ifaceRestoreMacAddress to virNetDevRestoreMacAddress.
      
      * util/interface.c, util/interface.h, util/virnetdevmacvlan.c:
        Rename APIs
      10462d5c
    • D
      Move the low level macvlan creation APIs · d2fed854
      Daniel P. Berrange 提交于
      Move the low level macvlan creation APIs into the
      virnetdevmacvlan.c file where they more naturally
      belong
      
      * util/interface.c, util/interface.h: Remove virNetDevMacVLanCreate
        and virNetDevMacVLanDelete
      * util/virnetdevmacvlan.c, util/virnetdevmacvlan.h: Add
        virNetDevMacVLanCreate and virNetDevMacVLanDelete
      d2fed854
    • D
      Rename low level macvlan creation APIs · 57f0de4c
      Daniel P. Berrange 提交于
      Rename ifaceMacvtapLinkAdd to virNetDevMacVLanCreate and
      ifaceLinkDel to virNetDevMacVLanDelete. Strictly speaking
      the latter isn't restricted to macvlan devices, but that's
      the only use libvirt has for it.
      
      * util/interface.c, util/interface.h,
        util/virnetdevmacvlan.c: Rename APIs
      57f0de4c
    • D
      Rename high level macvlan creation APIs · 191090ae
      Daniel P. Berrange 提交于
      Rename virNetDevMacVLanCreate to virNetDevMacVLanCreateWithVPortProfile
      and virNetDevMacVLanDelete to virNetDevMacVLanDeleteWithVPortProfile
      
      To make way for renaming the other macvlan creation APIs in
      interface.c
      
      * util/virnetdevmacvlan.c, util/virnetdevmacvlan.h,
        qemu/qemu_command.c, qemu/qemu_hotplug.c, qemu/qemu_process.c:
        Rename APIs
      191090ae
    • D
      Rename and split the macvtap.c file · 896104c9
      Daniel P. Berrange 提交于
      Rename the macvtap.c file to virnetdevmacvlan.c to reflect its
      functionality. Move the port profile association code out into
      virnetdevvportprofile.c. Make the APIs available unconditionally
      to callers
      
      * src/util/macvtap.h: rename to src/util/virnetdevmacvlan.h,
      * src/util/macvtap.c: rename to src/util/virnetdevmacvlan.c
      * src/util/virnetdevvportprofile.c, src/util/virnetdevvportprofile.h:
        Pull in vport association code
      * src/Makefile.am, src/conf/domain_conf.h, src/qemu/qemu_conf.c,
        src/qemu/qemu_conf.h, src/qemu/qemu_driver.c: Update include
        paths & remove conditional compilation
      896104c9