1. 03 6月, 2011 8 次提交
    • D
      Fix regressions BlockStats/Info APIs in QEMU driver · 2027e184
      Daniel P. Berrange 提交于
      The change 18c2a592 caused
      some regressions in behaviour of virDomainBlockStats
      and virDomainBlockInfo in the QEMU driver.
      
      The virDomainBlockInfo API stopped working for inactive
      guests if querying a block device.
      
      The virDomainBlockStats API did not promptly report
      an error if the guest was not running in some cases.
      
      * src/qemu/qemu_driver.c: Fix inactive guest handling
        in BlockStats/Info APIs
      2027e184
    • J
      Fix minor issues in libxenlight managed save · 9a76e737
      Jim Fehlig 提交于
      There were a few minor issues in commit 5b6c961e
      - leak managed save path
      - leak managed save fd
      - functions that open an fd should also close it
      9a76e737
    • H
      uml: correct command line networking parameters · 39b59dbd
      Heath Petersen 提交于
      I have been finding that some UML command line networking parameters are
      being generated incorrectly.
      
      For more information, see
      https://bugzilla.redhat.com/show_bug.cgi?id=706295 .
      39b59dbd
    • D
      Fix auditing of disk hotunplug operations · 020342e6
      Daniel P. Berrange 提交于
      The qemuAuditDisk calls in disk hotunplug operations were being
      passed 'ret >= 0', but the code which sets ret to 0 was not yet
      executed, and the error path had already jumped to the 'cleanup'
      label. This meant hotunplug failures were never audited, and
      hotunplug success was audited as a failure
      
      * src/qemu/qemu_hotplug.c: Fix auditing of hotunplug
      020342e6
    • D
      Avoid crash on NULL pointer in lock driver impls during hotplug · eb661ce3
      Daniel P. Berrange 提交于
      When virLockDriverAcquire is invoked during hotplug the state
      parameter will be left as NULL.
      
      * src/locking/lock_driver_nop.c,
        src/locking/lock_driver_sanlock.c: Don't reference NULL state
        parameter
      eb661ce3
    • D
      Fix return value in lock manager hotplug methods · 09240ef1
      Daniel P. Berrange 提交于
      Refactoring of the lock manager hotplug methods lost the
      ret = 0 assignment for successful return path
      
      * src/locking/domain_lock.c: Add missing ret = 0 assignments
      09240ef1
    • D
      Fix handling of VIR_EVENT_HANDLE_ERROR in QEMU monitor · 43917db3
      Daniel P. Berrange 提交于
      Commit 4454a9ef introduced bad
      behaviour on the VIR_EVENT_HANDLE_ERROR condition. This condition
      is only hit when an invalid FD is used in poll() (typically due
      to a double-close bug). The QEMU monitor code was treating this
      condition as non-fatal, and thus libvirt would poll() in a fast
      loop forever burning 100% CPU. VIR_EVENT_HANDLE_ERROR must be
      handled in the same way as VIR_EVENT_HANDLE_HANGUP, killing the
      QEMU instance.
      
      * src/qemu/qemu_monitor.c: Treat VIR_EVENT_HANDLE_ERROR as EOF
      43917db3
    • D
      Add call to sanlock_restrict() in QEMU lock driver · ebfb8c42
      Daniel P. Berrange 提交于
      In between fork and exec, a connection to sanlock is acquired
      and the socket file descriptor is intionally leaked to the
      child process. sanlock watches this FD for POLL_HANGUP to
      detect when QEMU has exited. We don't want a rogus/compromised
      QEMU from issuing sanlock RPC calls on the leaked FD though,
      since that could be used to DOS other guests. By calling
      sanlock_restrict() on the socket before exec() we can lock
      it down.
      
      * configure.ac: Check for sanlock_restrict API
      * src/locking/domain_lock.c: Restrict lock acquired in
        process startup phase
      * src/locking/lock_driver.h: Add VIR_LOCK_MANAGER_ACQUIRE_RESTRICT
      * src/locking/lock_driver_sanlock.c: Add call to sanlock_restrict
        when requested by VIR_LOCK_MANAGER_ACQUIRE_RESTRICT flag
      ebfb8c42
  2. 02 6月, 2011 15 次提交
    • M
      screenshot: Expose the new API in virsh · 3ef7350c
      Michal Privoznik 提交于
      * tools/virsh.c: Add screenshot command
      * tools/virsh.pod: Document new command
      * src/libvirt.c: Fix off-be-one error
      3ef7350c
    • D
      libxl : fix the version for the managed save APIs · 4cc4aee6
      Daniel Veillard 提交于
      4cc4aee6
    • M
      libxl: adds managed save and restore support · 5b6c961e
      Markus Groß 提交于
      Based on the equivalent qemu driver code
      
      * src/libxl/libxl_driver.c: refactor the Start save and restore
        routines of the driver and adds the new entry points for
        managed saves handling
      5b6c961e
    • M
      libxl: get maximum memory of running domain · 47370d5a
      Markus Groß 提交于
      * src/libxl/libxl_driver.c: fix the libxlDomainGetInfo to return the
        maximum memory for running domain
      47370d5a
    • D
      Add a plugin for the 'sanlock' project · 9f135031
      Daniel P. Berrange 提交于
      Sanlock is a project that implements a disk-paxos locking
      algorithm. This is suitable for cluster deployments with
      shared storage.
      
      * src/Makefile.am: Add dlopen plugin for sanlock
      * src/locking/lock_driver_sanlock.c: Sanlock driver
      * configure.ac: Check for sanlock
      * libvirt.spec.in: Add a libvirt-lock-sanlock RPM
      9f135031
    • D
      Allow leases to be hotpluged with QEMU guests · 30ffe7bc
      Daniel P. Berrange 提交于
      * src/conf/domain_conf.c, src/conf/domain_conf.h: APIs for
        inserting/finding/removing virDomainLeaseDefPtr instances
      * src/qemu/qemu_driver.c: Wire up hotplug/unplug for leases
      * src/qemu/qemu_hotplug.h, src/qemu/qemu_hotplug.c: Support
        for hotplug and unplug of leases
      30ffe7bc
    • D
      Support passing QEMU lock state to dest during migration · 7474560b
      Daniel P. Berrange 提交于
      Some lock managers associate state with leases, allowing a process
      to temporarily release its leases, and re-acquire them later, safe
      in the knowledge that no other process has acquired + released the
      leases in between.
      
      This is already used between suspend/resume operations, and must
      also be used across migration. This passes the lockstate in the
      migration cookie. If the lock manager uses lockstate, then it
      becomes compulsory to use the migration v3 protocol to get the
      cookie support.
      
      * src/qemu/qemu_driver.c: Validate that migration v2 protocol is
        not used if lock manager needs state transfer
      * src/qemu/qemu_migration.c: Transfer lock state in migration
        cookie XML
      7474560b
    • D
      Integrate the QEMU driver with the lock manager infrastructure · 12317957
      Daniel P. Berrange 提交于
      The QEMU integrates with the lock manager instructure in a number
      of key places
      
       * During startup, a lock is acquired in between the fork & exec
       * During startup, the libvirtd process acquires a lock before
         setting file labelling
       * During shutdown, the libvirtd process acquires a lock
         before restoring file labelling
       * During hotplug, unplug & media change the libvirtd process
         holds a lock while setting/restoring labels
      
      The main content lock is only ever held by the QEMU child process,
      or libvirtd during VM shutdown. The rest of the operations only
      require libvirtd to hold the metadata locks, relying on the active
      QEMU still holding the content lock.
      
      * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h,
        src/qemu/libvirtd_qemu.aug, src/qemu/test_libvirtd_qemu.aug:
        Add config parameter for configuring lock managers
      * src/qemu/qemu_driver.c: Add calls to the lock manager
      12317957
    • D
      Add higher level lock API for domain objects · ad73a937
      Daniel P. Berrange 提交于
      To facilitate use of the locking plugins from hypervisor drivers,
      introduce a higher level API for locking virDomainObjPtr instances.
      In includes APIs targetted to VM startup, and hotplug/unplug
      
      * src/Makefile.am: Add domain lock API
      * src/locking/domain_lock.c, src/locking/domain_lock.h: High
        level API for domain locking
      ad73a937
    • D
      Add a 'nop' lock driver implementation. · db98851c
      Daniel P. Berrange 提交于
      To allow hypervisor drivers to assume that a lock driver impl
      will be guaranteed to exist, provide a 'nop' impl that is
      compiled into the library
      
      * src/Makefile.am: Add nop driver
      * src/locking/lock_driver_nop.c, src/locking/lock_driver_nop.h:
        Nop lock driver implementation
      * src/locking/lock_manager.c: Enable direct access of 'nop'
        driver, instead of dlopen()ing it.
      db98851c
    • D
      Basic framework for lock manager plugins · 6a943419
      Daniel P. Berrange 提交于
      Define the basic framework lock manager plugins. The
      basic plugin API for 3rd parties to implemented is
      defined in
      
        src/locking/lock_driver.h
      
      This allows dlopen()able modules for alternative locking
      schemes, however, we do not install the header. This
      requires lock plugins to be in-tree allowing changing of
      the lock manager plugin API in future.
      
      The libvirt code for loading & calling into plugins
      is in
      
        src/locking/lock_manager.{c,h}
      
      * include/libvirt/virterror.h, src/util/virterror.c: Add
        VIR_FROM_LOCKING
      * src/locking/lock_driver.h: API for lock driver plugins
        to implement
      * src/locking/lock_manager.c, src/locking/lock_manager.h:
        Internal API for managing locking
      * src/Makefile.am: Add locking code
      6a943419
    • D
      Support leases in guest XML and lock manager · 1ea83207
      Daniel P. Berrange 提交于
      A lock manager may operate in various modes. The direct mode of
      operation is to obtain locks based on the resources associated
      with devices in the XML. The indirect mode is where the app
      creating the domain provides explicit leases for each resource
      that needs to be locked. This XML extension allows for listing
      resources in the XML
      
        <devices>
           ...
           <lease>
             <lockspace>somearea</lockspace>
             <key>thequickbrownfoxjumpsoverthelazydog</key>
             <target path='/some/lease/path' offset='23432'/>
           </lease>
           ...
        </devices>
      
      The 'lockspace' is a unique identifier for the lockspace which
      the lease is associated
      
      The 'key' is a unique identifier for the resource associated
      with the lease.
      
      The 'target' is the file on disk where the leases are held.
      
      * docs/schemas/domain.rng: Add lease schema
      * src/conf/domain_conf.c, src/conf/domain_conf.h: parsing and
        formatting for leases
      * tests/qemuxml2argvdata/qemuxml2argv-lease.args,
        tests/qemuxml2argvdata/qemuxml2argv-lease.xml,
        tests/qemuxml2xmltest.c: Test XML handling for leases
      1ea83207
    • D
      Allow handshake with child process during startup · 285c2fdf
      Daniel P. Berrange 提交于
      Allow the parent process to perform a bi-directional handshake
      with the child process during fork/exec. The child process
      will fork and do its initial setup. Immediately prior to the
      exec(), it will stop & wait for a handshake from the parent
      process. The parent process will spawn the child and wait
      until the child reaches the handshake point. It will do
      whatever extra setup work is required, before signalling the
      child to continue.
      
      The implementation of this is done using two pairs of blocking
      pipes. The first pair is used to block the parent, until the
      child writes a single byte. Then the second pair pair is used
      to block the child, until the parent confirms with another
      single byte.
      
      * src/util/command.c, src/util/command.h,
        src/libvirt_private.syms: Add APIs to perform a handshake
      285c2fdf
    • E
      security: plug regression introduced in disk probe logic · b598ac55
      Eric Blake 提交于
      Regression introduced in commit d6623003 (v0.8.8) - using the
      wrong sizeof operand meant that security manager private data
      was overlaying the allowDiskFormatProbing member of struct
      _virSecurityManager.  This reopens disk probing, which was
      supposed to be prevented by the solution to CVE-2010-2238.
      
      * src/security/security_manager.c
      (virSecurityManagerGetPrivateData): Use correct offset.
      b598ac55
    • J
      Fix order of disks and controllers · c1a98d88
      Jiri Denemark 提交于
      Commit 2d6adabd replaced qsorting disk
      and controller devices with inserting them at the right position. That
      was to fix unnecessary reordering of devices. However, when parsing
      domain XML devices are just taken in the order in which they appear in
      the XML since. Use the correct insertion algorithm to honor device
      target.
      c1a98d88
  3. 01 6月, 2011 10 次提交
  4. 31 5月, 2011 7 次提交
    • M
      conf: Fix incorrect spice graphic XML format on compression options · 155542a5
      Michal Privoznik 提交于
      If spice graphics has no <channel> elements, the output graphics XML
      is messed up. To prevent this, we need to end the <graphics> element
      just before adding any compression selecting elements.
      155542a5
    • D
      Fix sysinfo/virsh build problems on Win32 · ef983dfe
      Daniel P. Berrange 提交于
      The virSysinfoIsEqual method was mistakenly inside a #ifndef WIN32
      conditional.
      
      The existing virSysinfoFormat is also stubbed out on Win32, even
      though the code works without any trouble. This breaks XML output
      on Win32, so the stub is removed.
      
      virsh migrate mistakenly had some variables inside the conditional
      
      * src/util/sysinfo.c: Build virSysinfoIsEqual on Win32 and remove
        Win32 stub for virSysinfoFormat
      * tools/virsh.c: Fix variable declaration on Win32
      ef983dfe
    • J
      openvz: fix bridge devices parsing in openvzReadNetworkConf() · 07963952
      Jean-Baptiste Rouault 提交于
      strchrnul() was called on the wrong string so it returned
      the same result for each iteration.
      07963952
    • D
      Allow custom XML to be passed in during migration · 44924615
      Daniel P. Berrange 提交于
      Update the qemuDomainMigrateBegin method so that it accepts
      an optional incoming XML document. This will be validated
      for ABI compatibility against the current domain config,
      and if this check passes, will be passed back out for use
      by the qemuDomainMigratePrepare method on the target
      
      * src/qemu/qemu_domain.c, src/qemu/qemu_domain.h,
        src/qemu/qemu_migration.c: Allow custom XML to be passed
      44924615
    • D
      Add an API for comparing the ABI of two guest configurations · 08106e20
      Daniel P. Berrange 提交于
      To allow a client app to pass in custom XML during migration
      of a guest it is neccessary to ensure the guest ABI remains
      unchanged. The virDomainDefCheckABIStablity method accepts
      two virDomainDefPtr structs and compares everything in them
      that could impact the guest machine ABI
      
      * src/conf/domain_conf.c, src/conf/domain_conf.h,
        src/libvirt_private.syms: Add virDomainDefCheckABIStablity
      * src/conf/cpu_conf.c, src/conf/cpu_conf.h: Add virCPUDefIsEqual
      * src/util/sysinfo.c, src/util/sysinfo.h: Add virSysinfoIsEqual
      08106e20
    • D
      Remove unused 'target' field in virDomainHostdevDef · 0e4d4afb
      Daniel P. Berrange 提交于
      The virDomainHostdevDef struct contains a 'char *target'
      field. This is set to 'NULL' when parsing XML and never
      used / set anywhere else. Clearly it is bogus & unused
      
      * src/conf/domain_conf.c, src/conf/domain_conf.h: Remove
        target from virDomainHostdevDef
      0e4d4afb
    • O
      lxc: Seperate domain config loading · 584ce634
      Osier Yang 提交于
      This patch seperate the domain config loading just as qemu driver
      does, first loading config of running or trasient domains, then
      of persistent inactive domains. And only try to reconnect the
      monitor of running domains, so that it won't always throws errors
      saying can't connect to domain monitor.
      
      And as "virDomainLoadConfig->virDomainAssignDef->virDomainObjAssignDef",
      already do things like "vm->newDef = def", removed the codes
      in "lxcReconnectVM" that does the same work.
      584ce634