1. 29 9月, 2009 16 次提交
    • D
      Add API for using 'usb_add' for disk devices · f566c592
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new
        qemuMonitorAddUSBDisk() API
      * src/qemu/qemu_driver.c: Switch USB disk hotplug to the new
        src/qemu/qemu_driver.c API.
      f566c592
    • D
      Add API for issuing 'migrate' command with exec protocol · ed2a10a1
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new
        qemuMonitorMigrateToCommand() API
      * src/qemu/qemu_driver.c: Switch over to using the
        qemuMonitorMigrateToCommand() API for core dumps and save
        to file APIs
      ed2a10a1
    • D
      Add API for issuing a 'migrate' monitor command for TCP · 81f3edea
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new API
        qemuMonitorMigrateToHost() for doing TCP migration
      * src/qemu/qemu_driver.c: Convert to use qemuMonitorMigrateToHost().
        Also handle proper URIs (tcp:// as well as tcp:)
      81f3edea
    • D
      Add API for running 'info migration' monitor command · d7a3c835
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new
        qemuMonitorGetMigrationStatus() command.
      * src/qemu/qemu_driver.c: Use new qemuMonitorGetMigrationStatus()
        command to check completion status.
      d7a3c835
    • D
      Add API for issuing the 'migrate_set_speed' monitor command · bdc8861a
      Daniel P. Berrange 提交于
      * src/qemu/qemu_driver.c: Use new qemuMonitorSetMigrationSpeed()
        API during migration
      * src/qemu/qemu_monitor.h, src/qemu/qemu_monitor.c: Add new
        qemuMonitorSetMigrationSpeed() API
      bdc8861a
    • D
      Add API for issuing 'info blockstats' command · f225e560
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add a new
        qemuMonitorGetBlockStatsInfo() command
      * src/qemu/qemu_driver.c: Remove directly use of blockstats in
        favour of calling qemuMonitorGetBlockStatsInfo()
      f225e560
    • D
      Add APIs for issuing 'memsave' and 'pmemsave' monitor commands · 316e9f90
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor.h, src/qemu/qemu_monitor.c: Add new APIs
        qemuMonitorSaveVirtualMemory() and qemuMonitorSavePhysicalMemory()
      * src/qemu/qemu_driver.c: Use the new qemuMonitorSaveVirtualMemory()
        and qemuMonitorSavePhysicalMemory() APIs
      316e9f90
    • D
      Add APIs for issuing 'eject' and 'change dev' monitor commands · 6d9c4758
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new APis
        qemuMonitorChangeMedia and qemuMonitorEjectMedia. Pull in code
        for qemudEscape
      * src/qemu/qemu_driver.c: Remove code that directly issues 'eject'
        and 'change' commands in favour of API calls.
      6d9c4758
    • D
      Add API for issuing 'balloon' monitor command · eff29c8b
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new
        qemuMonitorSetBalloon() based on existing code in
        qemudDomainSetMemoryBalloon
      * src/qemu/qemu_driver.c: Remove use of qemudDomainSetMemoryBalloon()
        in favour of qemuMonitorSetBalloon(). Fix error code when balloon
        is not supported
      eff29c8b
    • D
      Add API for running 'info balloon' monitor command · 6f19c16c
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Pull old
        qemudDomainGetMemoryBalloon() code into a new method called
        qemuMonitorGetBalloonInfo()
      * src/qemu/qemu_driver.c: Update to call qemuMonitorGetBalloonInfo()
        and remove qemudDomainGetMemoryBalloon().
      6f19c16c
    • D
      Add API for the 'system_powerdown' monitor command · 19d70c7d
      Daniel P. Berrange 提交于
      * src/qemu/qemu_driver.c: Remove use of 'system_powerdown'
      * src/qemu/qemu_monitor.h, src/qemu/qemu_monitor.c: Add a new
        qemuMonitorSystemPowerdown() api call
      19d70c7d
    • D
      Add API for 'stop' monitor command · 1e64d8c7
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add a new
        qemuMonitorStopCPUs() API
      * src/qemu/qemu_driver.c: Replace direct monitor commands for 'stop'
        with qemuMonitorStopCPUs()
      1e64d8c7
    • D
      Rename qemudMonitorSendCont to qemuMonitorStartCPUs · 4734a422
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Rename
        Rename qemudMonitorSendCont to qemuMonitorStartCPUs
      * src/qemu/qemu_driver.c: Update callers for new name
      4734a422
    • D
      Add API for 'change vnc password' monitor command · 3aee2615
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add a
        new qemuMonitorSetVNCPassword() API
      * src/qemu/qemu_driver.c: Refactor qemudInitPasswords to
        call qemuMonitorSetVNCPassword()
      3aee2615
    • D
      Add API for 'info cpus' monitor command · f38b654e
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor.h, src/qemu/qemu_monitor.c: Add a new
        qemuMonitorGetCPUInfo() command
      * src/qemu/qemu_driver.c: Refactor qemudDetectVcpuPIDs to
        use qemuMonitorGetCPUInfo()
      f38b654e
    • D
      Pull QEMU monitor interaction out to separate file · a541c762
      Daniel P. Berrange 提交于
      Pull out all the QEMU monitor interaction code to a separate
      file. This will make life easier when we need to drop in a
      new implementation for the forthcoming QMP machine friendly
      monitor support.
      
      Next step is to add formal APIs for each monitor command,
      and remove direct commands for sending/receiving generic
      data.
      
      * src/Makefile.am: Add qemu_monitor.c to build
      * src/qemu/qemu_driver.c: Remove code for monitor interaction
      * src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: New
        file for monitor interaction
      * po/POTFILES.in: Add src/qemu/qemu_monitor_text.c
      a541c762
  2. 24 9月, 2009 1 次提交
  3. 23 9月, 2009 1 次提交
    • C
      Introduce virStrncpy. · 03d777f3
      Chris Lalancette 提交于
      Add the virStrncpy function, which takes a dst string, source string,
      the number of bytes to copy and the number of bytes available in the
      dest string.  If the source string is too large to fit into the
      destination string, including the \0 byte, then no data is copied and
      the function returns NULL.  Otherwise, this function copies n bytes
      from source into dst, including the \0, and returns a pointer to the
      dst string.  This function is intended to replace all unsafe uses
      of strncpy in the code base, since strncpy does *not* guarantee that
      the buffer terminates with a \0.
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      03d777f3
  4. 22 9月, 2009 1 次提交
  5. 21 9月, 2009 4 次提交
    • D
      Move security drivers to src/security/ · e56c6a83
      Daniel P. Berrange 提交于
      * src/Makefile.am, src/qemu/qemu_conf.h, src/qemu/qemu_driver.c,
        tests/seclabeltest.c: Adapt for changed paths
      * src/security.c: Rename to src/security/security_driver.c
      * src/security.h: Rename to src/security/security_driver.h
      * src/security_selinux.c, src/security_selinux.h: Move to src/security/
      e56c6a83
    • D
      Move QEMU driver to src/qemu/ · 58355a5b
      Daniel P. Berrange 提交于
      * src/qemu_conf.c, src/qemu_conf.h, src/qemu_driver.c,
        src/qemu_driver.h: Move to src/qemu/
      * daemon/qemud.c, src/Makefile.am, tests/qemuargv2xmltest.c,
        tests/qemuhelptest.c, tests/qemuxml2argvtest.c,
        tests/qemuxml2xmltest.c: Adapt for changed paths
      58355a5b
    • D
      Move xen driver code into src/xen/ directory · f7a107f7
      Daniel P. Berrange 提交于
      * src/Makefile.am, src/proxy_internal.c, src/proxy_internal.h
        src/sexpr.c, src/sexpr.h, src/xen_unified.c, src/xen_unified.h,
        src/xen_internal.c, src/xen_internal.h, src/xen_inotify.c,
        src/xen_inotify.h, src/xend_internal.c, src/xend_internal.h,
        src/xm_internal.c, src/xm_internal.h, src/xs_internal.c,
        src/xs_internal.h: Move to src/xen/ directory
      * proxy/Makefile.am, proxy/libvirt_proxy.c, src/Makefile.am,
        src/libvirt.c, tests/sexpr2xmltest.c, tests/statstest.c,
        tests/xencapstest.c, tests/xmconfigtest.c, tests/xml2sexprtest.c:
        Adapt to changed xen location
      * src/stats_linux.h, src/stats_linux.c: Remove xen specific block
        stats APIs
      * src/qemu_driver.c, src/uml_driver.c: Add missing sys/un.h include
        uncovered after change to stats_linux.h
      * src/xen/block_stats.h, src/xen/block_stats.c: Add xen specific
        block stats APIs
      f7a107f7
    • M
      Fix leak in PCI hostdev hot-unplug · a70da51f
      Mark McLoughlin 提交于
      * src/qemu_driver.c: sync the hostdev hot-unplug code with the disk/net
        code.
      a70da51f
  6. 17 9月, 2009 1 次提交
  7. 15 9月, 2009 1 次提交
    • D
      Fix UUID handling in secrets/storage encryption APIs · 47e7a258
      Daniel P. Berrange 提交于
      Convert all the secret/storage encryption APIs / wire format to
      handle UUIDs in raw format instead of non-canonical printable
      format. Guarentees data format correctness.
      
      * docs/schemas/storageencryption.rng: Make UUID mandatory for a secret
        and validate fully
      * docs/schemas/secret.rng: Fully validate UUID
      * include/libvirt/libvirt.h, include/libvirt/libvirt.h.in, Add
        virSecretLookupByUUID and virSecretGetUUID. Make
        virSecretGetUUIDString follow normal API design pattern
      * python/generator.py: Skip generation of virSecretGetUUID,
        virSecretGetUUIDString and virSecretLookupByUUID
      * python/libvir.c, python/libvirt-python-api.xml: Manual impl
        of virSecretGetUUID,virSecretGetUUIDString and virSecretLookupByUUID
      * qemud/remote.c: s/virSecretLookupByUUIDString/virSecretLookupByUUID/
        Fix get_nonnull_secret/make_nonnull_secret to use unsigned char
      * qemud/remote_protocol.x: Fix remote_nonnull_secret to use a
        remote_uuid instead of remote_nonnull_string for UUID field.
        Rename REMOTE_PROC_SECRET_LOOKUP_BY_UUID_STRING to
        REMOTE_PROC_SECRET_LOOKUP_BY_UUID_STRING and make it take an
        remote_uuid  value
      * qemud/remote_dispatch_args.h, qemud/remote_dispatch_prototypes.h,
        qemud/remote_dispatch_ret.h, qemud/remote_dispatch_table.h,
        qemud/remote_protocol.c, qemud/remote_protocol.h: Re-generate
      * src/datatypes.h, src/datatypes.c: Store UUID in raw format instead
        of printable. Change virGetSecret to use raw format UUID
      * src/driver.h: Rename virDrvSecretLookupByUUIDString to
        virDrvSecretLookupByUUID and use raw format UUID
      * src/libvirt.c: Add virSecretLookupByUUID and virSecretGetUUID
        and re-implement virSecretLookupByUUIDString and
        virSecretGetUUIDString in terms of those
      * src/libvirt_public.syms: Add virSecretLookupByUUID and
        virSecretGetUUID
      * src/remote_internal.c: Rename remoteSecretLookupByUUIDString
        to remoteSecretLookupByUUID. Fix typo in args for
        remoteSecretDefineXML impl. Use raw UUID format for
        get_nonnull_secret and make_nonnull_secret
      * src/storage_encryption_conf.c, src/storage_encryption_conf.h:
        Storage UUID in raw format, and require it to be present in
        XML. Use UUID parser to validate.
      * secret_conf.h, secret_conf.c: Generate a UUID if none is provided.
        Storage UUID in raw format.
      * src/secret_driver.c: Adjust to deal with raw UUIDs. Save secrets
        in a filed with printable UUID, instead of base64 UUID.
      * src/virsh.c: Adjust for changed public API contract of
        virSecretGetUUIDString.
      * src/storage_Backend.c: DOn't undefine secret we just generated
        upon successful volume creation. Fix to handle raw UUIDs. Generate
        a non-clashing UUID
      * src/qemu_driver.c: Change to use lookupByUUID instead of
        lookupByUUIDString
      47e7a258
  8. 14 9月, 2009 1 次提交
    • D
      Save vcpuinfo in status file · f2ad7824
      Daniel P. Berrange 提交于
      * src/qemu_driver.c: Don't trust monitor for vcpu PID info on
        restart
      * src/domain_conf.c: Save and load vCPU PID info from domain
        status file
      f2ad7824
  9. 11 9月, 2009 1 次提交
    • M
      Add support for qcow encrypted volumes to qemu. · 07ce4d2a
      Miloslav Trmač 提交于
      Integrate with QEMU monitor to provide encryption passphrase when
      starting a guest using encrypted qcow volumes
      
      * src/qemu_driver.c (findDomainDiskEncryption,
        findVolumeQcowPassphrase,
        qemudMonitorSendVolumePassphrase, qemudMonitorSendCont): Send a volume
        passphrase if qemu asks for it.
      07ce4d2a
  10. 10 9月, 2009 11 次提交
    • M
      Consolidate "cont" into qemudMonitorSendCont() · 7ec20935
      Miloslav Trmač 提交于
      The interface allows qemudMonitorSendCont() to report errors that are
      not overridden by its callers.
      
      Also fix a potential infinite loop in qemuDomainCoreDump() if sending
      cont repeatedly fails.
      
      * src/qemu_driver.c (qemudMonitorSendCont): New function.
        (qemudAutostartConfigs): Reset error before each call to
        qemudStartVMDaemon().
        (qemudInitCpus, qemudDomainResume, qemudDomainCoreDump,
        qemudDomainRestore, qemudDomainMigratePerform,
        qemudDomainMigrateFinish2): Use qemudMonitorSendCont().
      7ec20935
    • D
      Cleanup sec driver error reporting to use virReportSystemError · 7887e003
      Daniel P. Berrange 提交于
      * src/security_selinux.c: Use virReportSystemError whereever an
        errno is involved
      * src/qemu_driver.c: Don't overwrite error message from the
        security driver
      7887e003
    • D
      Support relabelling of USB and PCI devices · 0e9ae444
      Daniel P. Berrange 提交于
      * src/security.h: Driver API for relabelling host devices
      * src/security_selinux.c: Implement relabelling of PCI and USB
        devices
      * src/qemu_driver.c: Relabel USB/PCI devices before hotplug
      0e9ae444
    • D
      Port QEMU driver to use USB/PCI device helpers · c42c1b8a
      Daniel P. Berrange 提交于
      * src/qemu_driver.c: Remove usbfs/sysfs iterator code and call
        into generic helper APIs instead when setting device permissions
      c42c1b8a
    • D
      Fix misc thread locking bugs / bogus warnings · 5c8d3d3b
      Daniel P. Berrange 提交于
      Fix all thread locking bugs reported by object-locking test
      case.
      
      NB, some of the driver locking is getting too coarse. Driver
      mutexes really need to be turned into RW locks instead to
      significantly increase concurrency.
      
      * src/lxc_driver.c: Fix useof driver when unlocked in the methods
        lxcDomainGetInfo, lxcSetSchedulerParameters, and
        lxcGetSchedulerParameters
      * src/opennebula/one_driver.c: Fix missing unlock in oneDomainUndefine.
        Fix use of driver when unlocked in oneDomainGetInfo,
        oneGetOSType, oneDomainShutdown
      * src/qemu_driver.c: Fix use of driver when unlocked in
        qemudDomainSavem, qemuGetSchedulerType, qemuSetSchedulerParameters
        and qemuGetSchedulerParameters
      * src/storage_driver.c: Re-work storagePoolCreate to avoid bogus
        lock checking warning. Re-work storageVolumeCreateXMLFrom to
        remove a potential NULL de-reference & avoid bogus lock check
        warnings
      * src/test.c: Remove testDomainAssignDef since it break lock chekc
        warnings.
      * tests/object-locking.ml: Add oneDriverLock, oneDriverUnlock
        and one_driver_t methods/types to allow lock checking on the
         OpenNebula drivers
      5c8d3d3b
    • M
      Simplify and fix qemudCanonicalizeMachine() · 6ab16aaf
      Mark McLoughlin 提交于
      The algorithm is quite simple:
      
        If the emulator matches a guest's domain:
          if domain has machine type info:
            check the domain's machine type info
          else
            check the guest's default machine type info
        else if the emulator matches the guest's default emulator:
           check the guest's default machine type info
      
      The previous implementation was incorrectly falling back to the default
      machine type info if the domain's machine type info didn't have an
      alias.
      
      * src/qemu_driver.c: simplify and fix qemudCanonicalizeMachine()
      6ab16aaf
    • M
      Canonicalize the qemu machine type in qemuxml2argvtest · 6e7ab461
      Mark McLoughlin 提交于
      This doesn't have any affect on the current tests because we don't have
      any machine aliases in the current test data.
      
      * src/qemu_conf.h, src/qemu_driver.c: expose qemudCanonicalizeMachine()
        for the tests
      
      * tests/qemuxml2argvtest.c: canonicalize the machine type
      6e7ab461
    • C
      Fix regression from "Avoid polling on FDs with no events" · 100cae73
      Chris Lalancette 提交于
      After the mentioned patch was applied, I noticed that
      shutting down a kvm guest from inside (i.e. poweroff) caused
      the guest to shutdown, but not removed from the list of
      active guests.  DanB pointed out that the problem is that
      the virEventAddHandle() call in the qemu driver was asking
      to watch for 0 events, not HANGUP | ERROR as it should.  Add
      these events so that shutdown works again.
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      100cae73
    • J
      qemu_driver.c: factor out more duplication · f2387093
      Jim Meyering 提交于
      * src/qemu_driver.c (qemudDomainRestore): Use the new ...TypeToString
      function here, too.
      f2387093
    • R
      Close logfile fd after spawning qemu · 32456779
      Ryota Ozaki 提交于
      * src/qemu_driver.c: avoid a leak of file descriptor when exec'ing qemu
      32456779
    • C
      Reintroduce support for lzop compression · 8d4ed2ad
      Charles Duffy 提交于
      lzop was removed due to some confusion over whether it provided functional
      advantages distinct from xz. This has been addressed in the mailing list post
      archived at http://permalink.gmane.org/gmane.comp.emulators.libvirt/16487, and
      support for lzop is re-added here.
      
      * libvirt.spec.in: add dependancy on lzop
      * src/qemu.conf: update documentation of save_image_format
      * src/qemu_driver.c: re-add lzop compression option
      8d4ed2ad
  11. 09 9月, 2009 2 次提交
    • D
      Deprecate lzma and lzop in favor of xz, add dep · c5a30558
      Daniel Veillard 提交于
      * src/qemu_driver.c: drop lzma and lzop images compression options
        as they are deprecated by xz
      * libvirt.spec.in: add requires for xz/bzip2/gzip as they are needed
        to implement the compression options
      c5a30558
    • J
      qemu_driver.c: factor out duplication in compression-type handling · aec22258
      Jim Meyering 提交于
      * src/qemu_driver.c (QEMUD_SAVE_FORMAT_LAST): Define.
      (qemudSaveCompressionTypeFromString): Declare.
      (qemudSaveCompressionTypeToString): Declare.
      (qemudDomainSave): Use those functions rather than open-coding them.
      Use "cat >> '%s' ..." in place of equivalent
      "dd of='%s' oflag=append conv=notrunc ...".
      aec22258