1. 24 6月, 2016 1 次提交
    • J
      secret: Move virStorageSecretType and rename · 1eca5f65
      John Ferlan 提交于
      Move the enum into a new src/util/virsecret.h, rename it to be
      virSecretLookupType. Add a src/util/virsecret.h in order to perform
      a couple of simple operations on the secret XML and virSecretLookupTypeDef
      for clearing and copying.
      
      This includes quite a bit of collateral damage, but the goal is to remove
      the "virStorage*" and replace with the virSecretLookupType so that it's
      easier to to add new lookups that aren't necessarily storage pool related.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      1eca5f65
  2. 23 6月, 2016 1 次提交
    • J
      libxl: use serial device for console when targetType is serial · 76d58716
      Jim Fehlig 提交于
      When domXML contains only <console type='pty'> and no corresponding
      <serial>, the console is "stolen" [1] and used as the first <serial>
      device. When this "stolen" console is accessed from the libxl driver
      (in libxlConsoleCallback and libxlDomainOpenConsole), check if the
      targetType is VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL, and use the
      "stolen" device in def->serials[0] instead. Prior to this change,
      creating a domain with input XML containing only a <console> device
      and subsequently attempting to access its console with
      'virsh console' would fail
      
      error: internal error: character device <null> is not using a PTY
      
      [1] See comments associated with virDomainDefAddConsoleCompat() in
          $LIBVIRT-SRC/src/conf/domain_conf.c:
      76d58716
  3. 18 6月, 2016 1 次提交
  4. 17 6月, 2016 1 次提交
  5. 15 6月, 2016 2 次提交
    • C
      libxl: support hotplug USB host device · fc21d106
      Chunyan Liu 提交于
      Support hot attach/detach a USB host device to guest.
      Currently libxl only supports xen PV guest, and only
      supports specifying USB host device by 'bus number'
      and 'device number', for example:
      
       usb.xml:
          <hostdev mode='subsystem' type='usb' managed='no'>
            <source>
              <address bus='1' device='3'/>
            </source>
          </hostdev>
       #xl attach-device dom usb.xml
       #xl detach-device dom usb.xml
      Signed-off-by: NChunyan Liu <cyliu@suse.com>
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      fc21d106
    • C
      libxl: support creating guest with USB hostdev · 2a58ed0b
      Chunyan Liu 提交于
      Support creating guest with USB host device in config file.
      Currently libxl only supports xen PV guest, and only supports
      specifying USB host device by 'bus number' and 'device number',
      for example:
      
          <hostdev mode='subsystem' type='usb' managed='no'>
            <source>
              <address bus='1' device='3'/>
            </source>
          </hostdev>
      Signed-off-by: NChunyan Liu <cyliu@suse.com>
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      2a58ed0b
  6. 14 6月, 2016 5 次提交
  7. 13 6月, 2016 1 次提交
    • W
      libxl: fix vm lock overwritten bug · 9ac94507
      Wang Yufei 提交于
      In libxl driver we do virObjectRef in libxlDomainObjBeginJob,
      If virCondWaitUntil failed, it goes to error, do virObjectUnref,
      There's a chance that someone undefine the vm at the same time,
      and refs unref to zero, vm is freed in libxlDomainObjBeginJob.
      But the vm outside function is not Null, we do virObjectUnlock(vm).
      That's how we overwrite the vm memory after it's freed. I fix it.
      Signed-off-by: NWang Yufei <james.wangyufei@huawei.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      9ac94507
  8. 08 6月, 2016 1 次提交
  9. 07 6月, 2016 3 次提交
  10. 06 6月, 2016 1 次提交
    • J
      Do not check for domain liveness in virDomainObjSetDefTransient · 8c40ede4
      Ján Tomko 提交于
      Remove the live attribute and mark the definition as transient
      whether the domain is runing or not.
      
      There were only two callers left calling with live=false:
      * testDomainStartState, where the domain already is active
        because we assigned vm->def->id just a few lines above the call
      * virDomainObjGetPersistentDef, which now only calls
        virDomainObjSetDefTransient for an active domain
      8c40ede4
  11. 25 5月, 2016 2 次提交
  12. 24 5月, 2016 1 次提交
  13. 20 5月, 2016 2 次提交
  14. 18 5月, 2016 1 次提交
  15. 17 5月, 2016 1 次提交
    • J
      libxl: Free migration cookie · 1222a303
      John Ferlan 提交于
      Commit id 'f9edcfa4' added cookie manipulation for libxl; however, some
      cookie crumb cleanup was missed. Found by Coverity.
      
      In libxlDomainMigrationBegin, the cookie is allocated and baked; however,
      the mig ingredients weren't cleaned up.
      
      In libxlDomainMigrationPrepare, when the 'mig' cookie is added to the
      args, set the 'mig = NULL'; otherwise, other failure paths between when
      the code ate the cookie data and when it was added to args would fail
      to clean up the crumbs.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      1222a303
  16. 16 5月, 2016 2 次提交
    • J
      secret: Alter virSecretGetSecretString · abd2272c
      John Ferlan 提交于
      Rather than returning a "char *" indicating perhaps some sized set of
      characters that is NUL terminated, alter the function to return 0 or -1
      for success/failure and add two parameters to handle returning the
      buffer and it's size.
      
      The function no longer encodes the returned secret, rather it returns
      the unencoded secret forcing callers to make the necessary adjustments.
      
      Alter the callers to handle the adjusted model.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      abd2272c
    • P
      secret: util: Refactor virSecretGetSecretString · 1d632c39
      Peter Krempa 提交于
      Call the internal driver callbacks rather than the public APIs to avoid
      calling unnecessarily the error dispatching code and don't overwrite
      the error messages provided by the APIs. They are good enough to
      describe which secret is missing either by UUID or the usage (basically
      name).
      1d632c39
  17. 14 5月, 2016 1 次提交
    • J
      libxl: don't attempt to probe a non-existent emulator · 400e716d
      Jim Fehlig 提交于
      When probing the <emulator> with '-help' to determine if
      it is the old qemu, errors are reported if the emulator
      doesn't exist
      
      libvirt:  error : internal error: Child process
      (/usr/lib/xen/bin/qemu-dm -help) unexpected exit status 127:
      libvirt:  error : cannot execute binary /usr/lib/xen/bin/qemu-dm:
      No such file or directory
      
      Avoid the probe if the specified emulator doesn't exist,
      squelching the error. There is no behavior change since
      libxlDomainGetEmulatorType() would return
      LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN if the probe failed
      via virCommandRun().
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      400e716d
  18. 11 5月, 2016 3 次提交
    • J
      libxl: support migration stream V2 in migration · f9edcfa4
      Jim Fehlig 提交于
      Similar to "support Xen migration stream V2 in save/restore",
      add support for indicating the migration stream version in
      the migration code. To accomplish this, add a minimal migration
      cookie in the libxl driver that is passed between source and
      destination hosts. Initially, the cookie is only used in
      the Begin and Prepare phases of migration to communicate the
      version of the migration stream produced by the source.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      f9edcfa4
    • J
      libxl: support Xen migration stream V2 in save/restore · 5325123d
      Jim Fehlig 提交于
      Xen 4.6 introduced a new migration stream commonly referred to as
      "migration V2". Xen 4.6 and newer always produce this new stream,
      whereas Xen 4.5 and older always produce the legacy stream.
      Support for migration stream V2 can be detected at build time with
      LIBXL_HAVE_SRM_V2 from libxl.h. The legacy and V2 streams are not
      compatible, but a V2 host can accept and convert a legacy stream.
      
      Commit e7440656 changed the libxl driver to use the lowest libxl
      API version possible (version 0x040200) to ensure the driver
      builds against older Xen releases. The old 4.2 restore API does
      not support specifying a stream version and assumes a legacy
      stream, even if the incoming stream is migration V2. Thinking it
      has been given a legacy stream, libxl will fail to convert an
      incoming stream that is already V2, which causes the entire
      restore operation to fail. Xen's libvirt-related OSSTest has been
      failing since commit e7440656 landed in libvirt.git master. One
      of the more recent failures can be seen here
      
      http://lists.xenproject.org/archives/html/xen-devel/2016-05/msg00071.html
      
      This patch changes the call to libxl_domain_create_restore() to
      include the stream version if LIBXL_HAVE_SRM_V2 is defined. The
      version field of the libxlSavefileHeader struct is also updated
      to '2' when LIBXL_HAVE_SRM_V2 is defined, ensuring the stream
      version in the header matches the actual stream version produced
      by Xen. Along with bumping the libxl API requirement to 0x040400,
      this patch fixes save/restore on a migration V2 Xen host.
      
      Oddly, migration has never used the libxlSavefileHeader. It
      handles passing configuration in the Begin and Prepare phases,
      and then calls libxl directly to transfer domain state/memory
      in the Perform phase. A subsequent patch will add stream
      version handling in the Begin and Prepare phase handshaking,
      which will fix the migration related OSSTest failures.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      5325123d
    • J
      libxl: switch to using libxl_domain_create_restore from v4.4 API · fccf2725
      Jim Fehlig 提交于
      In LIBXL_API_VERSION 0x040400, the libxl_domain_create_restore API
      gained a parameter for specifying restore parameters. Switch to
      using version 0x040400, which will be useful in a subsequent commit
      to specify the Xen migration stream version when restoring.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      fccf2725
  19. 06 5月, 2016 1 次提交
  20. 16 4月, 2016 1 次提交
    • J
      libxl: use LIBXL_API_VERSION 0x040200 · e7440656
      Jim Fehlig 提交于
      To ensure the libvirt libxl driver will build with future versions
      of Xen where the libxl API may change in incompatible ways,
      explicitly use LIBXL_API_VERSION 0x040200. The libxl driver
      does use new libxl APIs that have been added since Xen 4.2, but
      currently it does not make use of any changes made to existing
      APIs such as libxl_domain_create_restore or libxl_set_vcpuaffinity.
      The version can be bumped if/when the libxl driver consumes the
      changed APIs.
      
      Further details can be found in the following discussion thread
      
      https://www.redhat.com/archives/libvir-list/2016-April/msg00178.htmlSigned-off-by: NJim Fehlig <jfehlig@suse.com>
      e7440656
  21. 14 4月, 2016 1 次提交
  22. 13 4月, 2016 2 次提交
  23. 08 4月, 2016 1 次提交
    • W
      libxl: libxl_domain_create_restore has an extra argument · 216650f1
      Wei Liu 提交于
      In the latest libxenlight code, libxl_domain_create_restore accepts a
      new argument. Update libvirt's libxl driver for that. Use the macro
      provided by libxenlight to detect which version should be used.
      
      The new parameter (send_back_fd) is set to -1 because libvirt provides
      no such fd.
      Signed-off-by: NWei Liu <wei.liu2@citrix.com>
      Message-id: 1459866012-27081-1-git-send-email-wei.liu2@citrix.com
      216650f1
  24. 07 4月, 2016 1 次提交
    • J
      secret: Introduce virSecretGetSecretString · 2844de6f
      John Ferlan 提交于
      Commit id 'fb2bd208' essentially copied the qemuGetSecretString
      creating an libxlGetSecretString.  Rather than have multiple copies
      of the same code, create src/secret/secret_util.{c,h} files and
      place the common function in there.
      
      Modify the the build in order to build the module as a library
      which is then pulled in by both the qemu and libxl drivers for
      usage from both qemu_command.c and libxl_conf.c
      2844de6f
  25. 01 4月, 2016 2 次提交
  26. 30 3月, 2016 1 次提交