1. 15 5月, 2013 1 次提交
    • M
      qemu: Add VNC WebSocket support · 85ec7ff6
      Martin Kletzander 提交于
      Adding a VNC WebSocket support for QEMU driver.  This functionality is
      in upstream qemu from commit described as v1.3.0-982-g7536ee4, so the
      capability is being recognized based on QEMU version for now.
      85ec7ff6
  2. 02 5月, 2013 1 次提交
    • M
      virutil: Move string related functions to virstring.c · 7c9a2d88
      Michal Privoznik 提交于
      The source code base needs to be adapted as well. Some files
      include virutil.h just for the string related functions (here,
      the include is substituted to match the new file), some include
      virutil.h without any need (here, the include is removed), and
      some require both.
      7c9a2d88
  3. 25 4月, 2013 1 次提交
  4. 19 4月, 2013 1 次提交
  5. 08 4月, 2013 3 次提交
    • O
      qemu: Support sgio setting for volume type disk · a9762b73
      Osier Yang 提交于
      a9762b73
    • O
      qemu: Support shareable volume type disk · 464d4e55
      Osier Yang 提交于
      Since the source is already translated before. This just adds the
      checking. Move !disk->shared and !disk->src to improve the performance
      a bit.
      464d4e55
    • O
      qemu: Translate the pool disk source earlier · 60b78b33
      Osier Yang 提交于
      To support "shareable" for volume type disk, we have to translate
      the source before trying to add the shared disk entry. To achieve
      the goal, this moves the helper qemuTranslateDiskSourcePool into
      src/qemu/qemu_conf.c, and introduce an internal only member (voltype)
      for struct _virDomainDiskSourcePoolDef, to record the underlying
      volume type for use when building the drive string.
      
      Later patch will support "shareable" volume type disk.
      60b78b33
  6. 05 4月, 2013 6 次提交
    • D
      Don't create dirs in cgroup controllers we don't want to use · 56f27b3b
      Daniel P. Berrange 提交于
      Currently when getting an instance of virCgroupPtr we will
      create the path in all cgroup controllers. Only at the virt
      driver layer are we attempting to filter controllers. This
      is bad because the mere act of creating the dirs in the
      controllers can have a functional impact on the kernel,
      particularly for performance.
      
      Update the virCgroupForDriver() method to accept a bitmask
      of controllers to use. Only create dirs in the controllers
      that are requested. When creating cgroups for domains,
      respect the active controller list from the parent cgroup
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      56f27b3b
    • P
      virCaps: get rid of defaultDiskDriverType · b2990849
      Peter Krempa 提交于
      Use the qemu specific callback to fill this data in the qemu driver as
      it's the only place where it was used and fix tests as the qemu test
      capability object didn't configure the defaults for the tests.
      b2990849
    • P
      virCaps: get rid of defaultDiskDriverName · 9ea249e7
      Peter Krempa 提交于
      This patch removes the defaultDiskDriverName from the virCaps
      structure. This particular default value is used only in the qemu driver
      so this patch uses the recently added callback to fill the driver name
      if it's needed instead of propagating it through virCaps.
      9ea249e7
    • P
      qemu: Record the default NIC model in the domain XML · a68d6726
      Peter Krempa 提交于
      This patch implements the devices post parse callback and uses it to fill
      the default qemu network card model into the XML if none is specified.
      
      Libvirt assumes that the network card model for qemu is the "rtl8139".
      Record this in the XML using the new callback to avoid user
      confusion.
      a68d6726
    • P
      conf: Add post XML parse callbacks and prepare for cleaning of virCaps · 43b99fc4
      Peter Krempa 提交于
      This patch adds instrumentation that will allow hypervisor drivers to
      fill and validate domain and device definitions after parsed by the XML
      parser.
      
      With this patch, after the XML is parsed, a callback to the driver is
      issued requesting to fill and validate driver specific details of the
      configuration. This allows to use sensible defaults and checks on a per
      driver basis at the time the XML is parsed.
      
      Two callback pointers are stored in the new virDomainXMLConf object:
      * virDomainDeviceDefPostParseCallback (devicesPostParseCallback)
        - called for a single device parsed and for every single device in a
          domain config. A virDomainDeviceDefPtr is passed along with the
          domain definition and virCaps.
      
      * virDomainDefPostParseCallback, (domainPostParseCallback)
        - A callback that is meant to process the domain config after it's
        parsed.  A virDomainDefPtr is passed along with virCaps.
      
      Both types of callbacks support arbitrary opaque data passed for the
      callback functions.
      
      Errors may be reported in those callbacks resulting in a XML parsing
      failure.
      43b99fc4
    • P
      maint: Rename xmlconf to xmlopt and virDomainXMLConfig to virDomainXMLOption · e84b1931
      Peter Krempa 提交于
      This patch is the result of running:
      
      for i in $(git ls-files | grep -v html | grep -v \.po$ ); do
        sed -i -e "s/virDomainXMLConf/virDomainXMLOption/g" -e "s/xmlconf/xmlopt/g" $i
      done
      
      and a few manual tweaks.
      e84b1931
  7. 13 3月, 2013 1 次提交
    • P
      virCaps: conf: start splitting out irrelevat data · 27cf98e2
      Peter Krempa 提交于
      The virCaps structure gathered a ton of irrelevant data over time that.
      The original reason is that it was propagated to the XML parser
      functions.
      
      This patch aims to create a new data structure virDomainXMLConf that
      will contain immutable data that are used by the XML parser. This will
      allow two things we need:
      
      1) Get rid of the stuff from virCaps
      
      2) Allow us to add callbacks to check and add driver specific stuff
      after domain XML is parsed.
      
      This first attempt removes pointers to private data allocation functions
      to this new structure and update all callers and function that require
      them.
      27cf98e2
  8. 12 3月, 2013 1 次提交
  9. 04 3月, 2013 1 次提交
    • C
      qemu: Use -1 as unpriviledged uid/gid · aff6942c
      Christophe Fergeau 提交于
      Commit f506a4c1 changed virSetUIDGID() to be a noop
      when uid/gid are -1, while it used to be a noop when
      they are <= 0.
      
      The changes in this commit broke creating new VMs in GNOME Boxes
      as qemuDomainCheckDiskPresence gets called during domain creation/startup,
      which in turn calls virFileAccessibleAs which fails after calling
      virSetUIDGID(0, 0) (Boxes uses session libvirtd). virSetUIDGID is called with
      (0, 0) as these are the default user/group values in virQEMUDriverConfig
      for session libvirtd.
      
      This commit changes virQEMUDriverConfigNew to use -1 as the unpriviledged
      uid/gid. I've also looked at the various places where cfg->user is used,
      and they all seem to handle -1 correctly.
      aff6942c
  10. 01 3月, 2013 1 次提交
    • D
      Fix deadlock in QEMU close callback APIs · 96b893f0
      Daniel P. Berrange 提交于
      There is a lock ordering problem in the QEMU close callback
      APIs.
      
      When starting a guest we have a lock on the VM. We then
      set a autodestroy callback, which acquires a lock on the
      close callbacks.
      
      When running auto-destroy, we obtain a lock on the close
      callbacks, then run each callbacks - which obtains a lock
      on the VM.
      
      This causes deadlock if anyone tries to start a VM, while
      autodestroy is taking place.
      
      The fix is to do autodestroy in 2 phases. First obtain
      all the callbacks and remove them from the list under
      the close callback lock. Then invoke each callback
      from outside the close callback lock.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      96b893f0
  11. 28 2月, 2013 1 次提交
    • D
      Fix autodestroy of QEMU guests · b4a124ef
      Daniel P. Berrange 提交于
      The virQEMUCloseCallbacksRunOne method was passing a uuid string
      to virDomainObjListFindByUUID, when it actually expected to get
      a raw uuid buffer. This was not caught by the compiler because
      the method was using a 'void *uuid' instead of first casting
      it to the expected type.
      
      This regression was accidentally caused by refactoring in
      
        commit 568a6cda
        Author: Jiri Denemark <jdenemar@redhat.com>
        Date:   Fri Feb 15 15:11:47 2013 +0100
      
          qemu: Avoid deadlock in autodestroy
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      b4a124ef
  12. 21 2月, 2013 7 次提交
  13. 13 2月, 2013 1 次提交
    • D
      Remove qemuDriverLock from almost everywhere · a9e97e0c
      Daniel P. Berrange 提交于
      With the majority of fields in the virQEMUDriverPtr struct
      now immutable or self-locking, there is no need for practically
      any methods to be using the QEMU driver lock. Only a handful
      of helper APIs in qemu_conf.c now need it
      a9e97e0c
  14. 11 2月, 2013 1 次提交
  15. 08 2月, 2013 1 次提交
  16. 06 2月, 2013 1 次提交
  17. 05 2月, 2013 2 次提交
    • D
      Rename all domain list APIs to have virDomainObjList prefix · 4f6ed6c3
      Daniel P. Berrange 提交于
      The APIs names for accessing the domain list object are
      very inconsistent. Rename them all to have a standard
      virDomainObjList prefix.
      4f6ed6c3
    • D
      Introduce a virQEMUDriverConfigPtr object · b090aa7d
      Daniel P. Berrange 提交于
      Currently the virQEMUDriverPtr struct contains an wide variety
      of data with varying access needs. Move all the static config
      data into a dedicated virQEMUDriverConfigPtr object. The only
      locking requirement is to hold the driver lock, while obtaining
      an instance of virQEMUDriverConfigPtr. Once a reference is held
      on the config object, it can be used completely lockless since
      it is immutable.
      
      NB, not all APIs correctly hold the driver lock while getting
      a reference to the config object in this patch. This is safe
      for now since the config is never updated on the fly. Later
      patches will address this fully.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      b090aa7d
  18. 24 1月, 2013 1 次提交
    • D
      Avoid use of free'd memory in auto destroy callback · 4e4c6620
      Daniel P. Berrange 提交于
      The autodestroy callback code has the following function
      called from a hash iterator
      
        qemuDriverCloseCallbackRun(void *payload,
                                   const void *name,
                                   void *opaque)
        {
          ...
          char *uuidstr = name
          ...
      
          dom = closeDef->cb(data->driver, dom, data->conn);
          if (dom)
              virObjectUnlock(dom);
      
          virHashRemoveEntry(data->driver->closeCallbacks, uuidstr);
        }
      
      The closeDef->cb function may well cause the current callback
      to be removed, if it shuts down 'dom'. As such the use of
      'uuidstr' in virHashRemoveEntry is accessing free'd memory.
      We must make a copy of the uuid str before invoking the
      callback to be safe.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      4e4c6620
  19. 17 1月, 2013 1 次提交
    • D
      Avoid integer wrap on remotePortMax in QEMU driver · da5a8aee
      Daniel P. Berrange 提交于
      The QEMU driver default max port is 65535, but it then increments
      this by 1 to 65536. This maps to 0 in an unsigned short :-( This
      was apparently done so that for() loops could use "< max" instead
      of "<= max". Remove this insanity and just make the loop do the
      right thing.
      da5a8aee
  20. 16 1月, 2013 1 次提交
  21. 07 1月, 2013 1 次提交
    • O
      qemu: Add a hash table for the shared disks · d7ead3e1
      Osier Yang 提交于
      This introduces a hash table for qemu driver, to store the shared
      disk's info as (@major:minor, @ref_count). @ref_count is the number
      of domains which shares the disk.
      
      Since we only care about if the disk support unprivileged SG_IO
      commands, and the SG_IO commands only make sense for block disk,
      this patch only manages (add/remove hash entry) the shared disk for
      block disk.
      
      * src/qemu/qemu_conf.h: (Add member 'sharedDisks' of type
                               virHashTablePtr; Declare helpers
                               qemuGetSharedDiskKey, qemuAddSharedDisk
                               and qemuRemoveSharedDisk)
      * src/qemu/qemu_conf.c (Implement the 3 helpers)
      * src/qemu/qemu_process.c (Update 'sharedDisks' when domain
                                 starting and shutdown)
      * src/qemu/qemu_driver.c (Update 'sharedDisks' when attaching
                                or detaching disk).
      d7ead3e1
  22. 21 12月, 2012 5 次提交