1. 08 5月, 2013 2 次提交
    • D
      Don't allow renaming of domains by the backdoor · 03a60036
      Daniel P. Berrange 提交于
      Several APIs allow for custom XML to be passed in. This is
      checked for ABI stability, which will ensure the UUID is
      not being changed. There isn't validation that the name
      did not change though. This could allow renaming of guests
      via the backdoor, which in turn could allow for bypassing
      access control restrictions based on names.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      03a60036
    • D
      Separate virGetHostname() API contract from driver APIs · ead63031
      Daniel P. Berrange 提交于
      Currently the virGetHostname() API has a bogus virConnectPtr
      parameter. This is because virtualization drivers directly
      reference this API in their virDriverPtr tables, tieing its
      API design to the public virConnectGetHostname API design.
      
      This also causes problems for access control checks since
      these must only be done for invocations from the public
      API, not internal invocation.
      
      Remove the bogus virConnectPtr parameter, and make each
      hypervisor driver provide a dedicated function for the
      driver API impl. This will allow access control checks
      to be easily inserted later.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      ead63031
  2. 07 5月, 2013 1 次提交
  3. 03 5月, 2013 1 次提交
  4. 02 5月, 2013 1 次提交
    • M
      virutil: Move string related functions to virstring.c · 7c9a2d88
      Michal Privoznik 提交于
      The source code base needs to be adapted as well. Some files
      include virutil.h just for the string related functions (here,
      the include is substituted to match the new file), some include
      virutil.h without any need (here, the include is removed), and
      some require both.
      7c9a2d88
  5. 16 4月, 2013 1 次提交
  6. 12 4月, 2013 1 次提交
  7. 11 4月, 2013 1 次提交
    • M
      qemu: Set correct migrate host in client_migrate_info · 7f15ebc7
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=920441
      
      Currently, we are discarding listen attribute from qemu cookie even though
      we strive to gather it. This result in not so cool bug: if user have
      different networks, one for management/migration, and one for VNC/SPICE we
      pass incorrect host to the qemu in client_migrate_info. What we actually
      pass is remote hostname, while we should be passing remote listen address.
      It doesn't matter as long as these two are the same, but they don't need
      necessary to be like that.
      7f15ebc7
  8. 05 4月, 2013 2 次提交
  9. 02 4月, 2013 1 次提交
    • J
      qemu: Allow migration over IPv6 · f03dcc5d
      Ján Tomko 提交于
      Allow migration over IPv6 by listening on [::] instead of 0.0.0.0
      when QEMU supports it (QEMU_CAPS_IPV6_MIGRATION) and there is
      at least one v6 address configured on the system.
      
      Use virURIParse in qemuMigrationPrepareDirect to allow parsing
      IPv6 addresses, which would cause an 'incorrect :port' error
      message before.
      
      Move setting of migrateFrom from qemuMigrationPrepare{Direct,Tunnel}
      after domain XML parsing, since we need the QEMU binary path from it
      to get its capabilities.
      
      Bug: https://bugzilla.redhat.com/show_bug.cgi?id=846013
      f03dcc5d
  10. 27 3月, 2013 1 次提交
    • M
      qemu: Set migration FD blocking · ceb31795
      Michal Privoznik 提交于
      Since we switched from direct host migration scheme to the one,
      where we connect to the destination and then just pass a FD to a
      qemu, we have uncovered a qemu bug. Qemu expects migration FD to
      block. However, we are passing a nonblocking one which results in
      cryptic error messages like:
      
        qemu: warning: error while loading state section id 2
        load of migration failed
      
      The bug is already known to Qemu folks, but we should workaround
      already released Qemus. Patch has been originally proposed by Stefan
      Hajnoczi <stefanha@gmail.com>
      ceb31795
  11. 13 3月, 2013 1 次提交
    • P
      virCaps: conf: start splitting out irrelevat data · 27cf98e2
      Peter Krempa 提交于
      The virCaps structure gathered a ton of irrelevant data over time that.
      The original reason is that it was propagated to the XML parser
      functions.
      
      This patch aims to create a new data structure virDomainXMLConf that
      will contain immutable data that are used by the XML parser. This will
      allow two things we need:
      
      1) Get rid of the stuff from virCaps
      
      2) Allow us to add callbacks to check and add driver specific stuff
      after domain XML is parsed.
      
      This first attempt removes pointers to private data allocation functions
      to this new structure and update all callers and function that require
      them.
      27cf98e2
  12. 01 3月, 2013 1 次提交
    • J
      qemu: Make sure qemuProcessStart is run within a job · e4e28220
      Jiri Denemark 提交于
      qemuProcessStart expects to be run with a job already set and every
      caller except for qemuMigrationPrepareAny use it correctly. This bug can
      be observed in libvirtd logs during incoming migration as
      
          warning : qemuDomainObjEnterMonitorInternal:979 : This thread seems
          to be the async job owner; entering monitor without asking for a
          nested job is dangerous
      e4e28220
  13. 28 2月, 2013 1 次提交
  14. 23 2月, 2013 7 次提交
    • M
      qemu_migration: Cancel running jobs on failed migration · 1e54685f
      Michal Privoznik 提交于
      If a migration fails, we need to stop all block jobs running so
      qemu doesn't try to send data to destination over and over again.
      1e54685f
    • M
      qemu_migration: Stop NBD server at Finish phase · ae21b9bd
      Michal Privoznik 提交于
      At the end of migration, it is important to stop NBD
      server and thus release all allocated resources.
      ae21b9bd
    • M
      qemu_migration: Introduce qemuMigrationDriveMirror · 7b7600b3
      Michal Privoznik 提交于
      This function does the source part of NBD magic. It
      invokes drive-mirror on each non shared and RW disk with
      a source and wait till the mirroring process completes.
      When it does we can proceed with migration.
      
      Currently, an active waiting is done: every 500ms libvirt
      asks qemu if block-job is finished or not.  However, once
      the job finishes, qemu doesn't report its progress so we
      can only assume if the job finished successfully or not.
      The better solution would be to listen to the event which
      is sent as soon as the job finishes. The event does
      contain the result of job.
      7b7600b3
    • M
      qemu_migration: Introduce qemuMigrationStartNBDServer() · 86d90b3a
      Michal Privoznik 提交于
      We need to start NBD server and feed it with all non-<shared/>,
      RW and source-full disks. Moreover, with new virPortAllocator we
      must ensure the borrowed port for NBD server will be returned if
      either migration completes or qemu process is torn down.
      86d90b3a
    • M
      Introduce NBD migration cookie · 121d4cfb
      Michal Privoznik 提交于
      This migration cookie is meant for two purposes. The first is to be sent
      in begin phase from source to destination to let it know we support new
      implementation of VIR_MIGRATE_NON_SHARED_{DISK,INC} so destination can
      start NBD server. Then, the second purpose is, destination can let us
      know, on which port the NBD server is running.
      121d4cfb
    • J
      qemu: Parse more fields from query-migrate QMP command · 4121a77c
      Jiri Denemark 提交于
      As a side effect, this also fixes reporting disk migration process.
      It was added to memory migration progress, which was wrong. Disk
      progress has dedicated fields in virDomainJobInfo structure.
      4121a77c
    • J
      qemu: Add support for compressed migration · 94f59b9e
      Jiri Denemark 提交于
      94f59b9e
  15. 21 2月, 2013 1 次提交
    • J
      qemu: Turn closeCallbacks into virObjectLockable · 3898ba7f
      Jiri Denemark 提交于
      To avoid having to hold the qemu driver lock while iterating through
      close callbacks and calling them. This fixes a real deadlock when a
      domain which is being migrated from another host gets autodestoyed as a
      result of broken connection to the other host.
      3898ba7f
  16. 20 2月, 2013 1 次提交
    • J
      qemu: Do not ignore mandatory features in migration cookie · 69660042
      Jiri Denemark 提交于
      Due to "feature"/"features" nasty typo, any features marked as mandatory
      by one side of a migration are silently considered optional by the other
      side. The following is the code that formats mandatory features in
      migration cookie:
      
          for (i = 0 ; i < QEMU_MIGRATION_COOKIE_FLAG_LAST ; i++) {
              if (mig->flagsMandatory & (1 << i))
                  virBufferAsprintf(buf, "  <feature name='%s'/>\n",
                                    qemuMigrationCookieFlagTypeToString(i));
          }
      69660042
  17. 13 2月, 2013 1 次提交
    • D
      Remove qemuDriverLock from almost everywhere · a9e97e0c
      Daniel P. Berrange 提交于
      With the majority of fields in the virQEMUDriverPtr struct
      now immutable or self-locking, there is no need for practically
      any methods to be using the QEMU driver lock. Only a handful
      of helper APIs in qemu_conf.c now need it
      a9e97e0c
  18. 08 2月, 2013 2 次提交
  19. 06 2月, 2013 1 次提交
    • D
      Merge virDomainObjListIsDuplicate into virDomainObjListAdd · eea87129
      Daniel P. Berrange 提交于
      The duplicate VM checking should be done atomically with
      virDomainObjListAdd, so shoud not be a separate function.
      Instead just use flags to indicate what kind of checks are
      required.
      
      This pair, used in virDomainCreateXML:
      
         if (virDomainObjListIsDuplicate(privconn->domains, def, 1) < 0)
           goto cleanup;
         if (!(dom = virDomainObjListAdd(privconn->domains,
                                         privconn->caps,
                                         def, false)))
           goto cleanup;
      
      Changes to
      
         if (!(dom = virDomainObjListAdd(privconn->domains,
                                         privconn->caps,
                                         def,
                                         VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE,
                                         NULL)))
           goto cleanup;
      
      This pair, used in virDomainRestoreFlags:
      
         if (virDomainObjListIsDuplicate(privconn->domains, def, 1) < 0)
           goto cleanup;
         if (!(dom = virDomainObjListAdd(privconn->domains,
                                         privconn->caps,
                                         def, true)))
           goto cleanup;
      
      Changes to
      
         if (!(dom = virDomainObjListAdd(privconn->domains,
                                         privconn->caps,
                                         def,
                                         VIR_DOMAIN_OBJ_LIST_ADD_LIVE |
                                         VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE,
                                         NULL)))
           goto cleanup;
      
      This pair, used in virDomainDefineXML:
      
         if (virDomainObjListIsDuplicate(privconn->domains, def, 0) < 0)
           goto cleanup;
         if (!(dom = virDomainObjListAdd(privconn->domains,
                                         privconn->caps,
                                         def, false)))
           goto cleanup;
      
      Changes to
      
         if (!(dom = virDomainObjListAdd(privconn->domains,
                                         privconn->caps,
                                         def,
                                         0, NULL)))
           goto cleanup;
      eea87129
  20. 05 2月, 2013 3 次提交
    • D
      Rename all domain list APIs to have virDomainObjList prefix · 4f6ed6c3
      Daniel P. Berrange 提交于
      The APIs names for accessing the domain list object are
      very inconsistent. Rename them all to have a standard
      virDomainObjList prefix.
      4f6ed6c3
    • D
      Introduce a virQEMUDriverConfigPtr object · b090aa7d
      Daniel P. Berrange 提交于
      Currently the virQEMUDriverPtr struct contains an wide variety
      of data with varying access needs. Move all the static config
      data into a dedicated virQEMUDriverConfigPtr object. The only
      locking requirement is to hold the driver lock, while obtaining
      an instance of virQEMUDriverConfigPtr. Once a reference is held
      on the config object, it can be used completely lockless since
      it is immutable.
      
      NB, not all APIs correctly hold the driver lock while getting
      a reference to the config object in this patch. This is safe
      for now since the config is never updated on the fly. Later
      patches will address this fully.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      b090aa7d
    • M
      qemu: Catch stderr of image compression binary · 137229bf
      Michal Privoznik 提交于
      If a compression binary prints something to stderr, currently
      it is discarded. However, it can contain useful data from
      debugging POV, so we should catch it.
      137229bf
  21. 19 1月, 2013 1 次提交
  22. 16 1月, 2013 1 次提交
  23. 14 1月, 2013 1 次提交
  24. 09 1月, 2013 1 次提交
  25. 21 12月, 2012 5 次提交