1. 24 4月, 2015 10 次提交
  2. 23 4月, 2015 14 次提交
  3. 22 4月, 2015 14 次提交
    • M
      parallels: don't forget to unlock domain after successful virDomainObjListFindByUUID call · 0898d818
      Maxim Nestratov 提交于
      Also a typo is fixed (s/detached/attached/)
      
      Signed-off-by: Maxim Nestratov mnestratov@parallels.com
      0898d818
    • R
      vircommand: fix polling in virCommandProcessIO · e34cccf7
      Roman Bogorodskiy 提交于
      When running on FreeBSD, there's a bug in virCommandProcessIO
      polling that is triggered by the commandtest.
      
      A test that triggers EPIPE in commandtest (named "test20") hungs
      forever on FreeBSD.
      
      Apparently, this happens because FreeBSD sets POLLHUP flag on revents
      when stdin in closed. And as the current implementation only checks for
      POLLOUT and POLLERR, it ends up looping forever inside
      virCommandProcessIO and not trying to do one more write() that would
      trigger EPIPE.
      
      To fix that check for the POLLHUP flag along with POLLOUT and POLLERR.
      e34cccf7
    • P
      util: storage: Improve error message when requesting image above 'start' · dff92b3f
      Peter Krempa 提交于
      When a user would specify a backing chain index that is above the start
      point libvirt would report a rather unhelpful error:
      
      invalid argument: could not find backing store 1 in chain for 'sub/link2'
      
      This patch adds an explicit check that the index is below start point in
      the backing store and reports the following error if not:
      
      invalid argument: requested backing store index 1 is above 'sub/../qcow2' in chain for 'sub/link2'
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1177062
      dff92b3f
    • P
    • P
      util: storage: Fix possible crash when source path is NULL · 62a61d58
      Peter Krempa 提交于
      Some storage protocols allow to have the @path field in struct
      virStorageSource set to NULL. Add NULLSTR() wrappers to handle this
      possibility until I finish the storage source error formatter.
      62a61d58
    • P
      util: command: Deduplicate code in virCommandNewArgList · 64a9d2fa
      Peter Krempa 提交于
      virCommandNewArgList can use virCommandNewVAList.
      64a9d2fa
    • P
      qemu: migration: Refactor hostdev validation in migration check · bd579773
      Peter Krempa 提交于
      The hostdev check can error out right away.
      bd579773
    • R
      util: fix build on non-Linux · 584db105
      Roman Bogorodskiy 提交于
      Build fails on non-Linux systems with this error:
      
        CC       util/libvirt_util_la-virnetdev.lo
      util/virnetdev.c:364:1: error: unused function 'virNetDevReplaceMacAddress' [-Werror,-Wunused-function]
      virNetDevReplaceMacAddress(const char *linkdev,
      ^
      util/virnetdev.c:406:1: error: unused function 'virNetDevRestoreMacAddress' [-Werror,-Wunused-function]
      virNetDevRestoreMacAddress(const char *linkdev,
      ^
      2 errors generated.
      
      The virNetDev{Restore,Replace}MacAddress() functions are only used
      by VF-related routines that are available on Linux only. So move these
      functions under the same #ifdef.
      584db105
    • M
      processNicRxFilterChangedEvent: Take appropriate actions for NET_TYPE_NETWORK too · 74acc4ca
      Michal Privoznik 提交于
      Because packets going through the egress from a bridge (where our
      bandwidth limiting takes place) have no information about which
      interface they came from, the QoS rules that we create instead
      use the source MAC address of the packets to make their decisions
      about which QDisc the packet should be in.
      
      One flaw in this is that when a guest changed the MAC address it
      used, packets from the guest would no longer be put into the
      correct QDisc, but would instead be put in an "unprivileged"
      class, resulting in the bandwidth "floor" (minimum guaranteed)
      being no longer honored.
      
      Now that libvirt has infrastructure to capture and respond to
      RX_FILTER_CHANGE events from qemu (sent whenever a guest
      interface modifies its MAC address, among other things), we can
      notice when a guest MAC address changes, and update the QoS rules
      accordingly, so that bandwidth floor is honored even after a
      guest MAC address change.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      74acc4ca
    • M
      virDomainActualNetDefContentsFormat: Format class_id only for status XML · e128b4a4
      Michal Privoznik 提交于
      In one of my previous patches (b68a56bc) I made class_id to
      format more frequently. Well, now it's formatting way too
      frequent - even for regular active XML. Users don't need to see
      it, so lets format it only for the status XML where it's really
      needed.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      e128b4a4
    • L
      qemu: Fix issues with maxMemory in qemuDomainSetMemoryFlags() · d1743941
      Luyao Huang 提交于
      qemuDomainSetMemoryFlags() would allow to set the initial memory greater
      than the <maxMemory> field. While the configuration would not work as
      memory hotplug requires NUMA to be enabled and the
      qemuDomainSetMemoryFlags() API does not work on NUMA guests this just
      fixes a corner case.
      
      The fix is still worth though as it allows to induce an invalid
      configuration and make the VM vanish on libvirt restart.
      
      Additionally this tweaks error message to be more accurate.
      Signed-off-by: NLuyao Huang <lhuang@redhat.com>
      Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
      d1743941
    • J
      libxl: Introduce configuration file for libxl driver · d0baac09
      Jim Fehlig 提交于
      Introduce libxl.conf configuration file, adding the 'autoballoon'
      setting as the first knob for controlling the libxl driver.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      d0baac09
    • L
      qemu: set macvtap physdevs online when macvtap is set online · 38172ed8
      Laine Stump 提交于
      A further fix for:
      
        https://bugzilla.redhat.com/show_bug.cgi?id=1113474
      
      Since there is no possibility that any type of macvtap will work if
      the parent physdev it's attached to is offline, we should bring the
      physdev online at the same time as the macvtap. When taking the
      macvtap offline, it's also necessary to take the physdev offline for
      macvtap passthrough mode (because the physdev has the same MAC address
      as the macvtap device, so could potentially cause problems with
      misdirected packets during migration, as outlined in commits 829770
      and 879c13). We can't set the physdev offline for other macvtap modes
      1) because there may be other macvtap devices attached to the same
      physdev (and/or the host itself may be using the device) in the other
      modes whereas passthrough mode is exclusive to one macvtap at a time,
      and 2) there's no practical reason to do so anyway.
      38172ed8
    • L
      util: set MAC address for VF via netlink message to PF+VF# when possible · cb3fe38c
      Laine Stump 提交于
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1113474
      
      When we set the MAC address of a network device as a part of setting
      up macvtap "passthrough" mode (where the domain has an emulated netdev
      connected to a host macvtap device that has exclusive use of the
      physical device, and sets the device MAC address to match its own,
      i.e. "<interface type='direct'> <source mode='passthrough' .../>"), we
      use ioctl(SIOCSIFHWADDR) giving it the name of that device. This is
      true even if it is an SRIOV Virtual Function (VF).
      
      But, when we are setting the MAC address / vlan ID of a VF in
      preparation for "hostdev network" passthrough (this is where we set
      the MAC address and vlan id of the VF after detaching the host net
      driver and before assigning the device to the domain with PCI
      passthrough, i.e. "<interface type='hostdev'>", we do the setting via
      a netlink RTM_SETLINK message for that VF's Physical Function (PF),
      telling it the VF# we want to change. This sets an "administratively
      changed MAC" flag for that VF in the PF's driver, and from that point
      on (until the PF driver is reloaded, *not* merely the VF driver) that
      VF's MAC address can't be changed using ioctl(SIOCSIFHWADDR) - the
      only way to change it is via the PF with RTM_SETLINK.
      
      This means that if a VF is used for hostdev passthrough, it will have
      the admin flag set, and future attempts to use that VF for macvtap
      passthrough will fail.
      
      The solution to this problem is to check if the device being used for
      macvtap passthrough is actually a VF; if so, we use the netlink
      RTM_SETLINK message to the PF to set the VF's mac address instead of
      ioctl(SIOCSIFHWADDR) directly to the VF; if not, behavior does not
      change from previously.
      
      There are three pieces to making this work:
      
      1) virNetDevMacVLan(Create|Delete)WithVPortProfile() now call
         virNetDev(Replace|Restore)NetConfig() rather than
         virNetDev(Replace|Restore)MacAddress() (simply passing -1 for VF#
         and vlanid).
      
      2) virNetDev(Replace|Restore)NetConfig() check to see if the device is
         a VF. If so, they find the PF's name and VF#, allowing them to call
         virNetDev(Replace|Restore)VfConfig().
      
      3) To prevent mixups when detaching a macvtap passthrough device that
         had been attached while running an older version of libvirt,
         virNetDevRestoreVfConfig() is potentially given the preserved name
         of the VF, and if the proper statefile for a VF can't be found in
         the stateDir (${stateDir}/${pfname}_vf${vfid}),
         virNetDevRestoreMacAddress() is called instead (which will look in
         the file named ${stateDir}/${vfname}).
      
      This problem has existed in every version of libvirt that has both
      macvtap passthrough and interface type='hostdev'. Fortunately people
      seem to use one or the other though, so it hasn't caused any real
      world problem reports.
      cb3fe38c
  4. 21 4月, 2015 2 次提交
    • C
      qemu: Always refresh capabilities if no <guests> found · 95546c43
      Cole Robinson 提交于
      - Remove all qemu emulators
      - Restart libvirtd
      - Install qemu emulators
      - Call 'virsh version' -> errors
      
      The only thing that will force the qemu driver to refresh it's cached
      capablities info is an explict API call to GetCapabilities.
      
      However in the case when the initial caps lookup at driver connect didn't
      find a single qemu emulator to poll, the driver is effectively useless
      and really can't do anything until it's populated some qemu capabilities
      info.
      
      With the above steps, the user would have to either know about the
      magic refresh capabilities call, or restart libvirtd to pick up the
      changes.
      
      Instead, this patch changes things so that every time a part of th
      driver requests access to capabilities info, check to see if
      we've previously seen any emulators. If not, force a refresh.
      
      In the case of 'still no emulators found', this is still very quick, so
      I can't think of a downside.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1000116
      95546c43
    • R
      vircapstest: fix build without LXC, QEMU or XEN · a7c1eb14
      Roman Bogorodskiy 提交于
      When building without lxc support enabled, build fails with:
      
      CLD     vircapstest
      vircapstest.o: In function `test_virCapsDomainDataLookupLXC':
      vircapstest.c:(.text+0x9ef): undefined reference to `testLXCCapsInit'
      
      Fix that by hiding LXC tests under appropriate #ifdef. Same applies
      for QEMU and XEN.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      a7c1eb14