1. 25 11月, 2016 9 次提交
    • M
      virstring: Unify string list function names · c2a5a4e7
      Michal Privoznik 提交于
      We have couple of functions that operate over NULL terminated
      lits of strings. However, our naming sucks:
      
      virStringJoin
      virStringFreeList
      virStringFreeListCount
      virStringArrayHasString
      virStringGetFirstWithPrefix
      
      We can do better:
      
      virStringListJoin
      virStringListFree
      virStringListFreeCount
      virStringListHasString
      virStringListGetFirstWithPrefix
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      c2a5a4e7
    • B
      qemu: fix internal error: NUMA isn't available on this host · b178fa8e
      Boris Fiuczynski 提交于
      If libvirt is compiled without NUMACTL support starting libvirtd
      reports a libvirt internal error "NUMA isn't available on this host"
      without checking if NUMA support is compiled into the libvirt binaries.
      This patch adds the missing NUMA support check to prevent the internal error.
      It also includes a check if the cgroup controller cpuset is available before
      using it.
      
      The error was noticed when libvirtd was restarted with running domains and
      on libvirtd start the qemuConnectCgroup gets called during qemuProcessReconnect.
      Signed-off-by: NBoris Fiuczynski <fiuczy@linux.vnet.ibm.com>
      Reviewed-by: NBjoern Walk <bwalk@linux.vnet.ibm.com>
      b178fa8e
    • E
      conf: Wire up the vhost-scsi connection from/to XML · ae5d30a0
      Eric Farman 提交于
      With the QEMU components in place, provide the XML parsing to
      invoke that code when given the following XML snippet:
      
          <hostdev mode='subsystem' type='scsi_host'>
            <source protocol='vhost' wwpn='naa.501234567890abcd'/>
          </hostdev>
      
      An optional address element can be specified within the hostdev
      (pick CCW or PCI as necessary):
      
          <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0625'/>
          <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
      
      Add basic vhost-scsi tests which were cloned from hostdev-scsi-virtio-scsi
      in both xml2argv and xml2xml. Added ones for both vhost-scsi-ccw and
      vhost-scsi-pci since the syntaxes are slightly different between them.
      
      Also adjusted the docs to describe the changes.
      Signed-off-by: NEric Farman <farman@linux.vnet.ibm.com>
      Reviewed-by: NBoris Fiuczynski <fiuczy@linux.vnet.ibm.com>
      ae5d30a0
    • E
      security: Include vhost-scsi in security labels · 81a206f5
      Eric Farman 提交于
      Ensure that the vhost-scsi wwpn information is passed to the
      different security policies.
      Signed-off-by: NEric Farman <farman@linux.vnet.ibm.com>
      81a206f5
    • E
      qemu: Allow hotplug of vhost-scsi device · 8c6d3653
      Eric Farman 提交于
      Adjust the device string that is built for vhost-scsi devices so that it
      can be invoked from hotplug.
      
      From the QEMU command line, the file descriptors are expect to be numeric only.
      However, for hotplug, the file descriptors are expected to begin with at least
      one alphabetic character else this error occurs:
      
        # virsh attach-device guest_0001 ~/vhost.xml
        error: Failed to attach device from /root/vhost.xml
        error: internal error: unable to execute QEMU command 'getfd':
        Parameter 'fdname' expects a name not starting with a digit
      
      We also close the file descriptor in this case, so that shutting down the
      guest cleans up the host cgroup entries and allows future guests to use
      vhost-scsi devices.  (Otherwise the guest will silently end.)
      Signed-off-by: NEric Farman <farman@linux.vnet.ibm.com>
      8c6d3653
    • E
      qemu: Add vhost-scsi string for -device parameter · 9cc26dc6
      Eric Farman 提交于
      Open /dev/vhost-scsi, and record the resulting file descriptor, so that
      the guest has access to the host device outside of the libvirt daemon.
      Pass this information, along with data parsed from the XML file, to build
      a device string for the qemu command line.  That device string will be
      for either a vhost-scsi-ccw device in the case of an s390 machine, or
      vhost-scsi-pci for any others.
      Signed-off-by: NEric Farman <farman@linux.vnet.ibm.com>
      9cc26dc6
    • E
      util: Management routines for scsi_host devices · 629544be
      Eric Farman 提交于
      For a new hostdev type='scsi_host' we have a number of
      required functions for managing, adding, and removing the
      host device to/from guests.  Provide the basic infrastructure
      for these tasks.
      
      The name "SCSIVHost" (and its variants) is chosen to avoid
      conflicts with existing code named "SCSIHost" to refer to
      a hostdev type='scsi' protcol='none'.
      Signed-off-by: NEric Farman <farman@linux.vnet.ibm.com>
      629544be
    • E
      Introduce framework for a hostdev SCSI_host subsystem type · fc0e627b
      Eric Farman 提交于
      We already have a "scsi" hostdev subsys type, which refers to a single
      LUN that is passed through to a guest.  But what of things where
      multiple LUNs are passed through via a single SCSI HBA, such as with
      the vhost-scsi target?  Create a new hostdev subsys type that will
      carry this.
      Signed-off-by: NEric Farman <farman@linux.vnet.ibm.com>
      fc0e627b
    • E
      qemu: Introduce vhost-scsi capability · c271fc1f
      Eric Farman 提交于
      Do all the stuff for the vhost-scsi capability in QEMU,
      so it's in place for our checks later.
      Signed-off-by: NEric Farman <farman@linux.vnet.ibm.com>
      Reviewed-by: NBoris Fiuczynski <fiuczy@linux.vnet.ibm.com>
      c271fc1f
  2. 24 11月, 2016 7 次提交
  3. 23 11月, 2016 8 次提交
    • M
      qemu: Update cgroup on chardev hotplug · 5d9c2c70
      Michal Privoznik 提交于
      Just like in the previous commit, we are not updating CGroups on
      chardev hot(un-)plug and thus leaving qemu unable to access any
      non-default device users are trying to hotplug.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      5d9c2c70
    • M
      qemu: Update cgroup on RNG hotplug · 085692c8
      Michal Privoznik 提交于
      If users try to hotplug RNG device with a backend different to
      /dev/random or /dev/urandom the whole operation fails as qemu is
      unable to access the device. The problem is we don't update
      device CGroups during the operation.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      085692c8
    • N
      qemu: agent: fix unsafe agent access · aaf2992d
      Nikolay Shirokovskiy 提交于
      qemuDomainObjExitAgent is unsafe.
      
      First it accesses domain object without domain lock.
      Second it uses outdated logic that goes back to commit 79533da1 of
      year 2009 when code was quite different. (unref function
      instead of unreferencing only unlocked and disposed object
      in case of last reference and leaved unlocking to the caller otherwise).
      Nowadays this logic may lead to disposing locked object
      i guess.
      
      Another problem is that the callers of qemuDomainObjEnterAgent
      use domain object again (namely priv->agent) without domain lock.
      
      This patch address these two problems.
      
      qemuDomainGetAgent is dropped as unused.
      aaf2992d
    • N
      qemu: drop write-only agentStart · 3c1c5678
      Nikolay Shirokovskiy 提交于
      3c1c5678
    • N
      qemu: agent: cleanup agent error flag correctly · 6ba861ae
      Nikolay Shirokovskiy 提交于
      Sometimes after domain restart agent is unavailabe even
      if it is up and running in guest. Diagnostic message is
      "QEMU guest agent is not available due to an error"
      that is 'priv->agentError' is set. Investiagion shows that
      'priv->agent' is not NULL, so error flag is set probably
      during domain shutdown process and not cleaned up eventually.
      
      The patch is quite simple - just clean up error flag unconditionally
      upon domain stop.
      
      Other hunks address other cases when error flag is not cleaned up.
      
      1. processSerialChangedEvent. We need to clean error flag
      unconditionally here too. For example if upon first 'connected' event we
      fail to connect and set error flag and then connect on second
      'connected' event then error flag will remain set erroneously
      and make agent unavailable.
      
      2. qemuProcessHandleAgentEOF. If error flag is set and we get
      EOF we need to change state (and diagnostic) from 'error' to
      'not connected'.
      6ba861ae
    • N
      qemu: agent: remove redundant check · f5109f20
      Nikolay Shirokovskiy 提交于
      f5109f20
    • N
      qemu: agent: handle agent connection errors in one place · 851ae08e
      Nikolay Shirokovskiy 提交于
      qemuConnectAgent return -1 or -2 in case of different errors.
      A. -1 is a case of unsuccessuful connection to guest agent.
      B. -2 is a case of destoyed domain during connection attempt.
      
      All qemuConnectAgent callers handle the first error the same way
      so let's move this logic into qemuConnectAgent itself. Patched
      function returns 0 in case A and -1 in case B.
      851ae08e
    • N
      libvirtd: systemd: add special target for system shutdown · 01079727
      Nikolay Shirokovskiy 提交于
      It is already discussed in "[RFC] daemon: remove hardcode dep on libvirt-guests" [1].
      
      Mgmt can use means to save/restore domains on system shutdown/boot other than
      libvirt-guests.service. Thus we need to specify appropriate ordering dependency between
      libvirtd, domains and save/restore service. This patch takes approach suggested
      in RFC and introduces a systemd target, so that ordering can be built next way:
      
      libvirtd -> domain -> virt-guest-shutdown.target -> save-restore.service.
      
      This way domains are decoupled from specific shutdown service via intermediate
      target.
      
      [1] https://www.redhat.com/archives/libvir-list/2016-September/msg01353.html
      01079727
  4. 22 11月, 2016 10 次提交
  5. 21 11月, 2016 6 次提交