1. 16 3月, 2015 11 次提交
  2. 14 3月, 2015 1 次提交
  3. 12 3月, 2015 1 次提交
  4. 03 3月, 2015 2 次提交
    • M
      conf: De-duplicate scheduling policy enums · 2fd5880b
      Martin Kletzander 提交于
      Since adding the support for scheduler policy settings in commit
      8680ea97, there are two enums with the same information.  That was
      caused by rewriting the patch since first draft.
      
      Find out thanks to clang, but there was no impact whatsoever.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      2fd5880b
    • J
      disk: Disallow duplicated target 'dev' values · e0e29055
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1142631
      
      This patch resolves a situation where the same "<target dev='$name'...>"
      can be used for multiple disks in the domain.
      
      While the $name is "mostly" advisory regarding the expected order that
      the disk is added to the domain and not guaranteed to map to the device
      name in the guest OS, it still should be unique enough such that other
      domblk* type operations can be performed.
      
      Without the patch, the domblklist will list the same Target twice:
      
      $ virsh domblklist $dom
      Target     Source
      ------------------------------------------------
      sda        /var/lib/libvirt/images/file.qcow2
      sda        /var/lib/libvirt/images/file.img
      
      Additionally, getting domblkstat, domblkerror, domblkinfo, and other block*
      type calls will not be able to reference the second target.
      
      Fortunately, hotplug disallows adding a "third" sda value:
      
      $ qemu-img create -f raw /var/lib/libvirt/images/file2.img 10M
      $ virsh attach-disk $dom /var/lib/libvirt/images/file2.img sda
      error: Failed to attach disk
      error: operation failed: target sda already exists
      
      $
      
      BUT, it since 'sdb' doesn't exist one would get the following on the same
      hotplug attempt, but changing to use 'sdb' instead of 'sda'
      
      $ virsh attach-disk $dom /var/lib/libvirt/images/file2.img sdb
      error: Failed to attach disk
      error: internal error: unable to execute QEMU command 'device_add': Duplicate ID 'scsi0-0-1' for device
      
      $
      
      Since we cannot fix this issue at parsing time, the best that can be done so
      as to not "lose" a domain is to make the check prior to starting the guest
      with the results as follows:
      
      $ virsh start $dom
      error: Failed to start domain $dom
      error: XML error: target 'sda' duplicated for disk sources '/var/lib/libvirt/images/file.qcow2' and '/var/lib/libvirt/images/file.img'
      
      $
      
      Running 'make check' found a few more instances in the tests where this
      duplicated target dev value was being used. These also exhibited some
      duplicated 'id=' values (negating the uniqueness argument of aliases) in
      the corresponding .args file and of course the *xmlout version of a few
      input XML files.
      e0e29055
  5. 21 2月, 2015 4 次提交
    • M
      conf: support backend domain name in disk and network devices · c374353c
      Marek Marczykowski 提交于
      At least Xen supports backend drivers in another domain (aka "driver
      domain"). This patch introduces an XML config option for specifying the
      backend domain name for <disk> and <interface> devices.  E.g.
      
        <disk>
          <backenddomain name='diskvm'/>
          ...
        </disk>
        <interface type='bridge'>
          <backenddomain name='netvm'/>
          ...
        </interface>
      
      In the future, same option will be needed for USB devices (hostdev
      objects), but for now libxl doesn't have support for PVUSB.
      Signed-off-by: NMarek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
      c374353c
    • P
      conf: Separate helper for creating domain objects · 61e43ce9
      Peter Krempa 提交于
      Move the existing virDomainDefNew to virDomainDefNewFull as it's setting
      a few things in the conf and re-introduce virDomainDefNew as a function
      without parameters for common use.
      61e43ce9
    • P
      conf: numa: Rename virDomainNumatune to virDomainNuma · 6bc80fa8
      Peter Krempa 提交于
      The structure will gradually become the only place for NUMA related
      config, thus rename it appropriately.
      6bc80fa8
    • P
      conf: Move numatune_conf to numa_conf · fcee64e7
      Peter Krempa 提交于
      For a while now there are two places that gather information about NUMA
      related guest configuration. While the XML can't be changed we can at
      least store the data in one place in the definition.
      
      Rename the numatune_conf.[ch] files to numa_conf as later patches will
      move the rest of the definitions from the cpu definition to this one.
      fcee64e7
  6. 13 2月, 2015 1 次提交
  7. 12 2月, 2015 1 次提交
  8. 10 2月, 2015 2 次提交
  9. 28 1月, 2015 1 次提交
    • J
      Split qemuDomainChrInsert into two parts · daf51be5
      Ján Tomko 提交于
      Do the allocation first, then add the actual device.
      The second part should never fail. This is good
      for live hotplug where we don't want to remove the device
      on OOM after the monitor command succeeded.
      
      The only change in behavior is that on failure, the
      vmdef->consoles array is freed, not just the first console.
      daf51be5
  10. 27 1月, 2015 1 次提交
    • D
      lxc: only write XML once for lxc controller · 0a8addc1
      Daniel P. Berrange 提交于
      Currently when launching the LXC controller we first write out
      the plain, inactive XML configuration, then launch the controller,
      then replace the file with the live status XML configuration.
      By good fortune this hasn't caused any problems other than some
      misleading error messages during failure scenarios.
      
      This simplifies the code so it only writes out the XML once and
      always writes the live status XML. To do this we need to handshake
      with the child process, to make execution pause just before exec()
      so we can write the XML status with the child PID present.
      0a8addc1
  11. 16 1月, 2015 4 次提交
  12. 14 1月, 2015 1 次提交
    • D
      Give virDomainDef parser & formatter their own flags · 0ecd6851
      Daniel P. Berrange 提交于
      The virDomainDefParse* and virDomainDefFormat* methods both
      accept the VIR_DOMAIN_XML_* flags defined in the public API,
      along with a set of other VIR_DOMAIN_XML_INTERNAL_* flags
      defined in domain_conf.c.
      
      This is seriously confusing & error prone for a number of
      reasons:
      
       - VIR_DOMAIN_XML_SECURE, VIR_DOMAIN_XML_MIGRATABLE and
         VIR_DOMAIN_XML_UPDATE_CPU are only relevant for the
         formatting operation
       - Some of the VIR_DOMAIN_XML_INTERNAL_* flags only apply
         to parse or to format, but not both.
      
      This patch cleanly separates out the flags. There are two
      distint VIR_DOMAIN_DEF_PARSE_* and VIR_DOMAIN_DEF_FORMAT_*
      flags that are used by the corresponding methods. The
      VIR_DOMAIN_XML_* flags received via public API calls must
      be converted to the VIR_DOMAIN_DEF_FORMAT_* flags where
      needed.
      
      The various calls to virDomainDefParse which hardcoded the
      use of the VIR_DOMAIN_XML_INACTIVE flag change to use the
      VIR_DOMAIN_DEF_PARSE_INACTIVE flag.
      0ecd6851
  13. 06 1月, 2015 3 次提交
  14. 16 12月, 2014 1 次提交
    • M
      conf: Rework virDomainObjListFindByUUID to allow more concurrent APIs · feb1a4d7
      Martin Kletzander 提交于
      Currently, when there is an API that's blocking with locked domain and
      second API that's waiting in virDomainObjListFindByUUID() for the domain
      lock (with the domain list locked) no other API can be executed on any
      domain on the whole hypervisor because all would wait for the domain
      list to be locked.  This patch adds new optional approach to this in
      which the domain is only ref'd (reference counter is incremented)
      instead of being locked and is locked *after* the list itself is
      unlocked.  We might consider only ref'ing the domain in the future and
      leaving locking on particular APIs, but that's no tonight's fairy tale.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      feb1a4d7
  15. 13 12月, 2014 1 次提交
    • M
      qemu: avoid rare race when undefining domain · c7d1c139
      Martin Kletzander 提交于
      When one domain is being undefined and at the same time started, for
      example, there is a possibility of a rare problem occuring.
      
       - Thread 1 does virDomainUndefine(), has the lock, checks that the
         domain is active and because it's not, calls
         virDomainObjListRemove().
      
       - Thread 2 does virDomainCreate() and tries to lock the domain.
      
       - Thread 1 needs to lock domain list in order to remove the domain from
         it, but must unlock domain first (proper order is to lock domain list
         first and the domain itself second).
      
       - Thread 2 grabs the lock, starts the domain and releases the lock.
      
       - Thread 1 grabs the lock and removes the domain from list.
      
      With this patch:
      
       - The undefining domain gets marked as "to undefine" before it is
          unlocked.
      
       - If domain is found in any of the search APIs, it's returned only if
         it is not marked as "to undefine".  The check is done while the
         domain is locked.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1150505Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      c7d1c139
  16. 09 12月, 2014 1 次提交
    • L
      network: store network macTableManager setting in NetDef actual object · 33f4a8bc
      Laine Stump 提交于
      At the time that the network driver allocates a connection to a
      network, the tap device that will be used hasn't yet been created -
      that will be done later by qemu (or lxc or whoever) - but if the
      network has macTableManager='libvirt', then when we do get around to
      creating the tap device, we will need to add an entry for it to the
      network bridge's fdb (forwarding database) *and* turn off learning and
      unicast_flood for that tap device in the bridge's sysfs settings. This
      means that qemu needs to know both the bridge name as well as the
      setting of macTableManager, so we either need to create a new API to
      retrieve that info, or just pass it back in the ActualNetDef that is
      created during networkAllocateActualDevice. We choose the latter
      method, since it's already done for the bridge device, and it has the
      side effect of making the information available in domain status.
      
      (NB: in the future, I think that the tap device should actually be
      created by networkAllocateActualDevice(), as that will solve several
      other problems, but that is a battle for another day, and this
      information will still be useful outside the network driver)
      33f4a8bc
  17. 01 12月, 2014 3 次提交
  18. 25 11月, 2014 1 次提交
    • C
      lxc: be more patient while resolving symlinks · 72fecf18
      Cédric Bosdonnat 提交于
      Resolving symlinks can fail before mounting any file system if one file
      system depends on another being mounted. Symlinks are now resolved in
      two passes:
      
        * Before any file system is mounted, but then we are more gentle if
          the source path can't be accessed
        * Right before mounting a file system, so that we are sure that we
          have the resolved path... but then if it can't be accessed we raise
          an error.
      72fecf18