1. 03 3月, 2010 3 次提交
    • D
      Add QEMU driver support for job info on migration ops · 0d3eee7f
      Daniel P. Berrange 提交于
      Introduce support for  virDomainGetJobInfo in the QEMU driver. This
      allows for monitoring of any API that uses the 'info migrate' monitor
      command. ie virDomainMigrate, virDomainSave and virDomainCoreDump
      
      Unfortunately QEMU does not provide a way to monitor incoming migration
      so we can't wire up virDomainRestore yet.
      
      The virsh tool gets a new command 'domjobinfo' to query status
      
      * src/qemu/qemu_driver.c: Record virDomainJobInfo and start time
        in qemuDomainObjPrivatePtr objects. Add generic shared handler
        for calling 'info migrate' with all migration based APIs.
      * src/qemu/qemu_monitor_text.c: Fix parsing of 'info migration' reply
      * tools/virsh.c: add new 'domjobinfo' command to query progress
      0d3eee7f
    • D
      Remote driver implmentation of job info API · b85a5340
      Daniel P. Berrange 提交于
      * src/remote/remote_protocol.x: Define wire protocol format
        for virDomainGetJobInfo API
      * src/remote/remote_driver.c, daemon/remote.c: Implement client
        and server marshalling code for virDomainGetJobInfo()
      * 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: Rebuild
        files from src/remote/remote_protocol.x
      b85a5340
    • D
      Stub out internal driver entry points for job processing · 92bd859a
      Daniel P. Berrange 提交于
      The internal glue layer for the new pubic API
      
      * src/driver.h: Define internal driver API contract
      * src/libvirt.c, src/libvirt_public.syms: Wire up public
        API to internal driver API
      * 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: Stub new entry point
      92bd859a
  2. 02 3月, 2010 15 次提交
    • E
      build: silence coverity warning in node_device · 84ef5aec
      Eric Blake 提交于
      All other uses of get_str_prop in this file that ignored
      failure explicitly cast to void.
      
      * src/node_device/node_device_hal.c (dev_create): Silence coverity
      warning.
      84ef5aec
    • R
      Fix error messages when parsing USB devices in QEMU · bc0f737d
      Rolf Eike Beer 提交于
      A number of the error messages raised when parsing USB devices
      refered to PCI devices by mistake
      
      * src/qemu/qemu_conf.c: s/PCI/USB/ in qemuParseCommandLineUSB()
      bc0f737d
    • R
      Fix USB hotplug device string in QEMU driver · 06973f70
      Rolf Eike Beer 提交于
      The USB hotplug method was mistakenly generating a PCI address
      string
      
      * src/qemu/qemu_driver.c: Fix USB hotplug device string
      06973f70
    • W
      Use device_del to remove SCSI controllers · 8540dadb
      Wolfgang Mauerer 提交于
      when the underlying qemu supports the drive/device model and the
      controller has been added this way.
      * src/qemu/qemu_driver.c: use qemuMonitorDelDevice() when detaching
        PCI controller and if supported
      * src/qemu/qemu_monitor.[ch]: add new qemuMonitorDelDevice() function
      * src/qemu/qemu_monitor_json.[ch]: JSON backend for DelDevice command
      * src/qemu/qemu_monitor_text.[ch]: Text backend for DelDevice command
      8540dadb
    • W
      Fix PCI address handling when controllers are deleted · 55946f23
      Wolfgang Mauerer 提交于
      * src/qemu/qemu_driver.c: in qemudDomainDetachPciControllerDevice()
        when a controller is not present in the system anymore, the PCI
        address must be deleted from libvirt's hashtable because it can
        be re-used for other purposes.
      55946f23
    • W
      Fix data structure handling when controllers are attached · 24cc058e
      Wolfgang Mauerer 提交于
      * src/qemu/qemu_driver.c: in qemudDomainAttachDevice(), one must not
        delete the data part when the operation succeeds because it is
        required later on. The correct pattern to handlethe parsed
        representation of the device information on success
        is dev->data.controller = NULL; virDomainDeviceDefFree(dev);,
        which leaves the structure pointed at by data in memory.
      24cc058e
    • W
      Tiny spelling fix · 553447ac
      Wolfgang Mauerer 提交于
      553447ac
    • J
      x86Decode: avoid NULL-dereference upon questionable input · e749d776
      Jim Meyering 提交于
      * src/cpu/cpu_x86.c (x86Decode): Don't dereference NULL when passed
      a NULL "models" pointer, or when passed a nonzero "nmodels" value
      and a corresponding NULL models[i].
      e749d776
    • J
      phypUUIDTable_Push: do not corrupt output stream upon partial write · 23e93d95
      Jim Meyering 提交于
      * src/phyp/phyp_driver.c (phypUUIDTable_Push): Move incr/decr
      of ptr/nread into the loop where those variables are used.
      Also, remove "exit" label and just-preceding "goto".
      23e93d95
    • J
      openvzDomainDefineCmd: remove useless increment · 77d118b4
      Jim Meyering 提交于
      * src/openvz/openvz_driver.c (openvzDomainDefineCmd): Remove
      useless increment of "max_veid".
      77d118b4
    • D
      Allow configurable timezones with QEMU · 74042b8f
      Daniel P. Berrange 提交于
      Allow an arbitrary timezone with QEMU by setting the $TZ environment
      variable when launching QEMU
      
      * src/qemu/qemu_conf.c: Set TZ environment variable if a timezone
        is requested
      * tests/qemuxml2argvtest.c: Add test case for timezones
      * tests/qemuxml2argvdata/qemuxml2argv-clock-france.xml,
        tests/qemuxml2argvdata/qemuxml2argv-clock-france.args: Data
        for timezone tests
      74042b8f
    • D
      Allow a timezone to be specified instead of sync to host timezone · e4d7433e
      Daniel P. Berrange 提交于
      This extends the XML to allow for
      
        <clock offset='timezone' timezone='Europe/Paris'/>
      
      This is useful if the admin has not configured any timezone on the
      host OS, but still wants to synchronize a guest to a specific one.
      
      * src/conf/domain_conf.h, src/conf/domain_conf.c: Support extra
        'timezone' attribute on clock configuration
      * docs/schemas/domain.rng: Add 'timezone' attribute
      * src/xen/xend_internal.c, src/xen/xm_internal.c: Reject configs
        with a configurable timezone
      e4d7433e
    • D
      Support variable clock offset mode in QEMU · 200c83b2
      Daniel P. Berrange 提交于
      This allows QEMU guests to be started with an arbitrary clock
      offset
      
      The test case can't actually be enabled, since QEMU argv expects
      an absolute timestring, and this will obviously change every
      time the test runs :-( Hopefully QEMU will allow a relative
      time offset in the future.
      
      * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Use the -rtc arg
        if available to support variable clock offset mode
      * tests/qemuhelptest.c: Add QEMUD_CMD_FLAG_RTC for qemu 0.12.1
      * qemuxml2argvdata/qemuxml2argv-clock-variable.args,
        qemuxml2argvdata/qemuxml2argv-clock-variable.xml,
        qemuxml2argvtest.c: Test case, except we can't actually enable
        it yet.
      200c83b2
    • D
      Add new clock mode allowing variable adjustments · b9e2967a
      Daniel P. Berrange 提交于
      This introduces a third option for clock offset synchronization,
      that allows an arbitrary / variable adjustment to be set. In
      essence the XML contains the time delta in seconds, relative to
      UTC.
      
        <clock offset='variable' adjustment='123465'/>
      
      The difference from 'utc' mode, is that management apps should
      track adjustments and preserve them at next reboot.
      
      * docs/schemas/domain.rng: Schema for new clock mode
      * src/conf/domain_conf.c, src/conf/domain_conf.h: Parse
        new clock time delta
      * src/libvirt_private.syms, src/util/xml.c, src/util/xml.h: Add
        virXPathLongLong() method
      b9e2967a
    • D
      Change the internal domain conf representation of localtime/utc · eed2f8c3
      Daniel P. Berrange 提交于
      The XML will soon be extended to allow more than just a simple
      localtime/utc boolean flag. This change replaces the plain
      'int localtime' with a separate struct to prepare for future
      extension
      
      * src/conf/domain_conf.c, src/conf/domain_conf.h: Add a new
        virDomainClockDef structure
      * src/libvirt_private.syms: Export virDomainClockOffsetTypeToString
        and virDomainClockOffsetTypeFromString
      * src/qemu/qemu_conf.c, src/vbox/vbox_tmpl.c, src/xen/xend_internal.c,
        src/xen/xm_internal.c: Updated to use new structure for localtime
      eed2f8c3
  3. 01 3月, 2010 4 次提交
  4. 26 2月, 2010 6 次提交
  5. 25 2月, 2010 1 次提交
    • R
      Ignore SIGWINCH in remote client call to poll(2) (RHBZ#567931). · f4a43df5
      Richard Jones 提交于
      In bug 567931 we found that virt-top would exit occasionally
      when the terminal window was resized.  Tracking this down it
      turned out that SIGWINCH was being delivered to the process at
      exactly the point where the libvirt remote driver was calling
      poll(2) waiting for a reply from libvirtd.
      
      This caused the poll(2) call to be interrupted (returning errno
      EINTR).  However handling EINTR the same way as EAGAIN was not
      the solution to this problem since we found previously that this
      would break Ctrl-C handling (commit 47fec8ea).
      
      The correct solution is to mask out SIGWINCH for the duration
      of the poll(2) system call.  The per-thread mask is changed and
      restored immediately after the call.  Since we are using
      pthread_sigmask, this should not affect other threads, and
      since we restore the signal mask immediately afterwards it should
      not affect the current thread visibly either.  Other possibly
      problematic signals are SIGCHLD and SIGPIPE and these are
      masked too.
      
      Note use of ignore_value: It's not fatal if we cannot mask out
      SIGWINCH, and in any case pthread_sigmask never fails on Linux
      as long as you supply the correct arguments.
      
      I tested this patch and it cures the original problem with
      virt-top.
      f4a43df5
  6. 24 2月, 2010 2 次提交
  7. 23 2月, 2010 1 次提交
    • C
      storage: conf: Correctly calculate exabyte unit · 67b44811
      Cole Robinson 提交于
      We were using 'Y' to mean exabyte, when the correct abbreviation would be
      'E' ('Y' is yettabyte, which is exabyte * 1024 * 1024). While it isn't
      strictly backwards compatible, I highly doubt anyone was actually using
      this broken behavior, so I don't see any harm in in dropping 'Y' handling.
      67b44811
  8. 22 2月, 2010 1 次提交
    • J
      Create raw storage files with O_DSYNC (again) · 9568c1d9
      Jiri Denemark 提交于
      Recently we introduced O_DSYNC flag when creating raw storage files to
      avoid filling all disk cache with dirty pages. However, the patch got
      lost when virStorageBackendCreateRaw was reworked using
      virFileOperation. Let's use O_DSYNC again.
      9568c1d9
  9. 20 2月, 2010 4 次提交
    • J
      virBufferVSprintf: do not omit va_end(argptr) call · 72919f3d
      Jim Meyering 提交于
      * src/util/buf.c (virBufferVSprintf): Do not omit va_end(argptr).
      Improved-by: Daniel Veillard.
      72919f3d
    • J
      xend_internal.c: don't dereference NULL for unexpected input · 14ee6a66
      Jim Meyering 提交于
      * src/xen/xend_internal.c (xenDaemonDomainSetAutostart): Avoid a NULL
      dereference upon non-SEXPR_VALUE'd on_xend_start.  This bug was
      introduced by commit 37ce5600.
      14ee6a66
    • L
      Use virFileOperation hook function in virStorageBackendFileSystemVolBuild · 6ef20bb7
      Laine Stump 提交于
      There were a few operations on the storage volume file that were still
      being done as root, which will fail if the file is on a root-squashed
      NFS share. The result was that attempts to create a storage volume of
      type "raw" on a root-squashed NFS share would fail.
      
      This patch uses the newly introduced "hook" function in
      virFileOperation to execute all those file operations in the child
      process that's run under the uid that owns the file (and, presumably,
      has permission to write to the NFS share)
      
      * src/storage/storage_backend.c: use virFileOperation() in
        virStorageBackendCreateRaw, turning virStorageBackendCreateRaw()
        into a new createRawFileOpHook() hook
      6ef20bb7
    • L
      Rename virFileCreate to virFileOperation, add hook function · fbadc2b6
      Laine Stump 提交于
      It turns out it is also useful to be able to perform other operations
      on a file created while running as a different uid (eg, write things
      to that file), and possibly to do this to a file that already
      exists. This patch adds an optional hook function to the renamed (for
      more accuracy of purpose) virFileOperation; the hook will be called
      after the file has been opened (possibly created) and gid/mode
      checked/set, before closing it.
      
      As with the other operations on the file, if the VIR_FILE_OP_AS_UID
      flag is set, this hook function will be called in the context of a
      child process forked from the process that called virFileOperation.
      The implication here is that, while all data in memory is available to
      this hook function, any modification to that data will not be seen by
      the caller - the only indication in memory of what happened in the
      hook will be the return value (which the hook should set to 0 on
      success, or one of the standard errno values on failure).
      
      Another piece of making the function more flexible was to add an
      "openflags" argument. This arg should contain exactly the flags to be
      passed to open(2), eg O_RDWR | O_EXCL, etc.
      
      In the process of adding the hook to virFileOperation, I also realized
      that the bits to fix up file owner/group/mode settings after creation
      were being done in the parent process, which could fail, so I moved
      them to the child process where they should be.
      
      * src/util/util.[ch]: rename and rework virFileCreate-->virFileOperation,
        and redo flags in virDirCreate
      * storage/storage_backend.c, storage/storage_backend_fs.c: update the
        calls to virFileOperation/virDirCreate to reflect changes in the API,
        but don't yet take advantage of the hook.
      fbadc2b6
  10. 19 2月, 2010 3 次提交