1. 24 7月, 2010 2 次提交
    • C
      Qemu Monitor API entry point. · 21adf03c
      Chris Lalancette 提交于
      Add the library entry point for the new virDomainQemuMonitorCommand()
      entry point.  Because this is not part of the "normal" libvirt API,
      it gets its own header file, library file, and will eventually
      get its own over-the-wire protocol later in the series.
      
      Changes since v1:
       - Go back to using the virDriver table for qemuDomainMonitorCommand, due to
         linking issues
       - Added versioning information to the libvirt-qemu.so
      
      Changes since v2:
       - None
      
      Changes since v3:
       - Add LGPL header to libvirt-qemu.c
       - Make virLibConnError and virLibDomainError macros instead of function calls
      
      Changes since v4:
       - Move exported symbols to libvirt_qemu.syms
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      21adf03c
    • C
      Qemu arbitrary command-line arguments. · 869939a5
      Chris Lalancette 提交于
      Implement the qemu hooks for XML namespace data.  This
      allows us to specify a qemu XML namespace, and then
      specify:
      
      <qemu:commandline>
       <qemu:arg value='arg'/>
       <qemu:env name='name' value='value'/>
      </qemu:commandline>
      
      In the domain XML.
      
      Changes since v1:
       - Change the <qemu:arg>arg</qemu:arg> XML to <qemu:arg value='arg'/> XML
       - Fix up some memory leaks in qemuDomainDefNamespaceParse
       - Rename num_extra and extra to num_args and args, respectively
       - Fixed up some error messages
       - Make sure to escape user-provided data in qemuDomainDefNamespaceFormatXML
      
      Changes since v2:
       - Add checking to ensure environment variable names are valid
       - Invert the logic in qemuDomainDefNamespaceFormatXML to return early
      
      Changes since v3:
       - Change strspn() to c_isalpha() check of first letter of environment variable
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      869939a5
  2. 22 7月, 2010 1 次提交
    • L
      Change virFileOperation to return -errno (ie < 0) on error. · 2ad04f78
      Laine Stump 提交于
      virFileOperation previously returned 0 on success, or the value of
      errno on failure. Although there are other functions in libvirt that
      use this convention, the preferred (and more common) convention is to
      return 0 on success and -errno (or simply -1 in some cases) on
      failure. This way the check for failure is always (ret < 0).
      
      * src/util/util.c - change virFileOperation and virFileOperationNoFork to
                          return -errno on failure.
      
      * src/storage/storage_backend.c, src/qemu/qemu_driver.c
        - change the hook functions passed to virFileOperation to return
          -errno on failure.
      2ad04f78
  3. 21 7月, 2010 2 次提交
    • D
      Explicitly represent balloon device in XML and handle PCI address · b2f18635
      Daniel P. Berrange 提交于
      To allow compatibility with older QEMU PCI device slot assignment
      it is necessary to explicitly track the balloon device in the
      XML. This introduces a new device
      
         <memballoon model='virtio|xen'/>
      
      It can also have a PCI address, auto-assigned if necessary.
      
      The memballoon will be automatically added to all Xen and QEMU
      guests by default.
      
      * docs/schemas/domain.rng: Add <memballoon> element
      * src/conf/domain_conf.c, src/conf/domain_conf.h: parsing
        and formatting for memballoon device. Always add a memory
        balloon device to Xen/QEMU if none exists in XML
      * src/libvirt_private.syms: Export memballoon model APIs
      * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Honour the
        PCI device address in memory balloon device
      * tests/*: Update to test new functionality
      b2f18635
    • D
      Remove inappropriate use of VIR_ERR_NO_SUPPORT · 021251bd
      Daniel P. Berrange 提交于
      The VIR_ERR_NO_SUPPORT refers to an API which is not implemented.
      There is a separate VIR_ERR_CONFIG_UNSUPPORTED for XML config
      options that are not available with the current hypervisor.
      
      * src/qemu/qemu_conf.c, src/qemu/qemu_driver.c: Remove
        many VIR_ERR_NO_SUPPORT replace with VIR_ERR_CONFIG_UNSUPPORTED
      021251bd
  4. 20 7月, 2010 6 次提交
    • C
      Fix a deadlock in bi-directional p2p concurrent migration. · f0c8e1cb
      Chris Lalancette 提交于
      If you try to execute two concurrent migrations p2p
      from A->B and B->A, the two libvirtd's will deadlock
      trying to perform the migrations.  The reason for this is
      that in p2p migration, the libvirtd's are responsible for
      making the RPC Prepare, Migrate, and Finish calls.  However,
      they are currently holding the driver lock while doing so,
      which basically guarantees deadlock in this scenario.
      
      This patch fixes the situation by adding
      qemuDomainObjEnterRemoteWithDriver and
      qemuDomainObjExitRemoteWithDriver helper methods.  The Enter
      take an additional object reference, then drops both the
      domain object lock and the driver lock.  The Exit takes
      both the driver and domain object lock, then drops the
      reference.  Adding calls to these Enter and Exit helpers
      around remote calls in the various migration methods
      seems to fix the problem for me in testing.
      
      This should make the situation safe. The additional domain
      object reference ensures that the domain object won't disappear
      while this operation is happening.  The BeginJob that is called
      inside of qemudDomainMigratePerform ensures that we can't execute a
      second migrate (or shutdown, or save, etc) job while the
      migration is active.  Finally, the additional check on the state
      of the vm after we reacquire the locks ensures that we can't
      be surprised by an external event (domain crash, etc).
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      f0c8e1cb
    • D
      Add ability to set a default driver name/type when parsing disks · 03ca4204
      Daniel P. Berrange 提交于
      Record a default driver name/type in capabilities struct. Use this
      when parsing disks if value is not set in XML config.
      
      * src/conf/capabilities.h: Record default driver name/type for disks
      * src/conf/domain_conf.c: Fallback to default driver name/type
        when parsing disks
      * src/qemu/qemu_driver.c: Set default driver name/type to raw
      03ca4204
    • D
      Disable all disk probing in QEMU driver & add config option to re-enable · 68719c4b
      Daniel P. Berrange 提交于
      Disk format probing is now disabled by default. A new config
      option in /etc/qemu/qemu.conf will re-enable it for existing
      deployments where this causes trouble
      68719c4b
    • D
      Pass security driver object into all security driver callbacks · f70e0809
      Daniel P. Berrange 提交于
      The implementation of security driver callbacks often needs
      to access the security driver object. Currently only a handful
      of callbacks include the driver object as a parameter. Later
      patches require this is many more places.
      
      * src/qemu/qemu_driver.c: Pass in the security driver object
        to all callbacks
      * src/qemu/qemu_security_dac.c, src/qemu/qemu_security_stacked.c,
        src/security/security_apparmor.c, src/security/security_driver.h,
        src/security/security_selinux.c: Add a virSecurityDriverPtr
        param to all security callbacks
      f70e0809
    • D
      Convert all disk backing store loops to shared helper API · a8853344
      Daniel P. Berrange 提交于
      Update the QEMU cgroups code, QEMU DAC security driver, SELinux
      and AppArmour security drivers over to use the shared helper API
      virDomainDiskDefForeachPath().
      
      * src/qemu/qemu_driver.c, src/qemu/qemu_security_dac.c,
        src/security/security_selinux.c, src/security/virt-aa-helper.c:
        Convert over to use virDomainDiskDefForeachPath()
      a8853344
    • D
      Require format to be passed into virStorageFileGetMetadata · bf80fc68
      Daniel P. Berrange 提交于
      Require the disk image to be passed into virStorageFileGetMetadata.
      If this is set to VIR_STORAGE_FILE_AUTO, then the format will be
      resolved using probing. This makes it easier to control when
      probing will be used
      
      * src/qemu/qemu_driver.c, src/qemu/qemu_security_dac.c,
        src/security/security_selinux.c, src/security/virt-aa-helper.c:
        Set VIR_STORAGE_FILE_AUTO when calling virStorageFileGetMetadata.
      * src/storage/storage_backend_fs.c: Probe for disk format before
        calling virStorageFileGetMetadata.
      * src/util/storage_file.h, src/util/storage_file.c: Remove format
        from virStorageFileMeta struct & require it to be passed into
        method.
      bf80fc68
  5. 15 7月, 2010 1 次提交
  6. 29 6月, 2010 3 次提交
  7. 28 6月, 2010 3 次提交
  8. 25 6月, 2010 4 次提交
    • D
      Don't squash file permissions when migration fails · 6d974315
      Daniel P. Berrange 提交于
      If an active migration operation fails, or is cancelled by the
      admin, the QEMU on the destination is shutdown and the one on
      the source continues running. It is important in shutting down
      the QEMU on the destination, the security drivers don't reset
      the file labelling/permissions.
      
      * src/qemu/qemu_driver.c: Don't reset labelling/permissions
        on migration abort
      6d974315
    • D
      Fix migration in text mode and shared storage migration in json mode · 28e96d72
      Daniel P. Berrange 提交于
      The patches for shared storage migration were not correctly written
      for json mode. Thus the 'blk' and 'inc' parameters were never being
      set. In addition they didn't set the QEMU_MONITOR_MIGRATE_BACKGROUND
      so migration was synchronous. Due to multiple bugs in QEMU's JSON
      impl this wasn't noticed because it treated the sync migration requst
      as asynchronous anyway. Finally 'background' parameter was converted
      to take arbitrary flags but not renamed, and not all uses were changed
      to unsigned int.
      
      * src/qemu/qemu_driver.c: Set QEMU_MONITOR_MIGRATE_BACKGROUND in
        doNativeMigrate
      * src/qemu/qemu_monitor_json.c: Process QEMU_MONITOR_MIGRATE_NON_SHARED_DISK
        and QEMU_MONITOR_MIGRATE_NON_SHARED_INC flags
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.h, src/qemu/qemu_monitor_text.c,
        src/qemu/qemu_monitor_text.h: change 'int background' to
        'unsigned int flags' in migration APIs. Add logging of flags
        parameter
      28e96d72
    • D
      Avoid blocking all APIs during incoming migration · 755b53f9
      Daniel P. Berrange 提交于
      During incoming migration the QEMU monitor is not able to be
      used. The incoming migration code did not keep hold of the
      job lock because migration is split across multiple API calls.
      This meant that further monitor commands on the guest would
      hang until migration finished with no timeout.
      
      In this change the qemuDomainMigratePrepare method sets the
      job flag just before it returns. The qemuDomainMigrateFinish
      method checks for this job flag & clears it once done. This
      prevents any use of the monitor between prepare+finish steps.
      
      The qemuDomainGetJobInfo method is also updated to refresh
      the job elapsed time. This means that virsh domjobinfo can
      return time data during incoming migration
      
      * src/qemu/qemu_driver.c: Keep a job active during incoming
        migration. Refresh job elapsed time when returning job info
      755b53f9
    • D
      Set labelling for character devices in security drivers · 2bad82f7
      Daniel P. Berrange 提交于
      When configuring serial, parallel, console or channel devices
      with a file, dev or pipe backend type, it is necessary to label
      the file path in the security drivers. For char devices of type
      file, it is neccessary to pre-create (touch) the file if it does
      not already exist since QEMU won't be allowed todo so itself.
      dev/pipe configs already require the admin to pre-create before
      starting the guest.
      
      * src/qemu/qemu_security_dac.c: set file ownership for character
        devices
      * src/security/security_selinux.c: Set file labeling for character
        devices
      * src/qemu/qemu_driver.c: Add character devices to cgroup ACL
      2bad82f7
  9. 24 6月, 2010 1 次提交
  10. 23 6月, 2010 2 次提交
    • D
      Fix reference handling leak on qemuMonitor · c2121602
      Daniel P. Berrange 提交于
      The current code pattern requires that callers of qemuMonitorClose
      check for the return value == 0, and if so, set priv->mon = NULL
      and release the reference held on the associated virDomainObjPtr
      
      The change d84bb6d6 violated that
      requirement, meaning that priv->mon never gets set to NULL, and
      a reference count is leaked on virDomainObjPtr.
      
      This design was a bad one, so remove the need to check the return
      valueof qemuMonitorClose(). Instead allow registration of a
      callback that's invoked just when the last reference on qemuMonitorPtr
      is released.
      
      Finally there was a potential reference leak in qemuConnectMonitor
      in the failure path.
      
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add a destroy
        callback invoked from qemuMonitorFree
      * src/qemu/qemu_driver.c: Use the destroy callback to release the
        reference on virDomainObjPtr when the monitor is freed. Fix other
        potential reference count leak in connecting to monitor
      c2121602
    • D
      Make checks for inactive QEMU guest more robust · 8d616dec
      Daniel P. Berrange 提交于
      Before issuing monitor commands it is neccessary to check whether
      the guest is still running. Most places use virDomainIsActive()
      correctly, but a few relied on 'priv->mon != NULL'. In theory
      these should be equivalent, but the release of the last reference
      count on priv->mon can be delayed a small amount of time until
      the event handler is finally deregistered. A further ref counting
      bug also means that priv->mon might be never released. In such a
      case, code could mistakenly issue a monitor command and wait for
      a response that will never arrive, effectively leaving the QEMU
      driver waiting on virCondWait() forever..
      
      To protect against these possibilities, make sure all code uses
      virDomainIsActive(), not 'priv->mon != NULL'
      
      * src/qemu/qemu_driver.c: Replace 'priv->mon != NULL' with
        calls to 'priv->mon != NULL'()
      8d616dec
  11. 22 6月, 2010 1 次提交
    • S
      nwfilter: fix loadable module support · cab5a52a
      Stefan Berger 提交于
      Following Daniel Berrange's multiple helpful suggestions for improving
      this patch and introducing another driver interface, I now wrote the
      below patch where the nwfilter driver registers the functions to
      instantiate and teardown the nwfilters with a function in
      conf/domain_nwfilter.c called virDomainConfNWFilterRegister. Previous
      helper functions that were called from qemu_driver.c and qemu_conf.c
      were move into conf/domain_nwfilter.h with slight renaming done for
      consistency. Those functions now call the function expored by
      domain_nwfilter.c, which in turn call the functions of the new driver
      interface, if available.
      cab5a52a
  12. 18 6月, 2010 2 次提交
    • C
      qemu: Fix crash on failed VM startup · 58406dd5
      Cole Robinson 提交于
      If VM startup fails early enough (can't find a referenced USB device),
      libvirtd will crash trying to clear the VNC port bit, since port = 0,
      which overflows us out of the bitmap bounds.
      
      Fix this by being more defensive in the bitmap operations, and only
      clearing a previously set VNC port.
      Signed-off-by: NCole Robinson <crobinso@redhat.com>
      58406dd5
    • E
      qemu: reduce file padding requirements · 322b1fd4
      Eric Blake 提交于
      Followup to https://bugzilla.redhat.com/show_bug.cgi?id=599091,
      commit 20206a4b, to reduce disk waste in padding.
      
      * src/qemu/qemu_monitor.h (QEMU_MONITOR_MIGRATE_TO_FILE_BS): Drop
      back to 4k.
      (QEMU_MONITOR_MIGRATE_TO_FILE_TRANSFER_SIZE): New macro.
      * src/qemu/qemu_driver.c (qemudDomainSaveFlag): Update comment.
      * src/qemu/qemu_monitor_text.c (qemuMonitorTextMigrateToFile): Use
      two invocations of dd to output non-aligned large blocks.
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONMigrateToFile):
      Likewise.
      322b1fd4
  13. 15 6月, 2010 3 次提交
    • E
      qemu: support starting persistent domain paused · d024d2ba
      Eric Blake 提交于
      Match earlier change for qemu pause support with virDomainCreateXML.
      
      * src/qemu/qemu_driver.c (qemudDomainObjStart): Add parameter; all
      callers changed.
      (qemudDomainStartWithFlags): Implement flag support.
      d024d2ba
    • E
      drivers: add virDomainCreateWithFlags if virDomainCreate exists · de3aadaa
      Eric Blake 提交于
      * src/esx/esx_driver.c (esxDomainCreate): Move guts...
      (esxDomainCreateWithFlags): ...to new function.
      (esxDriver): Trivially support the new API.
      * src/lxc/lxc_driver.c (lxcDomainStart, lxcDomainStartWithFlags)
      (lxcDriver): Likewise.
      * src/opennebula/one_driver.c (oneDomainStart)
      (oneDomainStartWithFlags, oneDriver): Likewise.
      * src/openvz/openvz_driver.c (openvzDomainCreate)
      (openvzDomainCreateWithFlags, openvzDriver): Likewise.
      * src/qemu/qemu_driver.c (qemudDomainStart)
      (qemudDomainStartWithFlags, qemuDriver): Likewise.
      * src/test/test_driver.c (testDomainCreate)
      (testDomainCreateWithFlags, testDriver): Likewise.
      * src/uml/uml_driver.c (umlDomainStart, umlDomainStartWithFlags)
      (umlDriver): Likewise.
      * src/vbox/vbox_tmpl.c (vboxDomainCreate)
      (vboxDomainCreateWithFlags, Driver): Likewise.
      * src/xen/xen_driver.c (xenUnifiedDomainCreate)
      (xenUnifiedDomainCreateWithFlags, xenUnifiedDriver): Likewise.
      * src/xenapi/xenapi_driver.c (xenapiDomainCreate)
      (xenapiDomainCreateWithFlags, xenapiDriver): Likewise.
      de3aadaa
    • E
      libvirt: introduce domainCreateWithFlags API · 460ca88b
      Eric Blake 提交于
      Persistent domain creation needs the same features as transient
      domains, but virDomainCreate lacks the flags argument present in
      virDomainCreateXML.  virDomainCreateFlags is already claimed as
      a public enum, so we have to break convention and expose
      virDomainCreateWithFlags.
      
      * include/libvirt/libvirt.h.in (virDomainCreateWithFlags): Add.
      * src/driver.h (virDrvDomainCreateWithFlags): Internal API.
      * src/libvirt.c (virDomainCreateWithFlags): Glue public API to
      driver API.
      * src/libvirt_public.syms (LIBVIRT_0.8.2): Expose public API.
      * src/esx/esx_driver.c (esxDriver): Add stub for driver.
      * src/lxc/lxc_driver.c (lxcDriver): Likewise.
      * src/opennebula/one_driver.c (oneDriver): Likewise.
      * src/openvz/openvz_driver.c (openvzDriver): Likewise.
      * src/phyp/phyp_driver.c (phypDriver): Likewise.
      * src/qemu/qemu_driver.c (qemuDriver): Likewise.
      * src/remote/remote_driver.c (remote_driver): Likewise.
      * src/test/test_driver.c (testDriver): Likewise.
      * src/uml/uml_driver.c (umlDriver): Likewise.
      * src/vbox/vbox_tmpl.c (Driver): Likewise.
      * src/xen/xen_driver.c (xenUnifiedDriver): Likewise.
      * src/xenapi/xenapi_driver.c (xenapiDriver): Likewise.
      460ca88b
  14. 09 6月, 2010 3 次提交
    • D
      Fix cgroup setup code to cope with root squashing NFS · c37c321c
      Daniel P. Berrange 提交于
      When a disk is on a root squashed NFS server, it may not be
      possible to stat() the disk file in virCgroupAllowDevice.
      The virStorageFileGetMeta method may also fail to extract
      the parent backing store. Both of these errors have to be
      ignored to avoid breaking NFS deployments
      
      * src/qemu/qemu_driver.c: Ignore errors in cgroup setup to
         keep root squash NFS happy
      c37c321c
    • E
      qemu: allow creation of a paused domain · 68e4793a
      Eric Blake 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=589465
      
      Some guests (eg with badly configured grub, or Windows' installation cd)
      require quick response from the console user. That's why we have a
      "launchPaused" option in vdsm.
      
      To implement it via libvirt, we need to ask libvirt not to call
      qemuMonitorStartCPUs() after starting qemu.  Calling virDomainStop
      immediately after the domain is up is inherently raceful.
      
      * src/qemu/qemu_driver.c (qemudStartVMDaemon): Add new parameter;
      all callers adjusted.
      (qemudDomainCreate): Implement support for new flag.
      68e4793a
    • E
      virDomainCreateXML: support new flag · 2502ebb3
      Eric Blake 提交于
      * include/libvirt/libvirt.h.in (virDomainCreateFlags): Add
      VIR_DOMAIN_START_PAUSED.
      * src/libvirt.c (virDomainCreateXML): Update documentation.
      * src/lxc/lxc_driver.c (lxcDomainCreateAndStart): Reject new flag
      as unimplemented.
      * src/opennebula/one_driver.c (oneDomainCreateAndStart):
      Likewise.
      * src/openvz/openvz_driver.c (openvzDomainCreateXML): Likewise.
      * src/phyp/phyp_driver.c (phypDomainCreateAndStart): Likewise.
      * src/qemu/qemu_driver.c (qemudDomainCreate): Likewise.
      * src/test/test_driver.c (testDomainCreateXML): Likewise.
      * src/uml/uml_driver.c (umlDomainCreate): Likewise.
      * src/vbox/vbox_tmpl.c (vboxDomainCreateXML): Likewise.
      * src/xen/xend_internal.c (xenDaemonCreateXML): Likewise.
      * src/xenapi/xenapi_driver.c (xenapiDomainCreateXML): Likewise.
      2502ebb3
  15. 08 6月, 2010 3 次提交
    • D
      Ensure that PCI device is reattached to host if hotadd fails · 1c72695c
      Daniel P. Berrange 提交于
      When an attempt to hotplug a PCI device to a guest fails,
      the device was left attached to pci-stub. It is neccessary
      to reset the device and then attach it to the host driver
      again.
      
      * src/qemu/qemu_driver.c: Reattach PCI device to host if
        hotadd fails
      1c72695c
    • D
      Add support for setting socket MLS level in SELinux driver · e72cc3c1
      Daniel J Walsh 提交于
      When SELinux is running in MLS mode, libvirtd will have a
      different security level to the VMs. For libvirtd to be
      able to connect to the monitor console, the client end of
      the UNIX domain socket needs a different label. This adds
      infrastructure to set the socket label via the security
      driver framework
      
      * src/qemu/qemu_driver.c: Call out to socket label APIs in
        security driver
      * src/qemu/qemu_security_stacked.c: Wire up socket label
        drivers
      * src/security/security_driver.h: Define security driver
        entry points for socket labelling
      * src/security/security_selinux.c: Set socket label based on
        VM label
      e72cc3c1
    • J
      Add stdin_path to qemudStartVMDaemon() args. · 2b57478e
      Jamie Strandboge 提交于
      Adjust args to qemudStartVMDaemon() to also specify path to stdin_fd,
      so this can be passed to the AppArmor driver via SetSecurityAllLabel().
      
      This updates all calls to qemudStartVMDaemon() as well as setting up
      the non-AppArmor security driver *SetSecurityAllLabel() declarations
      for the above. This is required for the following
      "apparmor-fix-save-restore" patch since AppArmor resolves the passed
      file descriptor to the pathname given to open().
      2b57478e
  16. 05 6月, 2010 2 次提交
  17. 03 6月, 2010 1 次提交
    • S
      add 802.1Qbh and 802.1Qbg handling · ca3b22bb
      Stefan Berger 提交于
      This patch that adds support for configuring 802.1Qbg and 802.1Qbh
      switches. The 802.1Qbh part has been successfully tested with real
      hardware. The 802.1Qbg part has only been tested with a (dummy)
      server that 'behaves' similarly to how we expect lldpad to 'behave'.
      
      The following changes were made during the development of this patch:
      
       - Merging Scott's v13-pre1 patch
       - Fixing endptr related bug while using virStrToLong_ui() pointed out
         by Jim Meyering
       - Addressing Jim Meyering's comments to v11
       - requiring mac address to the vpDisassociateProfileId() function to
         pass it further to the 802.1Qbg disassociate part (802.1Qbh untouched)
       - determining pid of lldpad daemon by reading it from /var/run/libvirt.pid
         (hardcode as is hardcode alson in lldpad sources)
       - merging netlink send code for kernel target and user space target
         (lldpad) using one function nlComm() to send the messages
       - adding a select() after the sending and before the reading of the
         netlink response in case lldpad doesn't respond and so we don't hang
       - when reading the port status, in case of 802.1Qbg, no status may be
         received while things are 'in progress' and only at the end a status
         will be there.
       - when reading the port status, use the given instanceId and vf to pick
         the right IFLA_VF_PORT among those nested under IFLA_VF_PORTS.
       - never sending nor parsing IFLA_PORT_SELF type of messages in the
         802.1Qbg case
       - iterating over the elements in a IFLA_VF_PORTS to pick the right
         IFLA_VF_PORT by either IFLA_PORT_PROFILE and given profileId
         (802.1Qbh) or IFLA_PORT_INSTANCE_UUID and given instanceId (802.1Qbg)
         and reading the current status in IFLA_PORT_RESPONSE.
       - recycling a previous patch that adds functionality to interface.c to
         - get the vlan identifier on an interface
         - get the flags of an interface and some convenience function to
           check whether an interface is 'up' or not (not currently used here)
       - adding function to determine the root physical interface of an
         interface. For example if a macvtap is linked to eth0.100, it will
         find eth0. Also adding a function that finds the vlan on the 'way to
         the root physical interface'
       - conveying the root physical interface name and index in case of 802.1Qbg
       - conveying mac address of macvlan device and vlan identifier in
         IFLA_VFINFO_LIST[ IFLA_VF_INFO[ IFLA_VF_MAC(mac), IFLA_VF_VLAN(vlan) ] ]
         to (future) lldpad via netlink
        - To enable build with --without-macvtap rename the
          [dis|]associatePortProfileId functions, prepend 'vp' before their
          name and make them non-static functions.
        - Renaming variable multicast to nltarget_kernel and inverting
          the logic
        - Addressing Jim Meyering's comments; this also touches existing
          code for example for correcting indentation of break statements or
          simplification of switch statements.
        - Renamed occurrencvirVirtualPortProfileDef to virVirtualPortProfileParamses
        - 802.1Qbg part prepared for sending a RTM_SETLINK and getting
          processing status back plus a subsequent RTM_GETLINK to
          get IFLA_PORT_RESPONSE.
          Note: This interface for 802.1Qbg may still change
        - [David Allan] move getPhysfn inside IFLA_VF_PORT_MAX to avoid
      compiler
          warning when latest if_link.h isn't available
        - move from Stefan's 802.1Qb{g|h} XML v8 to v9
        - move hostuuid and vf index calcs to inside doPortProfileOp8021Qbh
        - remove debug fprintfs
        - use virGetHostUUID (thanks Stefan!)
        - fix compile issue when latest if_link.h isn't available
        - change poll timeout to 10s, at 1/8 intervals
           - if polling times out, log msg and return -ETIMEDOUT
        - Add Stefan's code for getPortProfileStatus
        - Poll for up to 2 secs for port-profile status, at 1/8 sec intervals:
           - if status indicates error, abort openMacvtapTap
           - if status indicates success, exit polling
           - if status is "in-progress" after 2 secs of polling, exit
             polling loop silently, without error
      
      My patch finishes out the 802.1Qbh parts, which Stefan had mostly complete.
      I've tested using the recent kernel updates for VF_PORT netlink msgs and
      enic for Cisco's 10G Ethernet NIC.  I tested many VMs, each with several
      direct interfaces, each configured with a port-profile per the XML.  VM-to-VM,
      and VM-to-external work as expected.  VM-to-VM on same host (using same NIC)
      works same as VM-to-VM where VMs are on diff hosts.  I'm able to change
      settings on the port-profile while the VM is running to change the virtual
      port behaviour.  For example, adjusting a QoS setting like rate limit.  All
      VMs with interfaces using that port-profile immediatly see the effect of the
      change to the port-profile.
      
      I don't have a SR-IOV device to test so source dev is a non-SR-IOV device,
      but most of the code paths include support for specifing the source dev and
      VF index.  We'll need to complete this by discovering the PF given the VF
      linkdev.  Once we have the PF, we'll also have the VF index.  All this info-
      mation is available from sysfs.
      ca3b22bb