1. 27 1月, 2015 1 次提交
  2. 23 1月, 2015 1 次提交
  3. 15 1月, 2015 1 次提交
  4. 12 1月, 2015 1 次提交
    • P
      qxl: change the default value for vgamem_mb to 16 MiB · 0e502466
      Pavel Hrdina 提交于
      The default value should be 16 MiB instead of 8 MiB. Only really old
      version of upstream QEMU used the 8 MiB as default for vga framebuffer.
      
      Without this change if you update your libvirt where we introduced the
      "vgamem" attribute for QXL video device the value will be set to 8 MiB,
      but previously your guest had 16 MiB because we didn't pass any value to
      QEMU command line which means QEMU used its own 16 MiB as default.
      
      This will affect all users with guest's display resolution higher than
      1920x1080.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      0e502466
  5. 03 11月, 2014 1 次提交
  6. 19 9月, 2014 1 次提交
  7. 21 8月, 2014 1 次提交
    • J
      Perform disk config validity checking for attach-device config · 33188c9f
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1078126
      
      Using 'virsh attach-device --config' (or --persistent) to attach a
      file backed lun device will succeed; however, subsequent domain restarts
      will result in failure because the configuration of a file backed lun
      is not supported.
      
      Although allowing 'illegal configurations' is something that can be
      allowed, it may not be practical in this case. Generally, when attaching
      a device to a domain means the domain must be running. A way around
      this is using the --config (or --persistent) option. When an attach
      is done to a running domain, a temporary configuration is modified
      first followed by the live update. The live update will make a number
      of disk validity checks when building the qemu command to attach the
      disk. If any fail, then change is rejected.
      
      Rather than allow a potentially illegal combination, adjust the code
      in the configuration path to make the same checks as the running path
      will make with respect to disk validity checks. This way we avoid
      having the potential for some subsequent start/reboot to fail because
      an illegal combination was allowed.
      
      NB: The live path still checks the configuration since it is possible
      to just do --live guest modification...
      33188c9f
  8. 08 8月, 2014 1 次提交
  9. 24 7月, 2014 1 次提交
  10. 21 6月, 2014 1 次提交
  11. 14 5月, 2014 2 次提交
    • R
      qemu: extract common PCI handling functions · 353cf370
      Roman Bogorodskiy 提交于
      Move sharable PCI handling functions to domain_addr.[ch], and
      change theirs prefix from 'qemu' to 'vir':
      
       - virDomainPCIAddressAsString;
       - virDomainPCIAddressBusSetModel;
       - virDomainPCIAddressEnsureAddr;
       - virDomainPCIAddressFlagsCompatible;
       - virDomainPCIAddressGetNextSlot;
       - virDomainPCIAddressReleaseSlot;
       - virDomainPCIAddressReserveAddr;
       - virDomainPCIAddressReserveNextSlot;
       - virDomainPCIAddressReserveSlot;
       - virDomainPCIAddressSetFree;
       - virDomainPCIAddressSetGrow;
       - virDomainPCIAddressSlotInUse;
       - virDomainPCIAddressValidate;
      
      The only change here is function names, the implementation itself
      stays untouched.
      
      Extract common allocation code from DomainPCIAddressSetCreate
      into virDomainPCIAddressSetAlloc.
      353cf370
    • R
      qemu: extract PCI handling structs · c453f2d0
      Roman Bogorodskiy 提交于
      Introduce new files (domain_addr.[ch]) to provide
      an API for domain device handling that could be
      shared across the drivers.
      
      A list of data types were extracted and moved there:
      
       qemuDomainPCIAddressBus -> virDomainPCIAddressBus
       qemuDomainPCIAddressBusPtr -> virDomainPCIAddressBusPtr
       _qemuDomainPCIAddressSet -> virDomainPCIAddressSet
       qemuDomainPCIAddressSetPtr -> virDomainPCIAddressSetPtr
       qemuDomainPCIConnectFlags -> virDomainPCIConnectFlags
      
      Also, move the related definitions and macros.
      c453f2d0
  12. 06 5月, 2014 2 次提交
  13. 22 4月, 2014 1 次提交
  14. 09 4月, 2014 2 次提交
  15. 08 4月, 2014 1 次提交
  16. 02 4月, 2014 1 次提交
    • E
      conf: split network host structs to util/ · 52fb5311
      Eric Blake 提交于
      Continuing the refactoring of host-side storage descriptions out
      of conf/domain_conf and into util/virstoragefile, this patch
      focuses on details about a host name/port/transport as used by
      a network storage volume.
      
      * src/conf/domain_conf.h (virDomainDiskProtocolTransport)
      (virDomainDiskHostDef, virDomainDiskHostDefClear)
      (virDomainDiskHostDefFree, virDomainDiskHostDefCopy): Move...
      * src/util/virstoragefile.h (virStorageNetHostTransport)
      (virStorageNetHostDef, virStorageNetHostDefClear)
      (virStorageNetHostDefFree, virStorageNetHostDefCopy): ...here,
      with better names.
      * src/util/virstoragefile.c (virStorageNetHostDefClear)
      (virStorageNetHostDefFree, virStorageNetHostDefCopy): Moved from...
      * src/conf/domain_conf.c (virDomainDiskHostDefClear)
      (virDomainDiskHostDefFree, virDomainDiskHostDefCopy): ...here.
      (virDomainDiskSourceDefClear, virDomainDiskSourceDefParse)
      (virDomainDiskSourceDefFormatInternal): Adjust callers.
      * src/conf/snapshot_conf.h (_virDomainSnapshotDiskDef): Likewise.
      * src/conf/snapshot_conf.c (virDomainSnapshotDiskDefClear):
      Likewise.
      * src/qemu/qemu_command.c (qemuAddRBDHost)
      (qemuParseDriveURIString, qemuParseNBDString)
      (qemuBuildNetworkDriveURI, qemuParseCommandLineDisk)
      (qemuParseCommandLine, qemuGetDriveSourceString): Likewise.
      * src/qemu/qemu_command.h: Likewise.
      * src/qemu/qemu_conf.c (qemuAddISCSIPoolSourceHost)
      (qemuTranslateDiskSourcePool): Likewise.
      * src/qemu/qemu_driver.c
      (qemuDomainSnapshotCreateSingleDiskActive)
      (qemuDomainSnapshotUndoSingleDiskActive): Likewise.
      * src/storage/storage_backend_gluster.c
      (virStorageFileBackendGlusterInit): Likewise.
      * src/storage/storage_driver.c (virStorageFileFree)
      (virStorageFileInitInternal): Likewise.
      * src/storage/storage_driver.h (_virStorageFile): Likewise.
      * src/libvirt_private.syms (domain_conf.h): Move symbols...
      (virstoragefile.h): ...as appropriate.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      52fb5311
  17. 15 3月, 2014 1 次提交
    • C
      qemu: XMLToNative: Don't show -S · e8400564
      Cole Robinson 提交于
      -S causes qemu to start in the paused state. Since XML2Native is intended
      to generate something that users can run directly, this will trip them up.
      e8400564
  18. 14 2月, 2014 1 次提交
  19. 30 1月, 2014 1 次提交
    • O
      util: Add one argument for several scsi utils · 10c9ceff
      Osier Yang 提交于
      To support passing the path of the test data to the utils, one
      more argument is added to virSCSIDeviceGetSgName,
      virSCSIDeviceGetDevName, and virSCSIDeviceNew, and the related
      code is changed accordingly.
      
      Later tests for the scsi utils will be based on this patch.
      Signed-off-by: NOsier Yang <jyang@redhat.com>
      10c9ceff
  20. 09 1月, 2014 1 次提交
  21. 03 12月, 2013 1 次提交
  22. 18 10月, 2013 1 次提交
  23. 25 9月, 2013 1 次提交
    • L
      qemu: allow some PCI devices to be attached to PCIe slots · 07af5192
      Laine Stump 提交于
      Part of the resolution to:
      
         https://bugzilla.redhat.com/show_bug.cgi?id=1003983
      
      Although most devices available in qemu area defined as PCI devices,
      and strictly speaking should only be attached via a PCI slot, in
      practice qemu allows them to be attached to a PCIe slot and sometimes
      this makes sense.
      
      For example, The UHCI and EHCI USB controllers are usually attached
      directly to the PCIe "root complex" (i.e. PCIe slots) on real
      hardware, so that should be possible for a Q35-based qemu virtual
      machine as well.
      
      We still want to prefer a standard PCI slot when auto-assigning
      addresses, though, and in general to disallow attaching PCI devices
      via PCIe slots.
      
      This patch makes that possible by adding a new
      QEMU_PCI_CONNECT_TYPE_EITHER_IF_CONFIG flag. Three things are done
      with this flag:
      
      1) It is set for the "pcie-root" controller
      
      2) qemuCollectPCIAddress() now has a set of nested switches that set
      this "EITHER" flag for devices that we want to allow connecting to
      pcie-root when specifically requested in the config.
      
      3) qemuDomainPCIAddressFlagsCompatible() adds this new flag to the
      "flagsMatchMask" if the address being checked came from config rather
      than being newly auto-allocated by libvirt (this knowledge is
      conveniently already available in the "fromConfig" arg).
      
      Now any device having the EITHER flag set can be connected to
      pcie-root if explicitly requested, but auto-allocated addresses for
      those devices will still be standard PCI slots instead.
      
      This patch only loosens the restrictions on devices that have been
      specifically requested, but the setup is such that it should be fairly
      easy to add new devices.
      07af5192
  24. 24 9月, 2013 1 次提交
    • D
      Fix error checking of qemuParseKeywords return status · 5923ea67
      Daniel P. Berrange 提交于
      Most callers of qemuParseKeywords were assigning its return
      value to a 'size_t' variable. Then then also checked '< 0'
      for error condition, but this will never be true with the
      unsigned size_t variable. Rather than using 'ssize_t', change
      qemuParseKeywords so that the element count is returned via
      an output parameter, leaving the return value solely as an
      error indicator.
      
      This avoids a crash accessing beyond the end of an error
      upon OOM.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      5923ea67
  25. 05 9月, 2013 1 次提交
    • E
      qemu: simplify list cleanup · 41b55056
      Eric Blake 提交于
      No need to open code now that we have a nice function.
      
      Interestingly, our virStringFreeList function is typed correctly
      (a malloc'd list of malloc'd strings is NOT const, whether at the
      point where it is created, or at the point where it is cleand up),
      so using it with a 'const char **' argument would require a cast
      to keep the compiler.  I chose instead to remove const from code
      even where we don't modify the argument, just to avoid the need
      to cast.
      
      * src/qemu/qemu_command.h (qemuParseCommandLine): Drop declaration.
      * src/qemu/qemu_command.c (qemuParseProcFileStrings)
      (qemuStringToArgvEnv): Don't force malloc'd result to be const.
      (qemuParseCommandLinePid, qemuParseCommandLineString): Simplify
      cleanup.
      (qemuParseCommandLine, qemuFindEnv): Drop const-correctness to
      avoid the need to cast in callers.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      41b55056
  26. 22 8月, 2013 1 次提交
  27. 06 8月, 2013 2 次提交
    • L
      qemu: properly set/use device alias for pci controllers · 01b88127
      Laine Stump 提交于
      We had been setting the device alias in the devinceinfo for pci
      controllers to "pci%u", but then hardcoding "pci.%u" when creating the
      device address for other devices using that pci bus. This all worked
      just fine until we encountered the built-in "pcie.0" bus (the PCIe
      root complex) in Q35 machines.
      
      In order to create the correct commandline for this one case, this
      patch:
      
      1) sets the alias for PCI controllers correctly, to "pci.%u" (or
      "pcie.%u" for the pcie-root controller)
      
      2) eliminates the hardcoded "pci.%u" for pci controllers when
      generatuing device address strings, and instead uses the controller's
      alias.
      
      3) plumbs a pointer to the virDomainDef all the way down to
      qemuBuildDeviceAddressStr. This was necessary in order to make the
      aliase of the controller *used by a device* available (previously
      qemuBuildDeviceAddressStr only had the deviceinfo of the device
      itself, *not* of the controller it was connecting to). This made for a
      larger than desired diff, but at least in the future we won't have to
      do it again, since all the information we could possibly ever need for
      future enhancements is in the virDomainDef. (right?)
      
      This should be done for *all* controllers, but for now we just do it
      in the case of PCI controllers, to reduce the likelyhood of
      regression.
      01b88127
    • L
      qemu: add pcie-root controller · 48a3f48a
      Laine Stump 提交于
      This controller is implicit on q35 machinetypes. It provides 31 PCIe
      (*not* PCI) slots as controller 0.
      
      Currently there are no devices that can connect to pcie-root, and no
      implicit pci controller on a q35 machine, so q35 is still
      unusable. For a usable q35 system, we need to add a
      "dmi-to-pci-bridge" pci controller, which can connect to pcie-root,
      and provides standard pci slots that can be used to connect other
      devices.
      48a3f48a
  28. 04 8月, 2013 2 次提交
    • L
      qemu: eliminate almost-duplicate code in qemu_command.c · 3bb01257
      Laine Stump 提交于
      * The functions qemuDomainPCIAddressReserveAddr and
      qemuDomainPCIAddressReserveSlot were very similar (and should have
      been more similar) and were about to get more code added to them which
      would create even more duplicated code, so this patch gives
      qemuDomainPCIAddressReserveAddr a "reserveEntireSlot" arg, then
      replaces the body of qemuDomainPCIAddressReserveSlot with a call to
      qemuDomainPCIAddressReserveAddr.
      
      You will notice that addrs->lastaddr was previously set in
      qemuDomainPCIAddressReserveAddr (but *not* set in
      qemuDomainPCIAddressReserveSlot). For consistency and cleanliness of
      code, that bit was removed and put into the one caller of
      qemuDomainPCIAddressReserveAddr (there is a similar place where the
      caller of qemuDomainPCIAddressReserveSlot sets lastaddr). This does
      guarantee identical functionality to pre-patch code, but in practice
      isn't really critical, because lastaddr is just keeping track of where
      to start when looking for a free slot - if it isn't updated, we will
      just start looking on a slot that's already occupied, then skip up to
      one that isn't.
      
      * qemuCollectPCIAddress was essentially doing the same thing as
      qemuDomainPCIAddressReserveAddr, but with some extra special case
      checking at the beginning. The duplicate code has been replaced with
      a call to qemuDomainPCIAddressReserveAddr. This required adding a
      "fromConfig" boolean, which is only used to change the log error
      code from VIR_ERR_INTERNAL_ERROR (when the address was
      auto-generated by libvirt) to VIR_ERR_XML_ERROR (when the address is
      coming from the config); without this differentiation, it would be
      difficult to tell if an error was caused by something wrong in
      libvirt's auto-allocate code or just bad config.
      
      * the bit of code in qemuDomainPCIAddressValidate that checks the
      connect type flags is going to be used in a couple more places where
      we don't need to also check the slot limits (because we're generating
      the slot number ourselves), so that has been pulled out into a
      separate qemuDomainPCIAddressFlagsCompatible function.
      3bb01257
    • L
      qemu: rename some functions in qemu_command.c · 29e3a1df
      Laine Stump 提交于
      * qemuDomainPCIAddressSetNextAddr
      
      The name of this function was confusing because 1) other functions in
      the file that end in "Addr" are only operating on a single function of
      one PCI slot, not the entire slot, while functions that do something
      with the entire slot end in "Slot", and 2) it didn't contain a verb
      describing what it is doing (the "Set" refers to the set that contains
      all PCI buses in the system, used to keep track of which slots in
      which buses are already reserved for use).
      
      It is now renamed to qemuDomainPCIAddressReserveNextSlot, which more
      clearly describes what it is doing. Arguably, it could have been
      changed to qemuDomainPCIAddressSetReserveNextSlot, but 1) the word
      "set" is confusing in this context because it could be intended as a
      verb or as a noun, and 2) most other functions that operate on a
      single slot or address within this set are also named
      qemuDomainPCIAddress... rather than qemuDomainPCIAddressSet... Only
      the Create, Free, and Grow functions for an address set (which modify the
      entire set, not just one element) use "Set" in their name.
      
      * qemuPCIAddressAsString, qemuPCIAddressValidate
      
      All the other functions in this set are named
      qemuDomainPCIAddressxxxxx, so I renamed these to be consistent.
      29e3a1df
  29. 24 7月, 2013 1 次提交
    • L
      qemu: set/validate slot/connection type when assigning slots for PCI devices · 3ceb4c7d
      Laine Stump 提交于
      Since PCI bridges, PCIe bridges, PCIe switches, and PCIe root ports
      all share the same namespace, they are all defined as controllers of
      type='pci' in libvirt (but with a differing model attribute). Each of
      these controllers has a certain connection type upstream, allows
      certain connection types downstream, and each can either allow a
      single downstream connection at slot 0, or connections from slot 1 -
      31.
      
      Right now, we only support the pci-root and pci-bridge devices, both
      of which only allow PCI devices to connect, and both which have usable
      slots 1 - 31. In preparation for adding other types of controllers
      that have different capabilities, this patch 1) adds info to the
      qemuDomainPCIAddressBus object to indicate the capabilities, 2) sets
      those capabilities appropriately for pci-root and pci-bridge devices,
      and 3) validates that the controller being connected to is the proper
      type when allocating slots or validating that a user-selected slot is
      appropriate for a device..
      
      Having this infrastructure in place will make it much easier to add
      support for the other PCI controller types.
      
      While it would be possible to do all the necessary checking by just
      storing the controller model in the qemyuDomainPCIAddressBus, it
      greatly simplifies all the validation code to also keep a "flags",
      "minSlot" and "maxSlot" for each - that way we can just check those
      attributes rather than requiring a nearly identical switch statement
      everywhere we need to validate compatibility.
      
      You may notice many places where the flags are seemingly hard-coded to
      
        QEMU_PCI_CONNECT_HOTPLUGGABLE | QEMU_PCI_CONNECT_TYPE_PCI
      
      This is currently the correct value for all PCI devices, and in the
      future will be the default, with small bits of code added to change to
      the flags for the few devices which are the exceptions to this rule.
      
      Finally, there are a few places with "FIXME" comments. Note that these
      aren't indicating places that are broken according to the currently
      supported devices, they are places that will need fixing when support
      for new PCI controller models is added.
      
      To assure that there was no regression in the auto-allocation of PCI
      addresses or auto-creation of integrated pci-root, ide, and usb
      controllers, a new test case (pci-bridge-many-disks) has been added to
      both the qemuxml2argv and qemuxml2xml tests. This new test defines a
      domain with several dozen virtio disks but no pci-root or
      pci-bridges. The .args file of the new test case was created using
      libvirt sources from before this patch, and the test still passes
      after this patch has been applied.
      3ceb4c7d
  30. 17 7月, 2013 1 次提交
  31. 12 7月, 2013 2 次提交
    • M
      qemu: Introduce qemuBuildChrDeviceStr · f293d763
      Michal Privoznik 提交于
      The function being introduced is responsible for creating command
      line argument for '-device' for given character device. Based on
      the chardev type, it calls appropriate qemuBuild.*ChrDeviceStr(),
      e.g.  qemuBuildSerialChrDeviceStr() for serial chardev and so on.
      f293d763
    • M
      qemu_command: Honour chardev alias assignment with a function · 2a9a5bef
      Michal Privoznik 提交于
      The chardev alias assignment is going to be needed in a separate
      places, so it should be moved into a separate function rather
      than copying code randomly around.
      2a9a5bef
  32. 22 5月, 2013 1 次提交
    • M
      qemu: Adapt qemuBuildInterfaceCommandLine to to multiqueue net · 1f24f682
      Michal Privoznik 提交于
      In order to learn libvirt multiqueue several things must be done:
      
      1) The '/dev/net/tun' device needs to be opened multiple times with
      IFF_MULTI_QUEUE flag passed to ioctl(fd, TUNSETIFF, &ifr);
      
      2) Similarly, '/dev/vhost-net' must be opened as many times as in 1)
      in order to keep 1:1 ratio recommended by qemu and kernel folks.
      
      3) The command line construction code needs to switch from 'fd=X' to
      'fds=X:Y:...:Z' and from 'vhostfd=X' to 'vhostfds=X:Y:...:Z'.
      
      4) The monitor handling code needs to learn to pass multiple FDs.
      1f24f682
  33. 20 5月, 2013 1 次提交
    • O
      qemu: Add callback struct for qemuBuildCommandLine · 3a6204cb
      Osier Yang 提交于
      Since 0d70656a, it starts to access the sysfs files to build
      the qemu command line (by virSCSIDeviceGetSgName, which is to find
      out the scsi generic device name by adpater:bus:target:unit), there
      is no way to work around, qemu wants to see the scsi generic device
      like "/dev/sg6" anyway.
      
      And there might be other places which need to access sysfs files
      when building qemu command line in future.
      
      Instead of increasing the arguments of qemuBuildCommandLine, this
      introduces a new callback for qemuBuildCommandLine, and thus tests
      can register their own callbacks for sysfs test input files accessing.
      
      * src/qemu/qemu_command.h: (New callback struct
                                  qemuBuildCommandLineCallbacks;
                                  extern buildCommandLineCallbacks)
      * src/qemu/qemu_command.c: (wire up the callback struct)
      * src/qemu/qemu_driver.c: (Use the new syntax of qemuBuildCommandLine)
      * src/qemu/qemu_hotplug.c: Likewise
      * src/qemu/qemu_process.c: Likewise
      * tests/testutilsqemu.[ch]: (Helper testSCSIDeviceGetSgName;
                                   callback struct testCallbacks;)
      * tests/qemuxml2argvtest.c: (Use testCallbacks)
      * src/tests/qemuxmlnstest.c: (Like above)
      3a6204cb
  34. 15 5月, 2013 1 次提交
    • M
      qemu: Add VNC WebSocket support · 85ec7ff6
      Martin Kletzander 提交于
      Adding a VNC WebSocket support for QEMU driver.  This functionality is
      in upstream qemu from commit described as v1.3.0-982-g7536ee4, so the
      capability is being recognized based on QEMU version for now.
      85ec7ff6