1. 20 7月, 2015 1 次提交
    • M
      qemu: Reject updating unsupported disk information · 717c99f3
      Martin Kletzander 提交于
      If one calls update-device with information that is not updatable,
      libvirt reports success even though no data were updated.  The example
      used in the bug linked below uses updating device with <boot order='2'/>
      which, in my opinion, is a valid thing to request from user's
      perspective.  Mainly since we properly error out if user wants to update
      such data on a network device for example.
      
      And since there are many things that might happen (update-device on disk
      basically knows just how to change removable media), check for what's
      changing and moreover, since the function might be usable in other
      drivers (updating only disk path is a valid possibility) let's abstract
      it for any two disks.
      
      We can't possibly check for everything since for many fields our code
      does not properly differentiate between default and unspecified values.
      Even though this could be changed, I don't feel like it's worth the
      complexity so it's not the aim of this patch.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1007228
      717c99f3
  2. 14 7月, 2015 1 次提交
  3. 10 7月, 2015 3 次提交
  4. 09 7月, 2015 1 次提交
  5. 08 7月, 2015 1 次提交
  6. 01 7月, 2015 2 次提交
    • P
      conf: qemu: Taint VMs using custom device tree blob · 4b48ba4a
      Peter Krempa 提交于
      Using a custom device tree image may cause unexpected behavior in
      architectures that use this approach to detect platform devices. Since
      usually the device tree is generated by qemu and thus it's not normally
      used let's taint VMs using it to make it obvious as a possible source of
      problems.
      4b48ba4a
    • P
      conf: audit: Audit physical memory size rather than balloon request · 1a136774
      Peter Krempa 提交于
      Since the balloon driver does not guarantee that it returns memory to
      the host, using the value in the audit message is not a good idea.
      
      This patch removes auditing from updating the balloon size and reports
      the total physical size at startup.
      1a136774
  7. 30 6月, 2015 3 次提交
  8. 27 6月, 2015 2 次提交
    • L
      qemu: ignore assumptions about hotplug requirement when address is from config · 9a12b6cd
      Laine Stump 提交于
      Certain PCI buses don't support hotplug, and when automatically
      assigning PCI addresses for devices, libvirt is very conservative in
      its assumptions about whether or not a device will need to be
      hotplugged/unplugged in the future. But if the user manually assigns
      an address, they likely are aware of any hotplug requirements of the
      device (or at least they should be).
      
      In short, after this patch, automatically PCI address assignment will
      assume that the device must be plugged in to a hot-pluggable slot, but
      manually assignment can place the device in any bus that is
      compatible, regardless of whether or not it supports hotplug. If the
      user makes a mistake and plugs the device into a bus that doesn't
      support hotplug, then later tries to do a hot-unplug, qemu will give
      an appropriate error.
      
      (in the future we may want to add a "hotpluggable" attribute to all
      devices, with default being "yes" for autoassign, and "no" for manual
      assign).
      9a12b6cd
    • L
      qemu: always permit PCI devices to be manually assigned to a PCIe bus · 1e15be1b
      Laine Stump 提交于
      When support for the pcie-root and dmi-to-pci-bridge buses on a Q35
      machinetype was added, I was concerned that even though qemu at the
      time allowed plugging a PCI device into a PCIe port, that it might not
      be supported in the future. To prevent painful backtracking in the
      possible future where this happened, I disallowed such connections
      except in a few specific cases requested by qemu developers (indicated
      in the code with the flag VIR_PCI_CONNECT_TYPE_EITHER_IF_CONFIG).
      
      Now that a couple years have passed, there is a clear message from
      qemu that there is no danger in allowing PCI devices to be plugged
      into PCIe ports. This patch eliminates
      VIR_PCI_CONNECT_TYPE_EITHER_IF_CONFIG and changes the code to always
      allow PCI->PCIe or PCIe->PCI connection *when the PCI address is
      specified in the config. (For newly added devices that haven't yet
      been given a PCI address, the auto-placement still prefers using the
      correct type of bus).
      1e15be1b
  9. 26 6月, 2015 1 次提交
  10. 24 6月, 2015 5 次提交
  11. 23 6月, 2015 3 次提交
  12. 19 6月, 2015 2 次提交
  13. 18 6月, 2015 5 次提交
  14. 15 6月, 2015 2 次提交
    • J
      storage: Need to set secrettype for direct iscsi disk volume · 1feaccf0
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1200206
      
      Commit id '1b4eaa61' added the ability to have a mode='direct' for
      an iscsi disk volume.  It relied on virStorageTranslateDiskSourcePool
      in order to copy any disk source pool authentication information to
      the direct disk volume, but it neglected to also copy the 'secrettype'
      field which ends up being used in the domain volume formatting code.
      Adding a secrettype for this case will allow for proper formatting later
      and allow disk snapshotting to work properly
      
      Additionally libvirtd restart processing would fail to find the domain
      since the translation processing code is run after domain xml processing,
      so handle the the case where the authdef could have an empty secrettype
      field when processing the auth and additionally ignore performing the
      actual and expected auth secret type checks for a DISK_VOLUME since that
      data will be reassembled later during translation processing of the
      running domain.
      1feaccf0
    • M
      virCapabilitiesDomainDataLookup: Produce saner error message · f8867012
      Michal Privoznik 提交于
      During a review, I've noticed this error message that was eventually
      produced when I was trying to define a domain:
      
      error: invalid argument: could not find capabilities for arch=mips64el
      domaintype=(null)
      
      Look at the (null). Why is it there? Well, during XML parsing, we try
      to look up the default emulator for given OS type and possibly virt
      type too. And this is the problem, because if we don't want to look up
      by virt type, a -1 is passed to note this fact. Later, the code
      handles -1 just right. Except for error message. When it is
      constructed (in a very fabulous way I must say), the value is compared
      to zero, not -1. And since we don't have any translation from -1 to a
      virt type string, we just print (null).
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      f8867012
  15. 12 6月, 2015 3 次提交
    • M
      virsysinfo: s/system/sysdef/ · c1dff918
      Michal Privoznik 提交于
      A variable can't be named system, obviously. Well, it can if the
      compiler is new enough to distinguish a variable named system and a
      function call system(). And some older systems, don't have wise
      compiler.
      
        CC     util/libvirt_util_la-virsysinfo.lo
      cc1: warnings being treated as errors
      ../../src/util/virsysinfo.c: In function 'virSysinfoParseSystem':
      ../../src/util/virsysinfo.c:649: error: declaration of 'system' shadows a global declaration [-Wshadow]
      /usr/include/stdlib.h:717: error: shadowed declaration is here [-Wshadow]
      make[3]: *** [util/libvirt_util_la-virsysinfo.lo] Error 1
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      c1dff918
    • M
      virSysinfoDef: Exempt SYSTEM variables · 0b92974c
      Michal Privoznik 提交于
      Move all the system_* fields into a separate struct. Not only this
      simplifies the code a bit it also helps us to identify whether BIOS
      info is present. We don't have to check all the four variables for
      being not-NULL, but we can just check the pointer to the struct.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      0b92974c
    • M
      virSysinfoDef: Exempt BIOS variables · 3f9cae18
      Michal Privoznik 提交于
      Move all the bios_* fields into a separate struct. Not only this
      simplifies the code a bit it also helps us to identify whether BIOS
      info is present. We don't have to check all the four variables for
      being not-NULL, but we can just check the pointer to the struct.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      3f9cae18
  16. 11 6月, 2015 1 次提交
  17. 04 6月, 2015 4 次提交
    • P
      conf: Fix mistakes in pointer usage in virDomainObjGetDefs · f9ab9eff
      Peter Krempa 提交于
      Coverity rightfully determined that in commit 3d021381
      I made a mistake in the first check if @persDef is not NULL is
      dereferencing it rather than checking.
      
      Additionally if the vm is online the code would set @liveDef twice
      rather than modifying @persDef. Fix both mistakes.
      f9ab9eff
    • P
      conf: Add new helpers to resolve virDomainModificationImpact to domain defs · 3d021381
      Peter Krempa 提交于
      virDomainLiveConfigHelperMethod that is used for this job now does
      modify the flags but still requires the callers to extract the correct
      definition objects.
      
      In addition coverity and other static analyzers are usually unhappy as
      they don't grasp the fact that @flags are upadted according to the
      correct def to be present.
      
      To work this issue around and simplify the calling chain let's add a new
      helper that will work only on drivers that always copy the persistent
      def to a transient at start of a vm. This will allow to drop a few
      arguments. The new function syntax will also fill two definition
      pointers rather than modifying the @flags parameter.
      3d021381
    • P
      conf: Store cpu count as unsigned int · fbbea798
      Peter Krempa 提交于
      While we probably won't see machines with more than 65536 cpus for a
      while lets store the cpu count as an integer so that we can avoid quite
      a lot of overflow checks in our code.
      fbbea798
    • J
      Always add 'console' matching the 'serial' device · 8728a78e
      Ján Tomko 提交于
      We have been formatting the first serial device also
      as a console device, but only if there were no other consoles.
      
      If there is a <serial> device present in the XML, but no serial
      <console>, or if there isn't any <console> at all but the domain
      definition hasn't gone through a parse->format->parse round-trip,
      the <console> device would not be formatted.
      
      Change the code to always add the stub device for the first
      serial device.
      
      Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1089914
      8728a78e