1. 24 5月, 2011 4 次提交
    • D
      Fix peer2peer migration with transient VMs · 65e1acad
      Daniel P. Berrange 提交于
      The qemuMigrationConfirm method shouldn't deal with final VM
      cleanup, since it can be called from the peer2peer migration,
      which expects to still use the 'vm' object afterwards.
      
      Push the cleanup code out of qemuMigrationConfirm, into its
      caller, qemuDomainMigrateConfirm3
      
      * src/qemu/qemu_driver.c: Add VM cleanup code to
        qemuDomainMigrateConfirm3
      * src/qemu/qemu_migration.c, src/qemu/qemu_migration.h: Remove
        job handling cleanup from qemuMigrationConfirm
      65e1acad
    • D
      Perform feature flag compat checking in QEMU migration cookies · f88af9dc
      Daniel P. Berrange 提交于
      To allow new mandatory migration cookie data to be introduced,
      add support for checking supported feature flags when parsing
      migration cookie.
      
      * src/qemu/qemu_migration.c: Feature flag checking in migration
        cookie parsing
      f88af9dc
    • A
      spice: support streaming-video parameter · bb1c5423
      Alon Levy 提交于
      This adds a streaming-video=filter|all|off attribute. It is used to change
      the behavior of video stream detection in spice, the default is filter (the
      default for libvirt is not to specify it - the actual default is defined in
      libspice-server.so).
      
      Usage:
      
          <graphics type='spice' autoport='yes'>
            <streaming mode='off'/>
          </graphics>
      
      Tested with the above and with tests/qemuxml2argvtest.
      Signed-off-by: NAlon Levy <alevy@redhat.com>
      bb1c5423
    • L
      qemu: don't require is_kvm for vhost-net support · 17266c5c
      Laine Stump 提交于
      This was discussed in:
      
        https://www.redhat.com/archives/libvir-list/2011-May/msg01370.html
      
      The capabilities code only sets the flag to allow use of vhost-net if
      kvm is detected (set if the help string contains "(qemu-kvm-" or
      "(kvm-"), but actually vhost-net is available in some qemu builds that
      don't have kvm in their name, so just checking for ",vhost=" is enough.
      17266c5c
  2. 20 5月, 2011 1 次提交
  3. 19 5月, 2011 4 次提交
    • D
      Don't generate cookies with v2 migration protocol. · 6b937b24
      Daniel P. Berrange 提交于
      The v2 migration protocol had a limit on cookie length that was
      too small to be useful for QEMU. Avoid generating cookies with
      v2 protocol, so that old libvirtd can still reliably migrate a
      guest to new libvirtd uses v2 protocol.
      
      * src/qemu/qemu_driver.c: Avoid migration cookies with v2
        migration
      6b937b24
    • D
      Fix QEMU migration cookie crash for guests with no graphics · 03f88326
      Daniel P. Berrange 提交于
      When generating a cookie for a guest with no data, the
      QEMU_MIGRATION_COOKIE_GRAPHICS flag was set even if no
      graphics data was added. Avoid setting the flag unless
      it was needed, also add a safety check for mig->graphics
      being non-NULL
      
      * src/qemu/qemu_migration.c: Avoid cookie crash for guest
        with no graphics
      03f88326
    • M
      Clarify that virDomainGet(Memory|Blkio)Parameters doesn't support subsets · 191e1ec6
      Matthias Bolte 提交于
      Improve invalid argument checks in the size query case. The drivers already
      relied on this unchecked behavior.
      
      Relax the implementation of virDomainGet(Memory|Blkio)MemoryParameters
      in the drivers and allow to pass more memory than necessary for all
      parameters.
      191e1ec6
    • M
      Clarify the semantic of virDomainGetSchedulerParameters arguments · e430c0d0
      Matthias Bolte 提交于
      params and nparams are essential and cannot be NULL. Check this in
      libvirt.c and remove redundant checks from the drivers (e.g. xend).
      
      Instead of enforcing that nparams must point to exact same value as
      returned by virDomainGetSchedulerType relax this to a lower bound
      check. This is what some drivers (e.g. xen hypervisor and esx)
      already did. Other drivers (e.g. xend) didn't check nparams at all
      and assumed that there is enough space in params.
      
      Unify the behavior in all drivers to a lower bound check and update
      nparams to the number of valid values in params on success.
      e430c0d0
  4. 18 5月, 2011 2 次提交
  5. 16 5月, 2011 21 次提交
    • D
      Add missing initialization to 'ret' in qemu migration · 6e7c56f8
      Daniel P. Berrange 提交于
      * src/qemu/qemu_migration.c: Add missing 'ret' initializer
        in qemuMigrationCookieXMLParseStr
      6e7c56f8
    • D
      Run tunnelled migration IO in separate thread · 1d916a60
      Daniel P. Berrange 提交于
      By running the doTunnelSendAll code in a separate thread, the
      main thread can do qemuMigrationWaitForCompletion as with
      normal migration. This in turn ensures that job signals work
      correctly and that progress monitoring can be done
      
      * src/qemu/qemu_migration.c: Run tunnelled migration in
        separate thread
      1d916a60
    • D
      Don't overwrite error when stream send fails · 5a6ca96a
      Daniel P. Berrange 提交于
      virStreamSend already sets an error message, so don't
      overwrite it
      
      * src/qemu/qemu_migration.c: Remove bogus error report
      5a6ca96a
    • D
      Close all sockets before cancelling QEMU migration · 2bf92bb8
      Daniel P. Berrange 提交于
      Cancelling the QEMU migration may cause QEMU to flush pending
      data on the migration socket. This may in turn block QEMU if
      nothing reads from the other end of the socket. Closing the
      socket before cancelling QEMU migration avoids this possible
      deadlock.
      
      * src/qemu/qemu_migration.c: Close sockets before cancelling
        migration on failure
      2bf92bb8
    • D
      Ensure we always read a full buffer in tunnelled migration · 74f33246
      Daniel P. Berrange 提交于
      The 'nbytes' variable was not re-initialized to the
      buffer size on each iteration of the tunnelled migration
      loop. While saferead() will ensure a full read, except
      on EOF, it is clearer to use the real buffer size
      
      * src/qemu/qemu_migration.c: Always read full buffer of data
      74f33246
    • D
      Make tunnelled migration honour resource restriction · dba5a604
      Daniel P. Berrange 提交于
      The doTunnelMigrate method forgot to set the bandwidth
      resource restriction
      
      * src/qemu/qemu_migration.c: Set resource restriction
      dba5a604
    • D
      Refactor migration completion loop to allow code reuse · 792a5a61
      Daniel P. Berrange 提交于
      The qemuMigrationWaitForCompletion method contains a loop which
      repeatedly queries QEMU to check migration progress, and also
      processes job signals (pause, setspeed, setbandwidth, cancel).
      
      The tunnelled migration loop does not currently support this
      functionality, but should. Refactor the code to allow it to
      be used with tunnelled migration.
      792a5a61
    • D
      Implement migration v3 protocol in QEMU driver · 2d5caf7a
      Daniel P. Berrange 提交于
      Implement the v3 migration protocol, which has two extra
      steps, 'begin' on the source host and 'confirm' on the
      source host. All other methods also gain both input and
      output cookies to allow bi-directional data passing at
      all stages.
      
      The QEMU peer2peer migration method gains another impl
      to provide the v3 migration. This finally allows migration
      cookies to work with tunnelled migration, which is required
      for Spice seamless migration & the lock manager transfer
      
      * src/qemu/qemu_driver.c: Wire up migrate v3 APIs
      * src/qemu/qemu_migration.c, src/qemu/qemu_migration.h: Add
        begin & confirm methods, and peer2peer impl of v3
      2d5caf7a
    • D
      Merge tunnel & non-tunnel migration impl into one · 636ee926
      Daniel P. Berrange 提交于
      Merge the doNonTunnelMigrate2 and doTunnelMigrate2 methods
      into one doPeer2PeerMigrate2 method, since they are substantially
      the same. With the introduction of v3 migration, this will be
      even more important, to avoid massive code duplication.
      
      * src/qemu/qemu_migration.c: Merge tunnel & non-tunnel migration
      636ee926
    • D
      Refactor tunnelled migration methods · 13cb49f8
      Daniel P. Berrange 提交于
      To facilitate the introduction of the v3 migration protocol,
      the doTunnelMigrate method is refactored into two pieces. One
      piece is intended to mirror the flow of virDomainMigrateVersion2,
      while the other is the helper for setting up sockets and processing
      the data.
      
      Previously socket setup would be done before the 'prepare' step,
      so errors could be dealt with immediately, avoiding need to shut
      off the destination QEMU. In the new split, socket setup is done
      after the 'prepare' step. This is not a serious problem, since
      the control flow already requires calling 'finish' to tear down
      the destination QEMU upon several errors.
      
      * src/qemu/qemu_migration.c:
      13cb49f8
    • D
      Wire up SPICE client relocation with QEMU migration · cc53b4c4
      Daniel P. Berrange 提交于
      Use the graphics information from the QEMU migration cookie to
      issue a 'client_migrate_info' monitor command to QEMU. This causes
      the SPICE client to automatically reconnect to the target host
      when migration completes
      
      * src/qemu/qemu_migration.c: Set data for SPICE client relocation
        before starting migration on src
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
        src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add
        new qemuMonitorGraphicsRelocate() command
      cc53b4c4
    • D
      Pass graphics setup from dst back to src via migration cookies · 72de0d28
      Daniel P. Berrange 提交于
      Extend the QEMU migration cookie structure to allow information
      about the destination host graphics setup to be passed by to
      the source host. This will enable seamless migration of any
      connected graphics clients
      
      * src/qemu/qemu_migration.c: Add graphics info to migration
        cookies
      * daemon/libvirtd.c: Always initialize gnutls to enable
        x509 cert parsing in QEMU
      72de0d28
    • D
      Introduce migration cookies to QEMU driver · 8654175c
      Daniel P. Berrange 提交于
      The migration protocol has support for a 'cookie' parameter which
      is an opaque array of bytes as far as libvirt is concerned. Drivers
      may use this for passing around arbitrary extra data they might
      need during migration. The QEMU driver needs to do a few things:
      
       - Pass hostname/uuid to allow strict protection against localhost
         migration attempts
       - Pass SPICE/VNC server port from the target back to the source to
         allow seamless relocation of client sessions
       - Pass lock driver state from source to destination
      
      This patch introduces the basic glue for handling cookies
      but only includes the host/guest UUID & name.
      
      * src/libvirt_private.syms: Export virXMLParseStrHelper
      * src/qemu/qemu_migration.c, src/qemu/qemu_migration.h: Parsing
        and formatting of migration cookies
      * src/qemu/qemu_driver.c: Pass in cookie parameters where possible
      * src/remote/remote_protocol.h, src/remote/remote_protocol.x: Change
        cookie max length to 16384 bytes
      8654175c
    • D
      Fix locking with qemuMigrationPrepareTunnel method · 9ab24558
      Daniel P. Berrange 提交于
      The qemuMigrationPrepareTunnel method should not unlock the
      qemu driver, since that is the caller's job.
      
      * src/qemu/qemu_migration.c: Fix qemuMigrationPrepareTunnel
        unlocking of QEMU driver
      9ab24558
    • D
      Add many version number annotations to drivers · 9b1ae97f
      Daniel P. Berrange 提交于
      Add many version number annotations to the internal driver
      tables, to allow hvsupport.html to display more accurate
      information
      9b1ae97f
    • D
      Convert all driver struct intializers to C99 style · 879d409e
      Daniel P. Berrange 提交于
      Change all the driver struct initializers to use the
      C99 style, leaving out unused fields. This will make
      it possible to add new APIs without changing every
      driver. eg change:
      
          qemudDomainResume, /* domainResume */
          qemudDomainShutdown, /* domainShutdown */
          NULL, /* domainReboot */
          qemudDomainDestroy, /* domainDestroy */
      
      to
      
          .domainResume = qemudDomainResume,
          .domainShutdown = qemudDomainShutdown,
          .domainDestroy = qemudDomainDestroy,
      
      And get rid of any existing C99 style initializersr which
      set NULL, eg change
      
           .listPools          = vboxStorageListPools,
           .numOfDefinedPools  = NULL,
           .listDefinedPools   = NULL,
           .findPoolSources    = NULL,
           .poolLookupByName   = vboxStoragePoolLookupByName,
      
      to
      
           .listPools          = vboxStorageListPools,
           .poolLookupByName   = vboxStoragePoolLookupByName,
      879d409e
    • D
      Tweak driver naming for consistency with public API · 360df019
      Daniel P. Berrange 提交于
      Fix some driver names:
      
        s/virDrvCPUCompare/virDrvCompareCPU/
        s/virDrvCPUBaseline/virDrvBaselineCPU/
        s/virDrvQemuDomainMonitorCommand/virDrvDomainQemuMonitorCommand/
        s/virDrvSecretNumOfSecrets/virDrvNumOfSecrets/
        s/virDrvSecretListSecrets/virDrvListSecrets/
      
      And some driver struct field names:
      
        s/getFreeMemory/nodeGetFreeMemory/
      360df019
    • J
      qemu: Update domain state when reconnecting monitor · 9f131961
      Jiri Denemark 提交于
      A qemu domain can get paused when libvirtd is stopped (e.g., because of
      I/O error) so we should check its current state when reconnecting to it.
      9f131961
    • J
      Implement domain state reason · b046c55d
      Jiri Denemark 提交于
      Only in drivers which use virDomainObj, drivers that query hypervisor
      for domain status need to be updated separately in case their hypervisor
      supports this functionality.
      
      The reason is also saved into domain state XML so if a domain is not
      running (i.e., no state XML exists) the reason will be lost by libvirtd
      restart. I think this is an acceptable limitation.
      b046c55d
    • J
      Implement basic virDomainGetState in all drivers · 26d94012
      Jiri Denemark 提交于
      Reason is currently always set to 0 (i.e., *_UNKNOWN).
      26d94012
    • J
      Internal driver API for virDomainGetState · 6feb1341
      Jiri Denemark 提交于
      6feb1341
  6. 13 5月, 2011 5 次提交
    • C
      qemu: Use virDomainEventState helpers · 42a3687f
      Cole Robinson 提交于
      v2:
          Drop libvirt_private.syms changes
      
      v3:
          Adjust for new virDomainEventStateNew argument
      42a3687f
    • C
      xml: Make sure virXpathNodeSet always sets an error · 0571c3af
      Cole Robinson 提交于
      And update callers to actually respect the error
      0571c3af
    • M
      qemu: Implement the driver methods · 9936aecf
      Michal Privoznik 提交于
      * src/qemu/qemu_driver.c: new qemuDomainScreenshot() function
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
        src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h:
        Monitor command
      9936aecf
    • M
      virFDStream: Add option for delete file after it's opening · 6a1f5f56
      Michal Privoznik 提交于
      This is needed if we want to transfer a temporary file. If the
      transfer is done with iohelper, we might run into a race condition,
      where we unlink() file before iohelper is executed.
      
      * src/fdstream.c, src/fdstream.h,
        src/util/iohelper.c: Add new option
      * src/lxc/lxc_driver.c, src/qemu/qemu_driver.c,
        src/storage/storage_driver.c, src/uml/uml_driver.c,
        src/xen/xen_driver.c: Expand existing function calls
      6a1f5f56
    • M
      screenshot: Defining the internal API · 3c386643
      Michal Privoznik 提交于
      * src/driver.h: Stub code for new API
      * src/esx/esx_driver.c, src/libxl/libxl_driver.c,
        src/lxc/lxc_driver.c, src/openvz/openvz_driver.c,
        src/phyp/phyp_driver.c, src/qemu/qemu_driver.c,
        rc/remote/remote_driver.c, rc/test/test_driver.c,
        src/uml/uml_driver.c, src/vbox/vbox_tmpl.c,
        src/vmware/vmware_driver.c, src/xen/xen_driver.c,
        src/xen/xen_driver.h, src/xen/xen_hypervisor.c,
        src/xen/xen_inotify.c, src/xen/xend_internal.c,
        src/xen/xm_internal.c, src/xen/xs_internal.c,
        src/xenapi/xenapi_driver.c: Add dummy entries in driver
        table for new APIs
      3c386643
  7. 12 5月, 2011 3 次提交
    • E
      maint: omit translation for all VIR_INFO · cb84580a
      Eric Blake 提交于
      We were 31/73 on whether to translate; since less than 50% translated
      and since VIR_INFO is less than VIR_WARN which also doesn't translate,
      this makes sense.
      
      * cfg.mk (sc_prohibit_gettext_markup): Add VIR_INFO, since it
      falls between WARN and DEBUG.
      * daemon/libvirtd.c (qemudDispatchSignalEvent, remoteCheckAccess)
      (qemudDispatchServer): Adjust offenders.
      * daemon/remote.c (remoteDispatchAuthPolkit): Likewise.
      * src/network/bridge_driver.c (networkReloadIptablesRules)
      (networkStartNetworkDaemon, networkShutdownNetworkDaemon)
      (networkCreate, networkDefine, networkUndefine): Likewise.
      * src/qemu/qemu_driver.c (qemudDomainDefine)
      (qemudDomainUndefine): Likewise.
      * src/storage/storage_driver.c (storagePoolCreate)
      (storagePoolDefine, storagePoolUndefine, storagePoolStart)
      (storagePoolDestroy, storagePoolDelete, storageVolumeCreateXML)
      (storageVolumeCreateXMLFrom, storageVolumeDelete): Likewise.
      * src/util/bridge.c (brProbeVnetHdr): Likewise.
      * po/POTFILES.in: Drop src/util/bridge.c.
      cb84580a
    • L
      libvirt,logging: cleanup VIR_XXX0() · b65f37a4
      Lai Jiangshan 提交于
      These VIR_XXXX0 APIs make us confused, use the non-0-suffix APIs instead.
      
      How do these coversions works? The magic is using the gcc extension of ##.
      When __VA_ARGS__ is empty, "##" will swallow the "," in "fmt," to
      avoid compile error.
      
      example: origin				after CPP
      	high_level_api("%d", a_int)	low_level_api("%d", a_int)
      	high_level_api("a  string")	low_level_api("a  string")
      
      About 400 conversions.
      
      8 special conversions:
      VIR_XXXX0("") -> VIR_XXXX("msg") (avoid empty format) 2 conversions
      VIR_XXXX0(string_literal_with_%) -> VIR_XXXX(%->%%) 0 conversions
      VIR_XXXX0(non_string_literal) -> VIR_XXXX("%s", non_string_literal)
        (for security) 6 conversions
      Signed-off-by: NLai Jiangshan <laijs@cn.fujitsu.com>
      b65f37a4
    • E
      build: remove some dead assignments · 4c6ae9ae
      Eric Blake 提交于
      No syntactic effect; this merely silences some clang warnings.
      
      * src/libxl/libxl_driver.c (libxlDomainSetVcpusFlags): Drop
      redundant ret=0 statement.
      * src/qemu/qemu_monitor_text.c (qemuMonitorTextDriveDel):
      Likewise.
      4c6ae9ae