1. 18 12月, 2009 11 次提交
    • J
      Adds CPU map for models and features · d5ef0a69
      Jiri Denemark 提交于
      * src/cpu/cpu_map.xml: newdescription file
      * src/Makefile.am: include it in dist
      d5ef0a69
    • J
      Adds CPU selection infrastructure · 7286882c
      Jiri Denemark 提交于
      Each driver supporting CPU selection must fill in host CPU capabilities.
      When filling them, drivers for hypervisors running on the same node as
      libvirtd can use cpuNodeData() to obtain raw CPU data. Other drivers,
      such as VMware, need to implement their own way of getting such data.
      Raw data can be decoded into virCPUDefPtr using cpuDecode() function.
      
      When implementing virConnectCompareCPU(), a hypervisor driver can just
      call cpuCompareXML() function with host CPU capabilities.
      
      For each guest for which a driver supports selecting CPU models, it must
      set the appropriate feature in guest's capabilities:
      
          virCapabilitiesAddGuestFeature(guest, "cpuselection", 1, 0)
      
      Actions needed when a domain is being created depend on whether the
      hypervisor understands raw CPU data (currently CPUID for i686, x86_64
      architectures) or symbolic names has to be used.
      
      Typical use by hypervisors which prefer CPUID (such as VMware and Xen):
      
      - convert guest CPU configuration from domain's XML into a set of raw
        data structures each representing one of the feature policies:
      
          cpuEncode(conn, architecture, guest_cpu_config,
                    &forced_data, &required_data, &optional_data,
                    &disabled_data, &forbidden_data)
      
      - create a mask or whatever the hypervisor expects to see and pass it
        to the hypervisor
      
      Typical use by hypervisors with symbolic model names (such as QEMU):
      
      - get raw CPU data for a computed guest CPU:
      
          cpuGuestData(conn, host_cpu, guest_cpu_config, &data)
      
      - decode raw data into virCPUDefPtr with a possible restriction on
        allowed model names:
      
          cpuDecode(conn, guest, data, n_allowed_models, allowed_models)
      
      - pass guest->model and guest->features to the hypervisor
      
      * src/cpu/cpu.c src/cpu/cpu.h src/cpu/cpu_generic.c
        src/cpu/cpu_generic.h src/cpu/cpu_map.c src/cpu/cpu_map.h
        src/cpu/cpu_x86.c src/cpu/cpu_x86.h src/cpu/cpu_x86_data.h
      * configure.in: check for CPUID instruction
      * src/Makefile.am: glue the new files in
      * src/libvirt_private.syms: add new private symbols
      * po/POTFILES.in: add new cpu files containing translatable strings
      7286882c
    • J
      Remote driver CPU flags support · e1042693
      Jiri Denemark 提交于
      * src/remote/remote_driver.c: add the new entry point
      e1042693
    • J
      CPU flags wire protocol format and server side · 3a2881fa
      Jiri Denemark 提交于
      * src/remote/remote_protocol.x: update with new entry point
      * daemon/remote.c: add the new server dispatcher
      * daemon/remote_dispatch_args.h daemon/remote_dispatch_prototypes.h
        daemon/remote_dispatch_ret.h daemon/remote_dispatch_table.h
        src/remote/remote_protocol.c src/remote/remote_protocol.h: regenerated
      3a2881fa
    • J
      Public API implementation · 0b7d2ae6
      Jiri Denemark 提交于
      * src/libvirt.c: adds the public entry point virConnectCompareCPU()
      0b7d2ae6
    • J
      Adds the internal driver API · 16e4084a
      Jiri Denemark 提交于
      * src/driver.h: add an extra entry point in the structure
      * src/esx/esx_driver.c src/lxc/lxc_driver.c src/opennebula/one_driver.c
        src/openvz/openvz_driver.c src/phyp/phyp_driver.c src/qemu/qemu_driver.c
        src/remote/remote_driver.c src/test/test_driver.c src/uml/uml_driver.c
        src/vbox/vbox_tmpl.c src/xen/xen_driver.c: add NULL entry points for
        all drivers
      16e4084a
    • J
      New public API definition virConnectCompareCPU() · a44dc266
      Jiri Denemark 提交于
      * include/libvirt/libvirt.h.in: add it in the public API as
        well as the new flags
      * src/libvirt_public.syms: export it
      a44dc266
    • D
      Fixes syntax-check with previous commit · c7c42a85
      Daniel Veillard 提交于
      * po/POTFILES.in: adds src/conf/cpu_conf.c in teh set of files with
        translatable content
      * src/conf/cpu_conf.c: remove an unused include
      c7c42a85
    • J
      XML parsing/formating code for CPU flags · 6695818c
      Jiri Denemark 提交于
      * include/libvirt/virterror.h src/util/virterror.c: add new domain
        VIR_FROM_CPU for errors
      * src/conf/cpu_conf.c src/conf/cpu_conf.h: new parsing module
      * src/Makefile.am proxy/Makefile.am: include new files
      * src/conf/capabilities.[ch] src/conf/domain_conf.[ch]: reference
        new code
      * src/libvirt_private.syms: private export of new entry points
      6695818c
    • D
      Initialize gcrypt threading · 33a198c1
      Daniel P. Berrange 提交于
      GNUTLS uses gcrypt for its crypto functions. gcrypt requires
      that the app/library initializes threading before using it.
      We don't want to force apps using libvirt to know about
      gcrypt, so we make virInitialize init threading on their
      behalf. This location also ensures libvirtd has initialized
      it correctly. This initialization is required even if libvirt
      itself were only using one thread, since another non-libvirt
      library (eg GTK-VNC) could also be using gcrypt from another
      thread
      
      * src/libvirt.c: Register thread functions for gcrypt
      * configure.in: Add -lgcrypt to linker flags
      33a198c1
    • D
      Fix bug in storage driver accessing wrong private data · 84961bd3
      Daniel P. Berrange 提交于
      * src/storage/storage_driver.c: Fix IsPersistent() and IsActivE()
        methods on storage pools to use 'storagePrivateData' instead
        of 'privateData'. Also fix naming convention of objects
      84961bd3
  2. 16 12月, 2009 7 次提交
  3. 15 12月, 2009 4 次提交
  4. 14 12月, 2009 15 次提交
    • J
      node_device_driver.c: don't write beyond EOB for 4K-byte symlink · b1483189
      Jim Meyering 提交于
      * src/node_device/node_device_driver.c (update_driver_name): The
      previous code would write one byte beyond the end of the 4KiB
      stack buffer when presented with a symlink value of exactly that
      length (very unlikely).  Remove the automatic buffer and use
      virFileResolveLink in place of readlink.  Suggested by Daniel Veillard.
      b1483189
    • L
      Eliminate failure to delete empty storage pools · 22f3ec27
      Laine Stump 提交于
      * src/storage/storage_backend_fs.c: virStorageBackendFileSystemDelete
        was incorrectly calling unlink() in an attempt to remove a directory.
        It should be calling rmdir() instead.
      22f3ec27
    • J
      Fix use of virEventAddHandleImpl() · a645c8f0
      Jiri Denemark 提交于
      src/node_device/node_device_udev.c was using a function available only
      on the daemon code, fix this and use the function available globally
      
      * src/node_device/node_device_udev.c: replace use of virEventAddHandleImpl
        by virEventAddHandle
      a645c8f0
    • M
      Cleanup temporary #define after use · 057ad3a2
      Matthew Booth 提交于
      * src/qemu/qemu_driver.c: #undef LOOKUP_PTYS after use in
        qemudFindCharDevicePTYsMonitor()
      057ad3a2
    • C
      nodedev: Add removable storage 'media_label' prop · deae2bb5
      Cole Robinson 提交于
      Provides the CDROM label for current media. Only implemented for the
      udev backend.
      deae2bb5
    • D
      expose SR IOV physical/virtual function relationships · a010165d
      Dave Allan 提交于
      exposes the relationships between physical
      and virtual functions on SR IOV capable devices.
      a010165d
    • P
      Fix possible NULL pointer dereference · 921d2225
      Paolo Bonzini 提交于
      If there are no references remaining to the object, vm is set to NULL
      and vm->persistent cannot be accessed.  Fixed by this trivial patch.
      
      * src/qemu/qemu_driver.c (qemudDomainCoreDump): Avoid possible
        NULL pointer dereference on --crash dump.
      921d2225
    • P
      add --live support to "virsh dump" · 1fb7af40
      Paolo Bonzini 提交于
      This is trivial for QEMU since you just have to not stop the vm before
      starting the dump.  And for Xen, you just pass the flag down to xend.
      
      * include/libvirt/libvirt.h.in (virDomainCoreDumpFlags): Add VIR_DUMP_LIVE.
      * src/qemu/qemu_driver.c (qemudDomainCoreDump): Support live dumping.
      * src/xen/xend_internal.c (xenDaemonDomainCoreDump): Support live dumping.
      * tools/virsh.c (opts_dump): Add --live. (cmdDump): Map it to VIR_DUMP_LIVE.
      1fb7af40
    • P
      add --crash support to "virsh dump" · b927aed8
      Paolo Bonzini 提交于
      This patch adds the --crash option (already present in "xm dump-core")
      to "virsh dump".  virDomainCoreDump already has a flags argument, so
      the API/ABI is untouched.
      
      * include/libvirt/libvirt.h.in (virDomainCoreDumpFlags): New flag for
        CoreDump
      * src/test/test_driver.c (testDomainCoreDump): Do not crash
        after dump unless VIR_DUMP_CRASH is given.
      * src/qemu/qemu_driver.c (qemudDomainCoreDump): Shutdown the domain
        instead of restarting it if --crash is passed.
      * src/xen/xend_internal.c (xenDaemonDomainCoreDump): Support --crash.
      * tools/virsh.c (opts_dump): Add --crash.
        (cmdDump): Map it to flags for virDomainCoreDump and pass them.
      b927aed8
    • P
      fix various breakages in qemu Dump command · f509e162
      Paolo Bonzini 提交于
      1) qemuMigrateToCommand uses ">>" so we have to truncate the file
      before starting the migration;
      
      2) the command wasn't updated to chown the driver and set/restore
      the security lavels;
      
      3) the VM does not have to be resumed if migration fails;
      
      4) the file is not removed when migration fails.
      
      * src/qemu/qemu_driver.c (qemuDomainCoreDump): Truncate file before
        dumping, set/restore ownership and security labels for the file.
      f509e162
    • D
      Fix a couple of problems in last patch · a7d1eb3c
      Daniel Veillard 提交于
      Those were pointed by DanB in his review but not yet fixed
      
      * src/qemu/qemu_driver.c: qemudWaitForMonitor() use EnterMonitorWithDriver()
        and ExitMonitorWithDriver() there
      * src/qemu/qemu_monitor_text.c: checking fro strdu failure and hash
        table add error in qemuMonitorTextGetPtyPaths()
      a7d1eb3c
    • M
      Get QEMU pty paths from the monitor · 60e8977f
      Matthew Booth 提交于
      This change makes the QEMU driver get pty paths from the output of the
      monitor 'info chardev' command. This output is structured, and contains
      both the name of the device and the path on the same line. This is
      considerably more reliable than parsing the startup log output, which
      requires the parsing code to know which order QEMU will print pty
      information in.
      
      Note that we still need to parse the log output as the monitor itself
      may be on a pty. This should be rare, however, and the new code will
      replace all pty paths parsed by the log output method once the monitor
      is available.
      
      * src/qemu/qemu_monitor.(c|h) src/qemu_monitor_text.(c|h): Implement
        qemuMonitorGetPtyPaths().
      * src/qemu/qemu_driver.c: Get pty path information using
        qemuMonitorGetPtyPaths().
      60e8977f
    • M
      Extract the assigned pty device for QEmu channels · 033eef43
      Matthew Booth 提交于
      * src/qemu/qemu_driver.c: Parse pty devices for channels
      033eef43
    • M
      Make QEMU driver use -chardev everywhere if available · a8eb010e
      Matthew Booth 提交于
      Change -monitor, -serial and -parallel output to use -chardev if it is
      available.
      * src/qemu/qemu_conf.c: Update qemudBuildCommandLine to use -chardev where
        available.
      * tests/qemuxml2argvtest.c tests/qemuxml2argvdata/: Add -chardev equivalents
        for all current serial and parallel tests.
      a8eb010e
    • R
      Suppress cgroup error message on sucess startup · 2597f8ec
      Ryota Ozaki 提交于
      Even if qemudStartVMDaemon suceeds, an error was logged such as
      'qemuRemoveCgroup:1778 : internal error Unable to find cgroup for'.
      This is because qemudStartVMDaemon calls qemuRemoveCgroup to
      ensure that old cgroup does not remain. This workaround makes
      sense but leaving an error message may confuse users.
      * src/qemu/qemu_driver.c: a an option to the function to suppress the
        error being logged
      2597f8ec
  5. 11 12月, 2009 3 次提交
    • M
      Fix memory leak in virStorageBackendCopyToFD · 27ba0ad9
      Matthias Bolte 提交于
      27ba0ad9
    • P
      retrieve paused/running state at migration start · 5de41c06
      Paolo Bonzini 提交于
      This patch fixes the bug where paused/running state is not
      transmitted during migration.  As a result, in the QEMU driver
      for example the machine was always started on the destination
      end.
      
      In order to do so, just read the state and if it is appropriate and
      set the VIR_MIGRATE_PAUSED flag.
      
      * src/libvirt.c (virDomainMigrateVersion1, virDomainMigrateVersion2):
        Automatically add VIR_MIGRATE_PAUSED when appropriate.
      * src/xen/xend_internal.c (xenDaemonDomainMigratePerform): Give a nicer
        error message when migration of paused domains is attempted.
      5de41c06
    • P
      add virsh --suspend arg to migrate command · edc9e78b
      Paolo Bonzini 提交于
      This adds a new flag, VIR_MIGRATE_PAUSED, that mandates pausing
      the migrated VM before starting it.
      
      * include/libvirt/libvirt.h.in (virDomainMigrateFlags): Add VIR_MIGRATE_PAUSED.
      * src/qemu/qemu_driver.c (qemudDomainMigrateFinish2): Handle VIR_MIGRATE_PAUSED.
      * tools/virsh.c (opts_migrate): Add --suspend. (cmdMigrate): Handle it.
      * tools/virsh.pod (migrate): Document it.
      edc9e78b