1. 25 11月, 2017 1 次提交
  2. 08 11月, 2017 12 次提交
    • D
      vbox: Add SAS controller support · 8b5eefb6
      Dawid Zamirski 提交于
      In VirtualBox SAS and SCSI are separate controller types whereas libvirt
      does not make such distinction. This patch adds support for attaching
      the VBOX SAS controllers by mapping the 'lsisas1068' controller model in
      libvirt XML to VBOX SAS controller type. If VBOX VM has disks attached
      to both SCSI and SAS controller libvirt domain XML will have two
      <controller type='scsci'> elements with index and model attributes set
      accordingly. In this case, each respective <disk> element must have
      <address> element specified to assign it to respective SCSI controller.
      8b5eefb6
    • D
      vbox: Generate disk address element in dumpxml · e0054c0e
      Dawid Zamirski 提交于
      This patch adds <address> element to each <disk> device since device
      names alone won't adequately reflect the storage device layout in the
      VM. With this patch, the ouput produced by dumpxml will faithfully
      reproduce the storage layout of the VM if used with define.
      e0054c0e
    • D
      vbox: Process empty removable disks in dumpxml · 7c0a85e5
      Dawid Zamirski 提交于
      Previously any removable storage device without media attached was
      omitted from domain XML dump. They're still (rightfully) omitted in
      snapshot XML dump but need to be accounted properly to for the device
      names to stay in 'sync' between domain and snapshot XML dumps.
      7c0a85e5
    • D
      vbox: Cleanup vboxDumpDisks implementation · 08b995c8
      Dawid Zamirski 提交于
      Primer the code for further changes:
      
      * move variable declarations to the top of the function
      * group together free/release statements
      * error check and report VBOX API calls used
      08b995c8
    • D
      vbox: Correctly generate drive name in dumpxml · a4919338
      Dawid Zamirski 提交于
      If a VBOX VM has e.g. a SATA and SCSI disk attached, the XML generated
      by dumpxml used to produce "sda" for both of those disks. This is an
      invalid domain XML as libvirt does not allow duplicate device names. To
      address this, keep the running total of disks that will use "sd" prefix
      for device name and pass it to the vboxGenerateMediumName which no
      longer tries to "compute" the value based only on current and max
      port and slot values. After this the vboxGetMaxPortSlotValues is not
      needed and was deleted.
      a4919338
    • D
      vbox: Swap vboxSnapshotGetReadOnlyDisks arguments · 32a94411
      Dawid Zamirski 提交于
      So that the function signature matches vboxSnapshotGetReadWriteDisks
      32a94411
    • D
      vbox: Do not free disk definitions on cleanup · 03a24da4
      Dawid Zamirski 提交于
      Both vboxSnapshotGetReadWriteDisks and vboxSnapshotGetReadWriteDisks do
      not need to free the def->disks on cleanup because it's being done by
      the caller via virDomainSnaphotDefFree
      03a24da4
    • D
      vbox: Cleanup/prepare snasphot dumpxml functions · 60c519ee
      Dawid Zamirski 提交于
      This patch prepares the vboxSnapshotGetReadOnlyDisks and
      vboxSnapshotGetReadWriteDisks functions for further changes so that
      the code movement does not obstruct the gist of those future changes.
      This is done primarily because we'll need to know the type of vbox
      storage controller as early as possible and make decisions based on
      that info.
      60c519ee
    • D
      vbox: Rename vboxDumpIDEHDDs to vboxDumpDisks · c27f79a8
      Dawid Zamirski 提交于
      Because it deals with other disk types as well not just IDE. Also this
      function now returns -1 on error
      c27f79a8
    • D
      vbox: Add vboxDumpStorageControllers · 8339d273
      Dawid Zamirski 提交于
      8339d273
    • D
      vbox: Process <controller> element in domain XML · 1cad92c4
      Dawid Zamirski 提交于
      With this patch, the vbox driver will no longer attach all supported
      storage controllers by default even if no disk devices are associated
      with them. Instead, it will attach only those that are implicitly added
      by virDomainDefAddImplicitController based on <disk> element or if
      explicitly specified via the <controller> element.
      1cad92c4
    • D
      vbox: Cleanup partially-defined VM on failure · 8442d01a
      Dawid Zamirski 提交于
      Since the VBOX API requires to register an initial VM before proceeding
      to attach any remaining devices to it, any failure to attach such
      devices should result in automatic cleanup of the initially registered
      VM so that the state of VBOX registry remains clean without any leftover
      "aborted" VMs in it. Failure to cleanup of such partial VMs results in a
      warning log so that actual define error stays on the top of the error
      stack.
      8442d01a
  3. 04 11月, 2017 5 次提交
    • D
      vbox: Support empty removable drives. · 1bf7e977
      Dawid Zamirski 提交于
      Original code was checking for non empty disk source before proceeding
      to actually attach disk device to VM. This prevented from creating
      empty removable devices like DVD or floppy. Therefore, this patch
      re-organizes the loop work-flow to allow such configurations as well as
      makes the code follow better libvirt practices. Additionally, adjusted
      debug logs to be more helpful - removed old ones and added new which
      give more valuable info for troubleshooting.
      1bf7e977
    • D
      vbox: Errors in vboxAttachDrives are now critical · e3ecf4b8
      Dawid Zamirski 提交于
      Previously, if one tried to define a VBOX VM and the API failed to
      perform the requested actions for some reason, it would just log the
      error and move on to process remaining disk definitions. This is not
      desired as it could result in incorrectly defined VM without the caller
      even knowing about it. So now all the code paths that call
      virReportError are now treated as hard failures as they should have
      been.
      e3ecf4b8
    • D
      vbox: Remove unused mediumEmpty · 60227fd5
      Dawid Zamirski 提交于
      Remove the setting since it's unused as of commit 34364df3 which should
      have never copied it in from the old code which ended up getting removed
      as part of commit c7c286c6.
      60227fd5
    • D
      vbox: Cleanup vboxAttachDrives implementation · ff67685b
      Dawid Zamirski 提交于
      This commit primes vboxAttachDrives for further changes so when they
      are made, the diff is less noisy:
      
      * move variable declarations to the top of the function
      * add disk variable to replace all the def->disks[i] instances
      * add cleanup at the end of the loop body, so it's all in one place
        rather than scattered through the loop body. It's purposefully
        called 'cleanup' rather than 'skip' or 'continue' because future
        commit will treat errors as hard-failures.
      ff67685b
    • D
      vbox: vboxAttachDrives now relies on address info · c739a6bd
      Dawid Zamirski 提交于
      Previously, the driver was computing VBOX's devicePort/deviceSlot values
      based on device name and max port/slot values. While this worked, it
      completely ignored <address> values. Additionally, libvirt's built-in
      virDomainDiskDefAssignAddress already does a good job  setting default
      values on virDomainDeviceDriveAddress struct which we can use to set
      devicePort and deviceSlot and accomplish the same result while allowing
      the customizing those via XML. Also, this allows to remove some code
      which will make further patches smaller.
      c739a6bd
  4. 26 10月, 2017 1 次提交
    • D
      vbox: Read runtime RDP port and handle autoport · 55223c2b
      Dawid Zamirski 提交于
      VirutalBox has a IVRDEServerInfo structure available that
      gives the effective runtime port that the VM is using when it's
      running. This is useful when the "TCP/Ports" VBox property was set to
      port range (e.g. via autoport = "yes" or via VBoxManage) in which
      case it would be impossible to get the "active" port otherwise.
      55223c2b
  5. 21 7月, 2017 1 次提交
  6. 07 6月, 2017 2 次提交
  7. 05 6月, 2017 1 次提交
  8. 09 5月, 2017 1 次提交
  9. 03 4月, 2017 1 次提交
    • M
      virGetDomain: Set domain ID too · 5683b213
      Michal Privoznik 提交于
      So far our code is full of the following pattern:
      
        dom = virGetDomain(conn, name, uuid)
        if (dom)
            dom->id = 42;
      
      There is no reasong why it couldn't be just:
      
        dom = virGetDomain(conn, name, uuid, id);
      
      After all, client domain representation consists of tuple (name,
      uuid, id).
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      5683b213
  10. 27 3月, 2017 2 次提交
    • M
      Remove src/nodeinfo · 26ae4e48
      Martin Kletzander 提交于
      There is no "node driver" as there was before, drivers have to do
      their own ACL checking anyway, so they all specify their functions and
      nodeinfo is basically just extending conf/capablities.  Hence moving
      the code to src/conf/ is the right way to go.
      
      Also that way we can de-duplicate some code that is in virsysfs and/or
      virhostcpu that got duplicated during the virhostcpu.c split.  And
      Some cleanup is done throughout the changes, like adding the vir*
      prefix etc.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      26ae4e48
    • M
      Move src/fdstream to src/util/virfdstream · bdcb1995
      Martin Kletzander 提交于
      There is no reason for it not to be in the utils, all global symbols
      under that file already have prefix vir* and there is no reason for it
      to be part of DRIVER_SOURCES because that is just a leftover from
      older days (pre-driver modules era, I believe).
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      bdcb1995
  11. 11 1月, 2017 6 次提交
    • D
      vbox: consolidate vbox IID structures. · 73c6f16b
      Dawid Zamirski 提交于
      * remove _vboxIID_v2_x and _vboxIID_v3_x structs and repalce with one
        _vboxIID as all supprted vbox versions have the same IID structure.
      * remove vboxIIDUnion that was used to abstract version depended IID
        differences.
      * remove IID_MEMBER macro and use the new vboxIID directly.
      73c6f16b
    • D
      vbox: IVRDxServer to IVRDEServer. · 5a5c6de3
      Dawid Zamirski 提交于
      The IVRDxServer was used because vbox < 4 used to have IVRDPServer
      whereas vbox >= 4 has IVRDEServer. Now that support for legacy
      versions is being removed, we can use IVRDEServer.
      5a5c6de3
    • D
      vbox: remove code dealing with oldMediumInterface · f2f70c21
      Dawid Zamirski 提交于
      * removed oldMediumInterface flag and related code that was used for
        vbox 2.x
      * remove accelerate2DVideo and networkRemoveInterface flags which were
        also conditionals for handling legacy vbox versions.
      f2f70c21
    • D
      vbox: remove domain events support. · 1d963578
      Dawid Zamirski 提交于
      this was implemented only for vbox 3 series and was mostly stubs
      anyway.
      1d963578
    • D
      vbox: remove getMachineForSession flag. · 374422ea
      Dawid Zamirski 提交于
      * the getMachineForSession is always true for 4.0+. This also means that
        checkflag argument in openSessionForMachine no longer has any meaning
        because it was or'ed with getMachineForSession (always true)
      * remove supportScreenshot flag - vbox 4.0+ supports it
      * remove detachDevicesExplicitly flag only relevant for < 4.0
      374422ea
    • D
      vbox: remove _vboxAttachDrivesOld · c7c286c6
      Dawid Zamirski 提交于
      and fold vboxAttachDrivesNew into vboxAttachDrives
      c7c286c6
  12. 25 11月, 2016 1 次提交
    • M
      virstring: Unify string list function names · c2a5a4e7
      Michal Privoznik 提交于
      We have couple of functions that operate over NULL terminated
      lits of strings. However, our naming sucks:
      
      virStringJoin
      virStringFreeList
      virStringFreeListCount
      virStringArrayHasString
      virStringGetFirstWithPrefix
      
      We can do better:
      
      virStringListJoin
      virStringListFree
      virStringListFreeCount
      virStringListHasString
      virStringListGetFirstWithPrefix
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      c2a5a4e7
  13. 24 11月, 2016 2 次提交
    • D
      vbox: get rid of g_pVBoxGlobalData · 63586535
      Dawid Zamirski 提交于
      now that we have a new global vboxDriver object, remove the old
      vboxGlobalData struct and all references to it.
      63586535
    • D
      vbox: change how vbox API is initialized. · 04518c36
      Dawid Zamirski 提交于
      * add vboxDriver object to serve as a singleton global object that
        holds references to IVirtualBox and ISession to be shared among
        multiple connections. The vbox_driver is instantiated only once in
        the first call vboxGetDriverConnection function that is guarded by
        a mutex.
      
      * call vbox API initialize only when the first connection is
        established, and likewise uninitialize when last connection
        disconnects. The prevents each subsequent connection from overwriting
        IVirtualBox/ISession instances of any other active connection that
        led to libvirtd segfaults. The virConnectOpen and virConnectClose
        implementations are guarded by mutex on the global vbox_driver_lock
        where the global vbox_driver object counts connectios and decides
        when it's safe to call vbox's init/uninit routines.
      
      * add IVirutalBoxClient to vboxDriver and use it to in tandem with newer
        pfnClientInitialize/pfnClientUninitalize APIs for vbox versions that
        support it, to avoid usage of the old pfnComInitialize/Uninitialize.
      04518c36
  14. 22 10月, 2016 1 次提交
  15. 12 10月, 2016 1 次提交
  16. 26 9月, 2016 2 次提交