1. 24 7月, 2013 3 次提交
    • 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
    • J
      domain_event: Resolve memory leak found by Valgrind · 33aef5db
      John Ferlan 提交于
      Commit id '4421e257' strdup'd devAlias, but didn't free
      
      Running qemuhotplugtest under valgrind resulted in the following:
      
      ==7375== 9 bytes in 1 blocks are definitely lost in loss record 11 of 70
      ==7375==    at 0x4A0887C: malloc (vg_replace_malloc.c:270)
      ==7375==    by 0x37C1085D71: strdup (strdup.c:42)
      ==7375==    by 0x4CBBD5F: virStrdup (virstring.c:554)
      ==7375==    by 0x4CFF9CB: virDomainEventDeviceRemovedNew (domain_event.c:1174)
      ==7375==    by 0x427791: qemuDomainRemoveChrDevice (qemu_hotplug.c:2508)
      ==7375==    by 0x42C65D: qemuDomainDetachChrDevice (qemu_hotplug.c:3357)
      ==7375==    by 0x41C94F: testQemuHotplug (qemuhotplugtest.c:115)
      ==7375==    by 0x41D817: virtTestRun (testutils.c:168)
      ==7375==    by 0x41C400: mymain (qemuhotplugtest.c:322)
      ==7375==    by 0x41DF3A: virtTestMain (testutils.c:764)
      ==7375==    by 0x37C1021A04: (below main) (libc-start.c:225)
      33aef5db
    • J
      storage: Add connection for autostart storage pool · a873b496
      John Ferlan 提交于
      Add a privileged field to storageDriverState
      
      Use the privileged value in order to generate a connection which could
      be passed to the various storage backend drivers.
      
      In particular, the iSCSI driver will need a connect in order to perform
      pool authentication using the 'chap' secrets and the RBD driver utilizes
      the connection during pool refresh for pools using 'ceph' secrets.
      
      For now that connection will be to be to qemu driver until a mechanism
      is devised to get a connection to just the secret driver without qemu.
      a873b496
  2. 23 7月, 2013 4 次提交
    • O
      conf: Ignore the volume type disk if its mode is "direct" · 98584358
      Osier Yang 提交于
      virDomainDiskDefForeachPath is not only used by the security
      setting helpers, also used by cgroup setting helpers, so this
      is to ignore the volume type disk with mode="direct" for cgroup
      setting.
      98584358
    • J
      qemu: Translate the iscsi pool/volume disk source · 1b4eaa61
      John Ferlan 提交于
      The difference with already supported pool types (dir, fs, block)
      is: there are two modes for iscsi pool (or network pools in future),
      one can specify it either to use the volume target path (the path
      showed up on host) with mode='host', or to use the remote URI qemu
      supports (e.g. file=iscsi://example.org:6000/iqn.1992-01.com.example/1)
      with mode='direct'.
      
      For 'host' mode, it copies the volume target path into disk->src. For
      'direct' mode, the corresponding info in the *one* pool source host def
      is copied to disk->hosts[0].
      1b4eaa61
    • J
      conf: Introduce virDomainDiskSourceIsBlockType · 1f49b05a
      John Ferlan 提交于
      Introduce a new helper to check if the disk source is of block type
      1f49b05a
    • J
      conf: Introduce new XML tag "mode" for disk source · c00b2f0d
      John Ferlan 提交于
      There are two ways to use a iSCSI LUN as disk source for qemu.
      
       * The LUN's path as it shows up on host, e.g.
         /dev/disk/by-path/ip-$ip:3260-iscsi-$iqn-fc18:iscsi.iscsi0-lun-1
      
       * The libiscsi URI from the storage pool source element host attribute, e.g.
         iscsi://demo.org:6000/iqn.1992-01.com.example/1
      
      For a "volume" type disk, if the specified "pool" is of iscsi
      type, we should support to use the LUN in either of above 2 ways.
      That's why to introduce a new XML tag "mode" for the disk source
      (libvirt should support iscsi pool with libiscsi, but it's another
      new feature, which should be done later).
      
      The "mode" can be either of "host" or "direct". Use "host" to indicate
      use of the LUN with the path as it shows up on host. Use "direct" to
      indicate to use it with the source pool host URI (future patches may support
      to use network type libvirt storage too, e.g. Ceph)
      c00b2f0d
  3. 19 7月, 2013 1 次提交
  4. 18 7月, 2013 3 次提交
  5. 16 7月, 2013 14 次提交
  6. 12 7月, 2013 3 次提交
  7. 11 7月, 2013 3 次提交
  8. 10 7月, 2013 3 次提交
  9. 05 7月, 2013 1 次提交
  10. 04 7月, 2013 1 次提交
  11. 03 7月, 2013 4 次提交