1. 01 8月, 2013 4 次提交
  2. 31 7月, 2013 3 次提交
  3. 30 7月, 2013 1 次提交
  4. 29 7月, 2013 1 次提交
  5. 26 7月, 2013 3 次提交
  6. 25 7月, 2013 2 次提交
  7. 24 7月, 2013 8 次提交
    • M
      Use qemuOpenFile in qemu_driver.c · b4a40dd9
      Martin Kletzander 提交于
      On two places, the usage of open() is replaced with qemuOpenFile as
      that is the preferred method in those cases.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=963881
      b4a40dd9
    • M
      Make qemuOpenFile aware of per-VM DAC seclabel. · 849df287
      Martin Kletzander 提交于
      Function qemuOpenFile() haven't had any idea about seclabels applied
      to VMs only, so in case the seclabel differed from the "user:group"
      from configuration, there might have been issues with opening files.
      
      Make qemuOpenFile() VM-aware, but only optionally, passing NULL
      argument means skipping VM seclabel info completely.
      
      However, all current qemuOpenFile() calls look like they should use VM
      seclabel info in case there is any, so convert these calls as well.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=869053
      849df287
    • L
      qemu: set/validate slot/connection type when assigning slots for PCI devices · 3ceb4c7d
      Laine Stump 提交于
      Since PCI bridges, PCIe bridges, PCIe switches, and PCIe root ports
      all share the same namespace, they are all defined as controllers of
      type='pci' in libvirt (but with a differing model attribute). Each of
      these controllers has a certain connection type upstream, allows
      certain connection types downstream, and each can either allow a
      single downstream connection at slot 0, or connections from slot 1 -
      31.
      
      Right now, we only support the pci-root and pci-bridge devices, both
      of which only allow PCI devices to connect, and both which have usable
      slots 1 - 31. In preparation for adding other types of controllers
      that have different capabilities, this patch 1) adds info to the
      qemuDomainPCIAddressBus object to indicate the capabilities, 2) sets
      those capabilities appropriately for pci-root and pci-bridge devices,
      and 3) validates that the controller being connected to is the proper
      type when allocating slots or validating that a user-selected slot is
      appropriate for a device..
      
      Having this infrastructure in place will make it much easier to add
      support for the other PCI controller types.
      
      While it would be possible to do all the necessary checking by just
      storing the controller model in the qemyuDomainPCIAddressBus, it
      greatly simplifies all the validation code to also keep a "flags",
      "minSlot" and "maxSlot" for each - that way we can just check those
      attributes rather than requiring a nearly identical switch statement
      everywhere we need to validate compatibility.
      
      You may notice many places where the flags are seemingly hard-coded to
      
        QEMU_PCI_CONNECT_HOTPLUGGABLE | QEMU_PCI_CONNECT_TYPE_PCI
      
      This is currently the correct value for all PCI devices, and in the
      future will be the default, with small bits of code added to change to
      the flags for the few devices which are the exceptions to this rule.
      
      Finally, there are a few places with "FIXME" comments. Note that these
      aren't indicating places that are broken according to the currently
      supported devices, they are places that will need fixing when support
      for new PCI controller models is added.
      
      To assure that there was no regression in the auto-allocation of PCI
      addresses or auto-creation of integrated pci-root, ide, and usb
      controllers, a new test case (pci-bridge-many-disks) has been added to
      both the qemuxml2argv and qemuxml2xml tests. This new test defines a
      domain with several dozen virtio disks but no pci-root or
      pci-bridges. The .args file of the new test case was created using
      libvirt sources from before this patch, and the test still passes
      after this patch has been applied.
      3ceb4c7d
    • L
      qemu: make QEMU_PCI_ADDRESS_(SLOT|FUNCTION)_LAST less misleading · 9adafa08
      Laine Stump 提交于
      Although these two enums are named ..._LAST, they really had the value
      of ..._SIZE. This patch changes their values so that, e.g.,
      QEMU_PCI_ADDRESS_SLOT_LAST really is the slot number of the last slot
      on a PCI bus.
      9adafa08
    • L
      qemu: only check for PIIX3-specific device addrs on pc-* machinetypes · fcbfd584
      Laine Stump 提交于
      The implicit IDE, USB, and video controllers provided by the PIIX3
      chipset in the pc-* machinetypes are not present on other
      machinetypes, so we shouldn't be doing the special checking for
      them. This patch places those validation checks into a separate
      function that is only called for machine types that have a PIIX3 chip
      (which happens to be the i440fx-based pc-* machine types).
      
      One qemuxml2argv test data file had to be changed - the
      pseries-usb-multi test had included a piix3-usb-uhci device, which was
      being placed at a specific address, and also had slot 2 auto reserved
      for a video device, but the pseries virtual machine doesn't actually
      have a PIIX3 chip, so even if there was a piix3-usb-uhci driver for
      it, the device wouldn't need to reside at slot 1 function 2. I just
      changed the .argv file to have the generic slot info for the two
      devices that results when the special PIIX3 code isn't executed.
      fcbfd584
    • L
      qemu: turn qemuDomainPCIAddressBus into a struct · 23cc5352
      Laine Stump 提交于
      qemuDomainPCIAddressBus was an array of QEMU_PCI_ADDRESS_SLOT_LAST
      uint8_t's, which worked fine as long as every PCI bus was
      identical. In the future, some PCI busses will allow connecting PCI
      devices, and some will allow PCIe devices; also some will only allow
      connection of a single device, while others will allow connecting 31
      devices.
      
      In order to keep track of that information for each bus, we need to
      turn qemuDomainPCIAddressBus into a struct, for now with just one
      member:
      
         uint8_t slots[QEMU_PCI_ADDRESS_SLOT_LAST];
      
      Additional members will come in later patches.
      
      The item in qemuDomainPCIAddresSet that contains the array of
      qemuDomainPCIAddressBus is now called "buses" to be more consistent
      with the already existing "nbuses" (and with the new "slots" array).
      23cc5352
    • D
      Create + setup cgroups atomically for QEMU process · 2049ef99
      Daniel P. Berrange 提交于
      Currently the QEMU driver creates the VM's cgroup prior to
      forking, and then uses a virCommand hook to move the child
      into the cgroup. This won't work with systemd whose APIs
      do the creation of cgroups + attachment of processes atomically.
      
      Fortunately we have a handshake taking place between the
      QEMU driver and the child process prior to QEMU being exec()d,
      which was introduced to allow setup of disk locking. By good
      fortune this synchronization point can be used to enable the
      QEMU driver to do atomic setup of cgroups removing the use
      of the hook script.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      2049ef99
    • D
      Auto-detect existing cgroup placement · 87b2e6fa
      Daniel P. Berrange 提交于
      Use the new virCgroupNewDetect function to determine cgroup
      placement of existing running VMs. This will allow the legacy
      cgroups creation APIs to be removed entirely
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      87b2e6fa
  8. 23 7月, 2013 7 次提交
  9. 22 7月, 2013 5 次提交
  10. 20 7月, 2013 2 次提交
  11. 19 7月, 2013 2 次提交
    • J
      d327ac53
    • E
      security: framework for driver PreFork handler · fdb3bde3
      Eric Blake 提交于
      A future patch wants the DAC security manager to be able to safely
      get the supplemental group list for a given uid, but at the time
      of a fork rather than during initialization so as to pick up on
      live changes to the system's group database.  This patch adds the
      framework, including the possibility of a pre-fork callback
      failing.
      
      For now, any driver that implements a prefork callback must be
      robust against the possibility of being part of a security stack
      where a later element in the chain fails prefork.  This means
      that drivers cannot do any action that requires a call to postfork
      for proper cleanup (no grabbing a mutex, for example).  If this
      is too prohibitive in the future, we would have to switch to a
      transactioning sequence, where each driver has (up to) 3 callbacks:
      PreForkPrepare, PreForkCommit, and PreForkAbort, to either clean
      up or commit changes made during prepare.
      
      * src/security/security_driver.h (virSecurityDriverPreFork): New
      callback.
      * src/security/security_manager.h (virSecurityManagerPreFork):
      Change signature.
      * src/security/security_manager.c (virSecurityManagerPreFork):
      Optionally call into driver, and allow returning failure.
      * src/security/security_stack.c (virSecurityDriverStack):
      Wrap the handler for the stack driver.
      * src/qemu/qemu_process.c (qemuProcessStart): Adjust caller.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      fdb3bde3
  12. 18 7月, 2013 2 次提交