1. 17 4月, 2019 8 次提交
  2. 16 4月, 2019 3 次提交
  3. 10 4月, 2019 1 次提交
  4. 03 4月, 2019 5 次提交
  5. 22 3月, 2019 1 次提交
    • E
      snapshot: Track current snapshot in virDomainSnapshotObjList · 4819f54b
      Eric Blake 提交于
      It is easier to track the current snapshot as part of the list of
      snapshots. In particular, doing so lets us guarantee that the current
      snapshot is cleared if that snapshot is removed from the list (rather
      than depending on the caller to do so, and risking a use-after-free
      problem, such as the one recently patched in 1db9d0ef).  This
      requires the addition of several new accessor functions, as well as a
      useful return type for virDomainSnapshotObjListRemove().  A few error
      handling sites that were previously setting vm->current_snapshot =
      NULL can now be dropped, because the previous function call has now
      done it already.  Also, qemuDomainRevertToSnapshot() was setting the
      current vm twice, so keep only the one used on the success path.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      4819f54b
  6. 20 3月, 2019 2 次提交
  7. 16 3月, 2019 1 次提交
    • E
      conf: Split domain forward typedefs into virconftypes.h · c555ec24
      Eric Blake 提交于
      Right now, snapshot_conf.h is rather large - it deals with three
      separate types: virDomainSnapshotDef (the snapshot definition as it
      maps to XML), virDomainSnapshotObj (an object containing a def and the
      relationship to other snapshots), and virDomainSnapshotObjList (a list
      of snapshot objects), where two of the three types are currently
      public rather than opaque.  What's more, the types are circular: a
      snapshot def includes a virDomainPtr, which contains a snapshot list,
      which includes a snapshot object, which includes a snapshot def.
      
      In order to split the three objects into separate files, while still
      allowing each header to use sane typedefs to incomplete pointers, the
      obvious solution is to lift the typedefs into yet another header, with
      no other dependencies.  Start the split by factoring out all struct
      typedefs from domain_conf.h (enum typedefs don't get used in function
      signatures, and function typedefs tend not to suffer from circular
      referencing, so those stay put).  The only other exception is
      virDomainStateReason, which is only ever used directly rather than via
      a pointer.
      
      This patch is just straight code motion (all typedefs are listed in
      the same order before and after the patch); a later patch will sort
      things for legibility.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      c555ec24
  8. 14 3月, 2019 2 次提交
  9. 12 3月, 2019 2 次提交
    • M
      conf: Introduce firmware attribute to <os/> · d947fa8a
      Michal Privoznik 提交于
      The idea is that using this attribute users enable libvirt to
      automagically select firmware image for their domain. For
      instance:
      
        <os firmware='efi'>
          <type arch='x86_64' machine='pc-q35-4.0'>hvm</type>
          <loader secure='no'/>
        </os>
      
        <os firmware='bios'>
          <type arch='x86_64' machine='pc-q35-4.0'>hvm</type>
        </os>
      
      (The automagic of selecting firmware image will be described in
      later commits.)
      
      Accepted values are 'bios' and 'efi' to let libvirt select
      corresponding type of firmware.
      
      I know it is a good sign to introduce xml2xml test case when
      changing XML config parser but that will have to come later.
      Firmware auto selection is not enabled for any driver just yet so
      any xml2xml test would fail right away.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      d947fa8a
    • M
      conf: Introduce VIR_DOMAIN_LOADER_TYPE_NONE · d21f89cc
      Michal Privoznik 提交于
      This is going to extend virDomainLoader enum. The reason is that
      once loader path is NULL its type makes no sense. However, since
      value of zero corresponds to VIR_DOMAIN_LOADER_TYPE_ROM the
      following XML would be produced:
      
        <os>
          <loader type='rom'/>
          ...
        </os>
      
      To solve this, introduce VIR_DOMAIN_LOADER_TYPE_NONE which would
      correspond to value of zero and then use post parse callback to
      set the default loader type to 'rom' if needed.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NLaszlo Ersek <lersek@redhat.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      d21f89cc
  10. 05 3月, 2019 9 次提交
  11. 25 2月, 2019 1 次提交
  12. 24 2月, 2019 1 次提交
  13. 20 2月, 2019 1 次提交
    • E
      domain: Fix unknown flags diagnosis in virDomainGetXMLDesc · 27c8fd74
      Eric Blake 提交于
      Many drivers had a comment that they did not validate the incoming
      'flags' to virDomainGetXMLDesc() because they were relying on
      virDomainDefFormat() to do it instead. This used to be the case
      (at least since 461e0f1a and friends in 0.9.4 added unknown flag
      checking in general), but regressed in commit 0ecd6851 (1.2.12),
      when all of the drivers were changed to pass 'flags' through the
      new helper virDomainDefFormatConvertXMLFlags(). Since this helper
      silently ignores unknown flags, we need to implement flag checking
      in each driver instead.
      
      Annoyingly, this means that any new flag values added will silently
      be ignored when targeting an older libvirt, rather than our usual
      practice of loudly diagnosing an unsupported flag.  Add comments
      in domain_conf.[ch] to remind us to be extra vigilant about the
      impact when adding flags (a new flag to add data is safe if the
      older server omitting the requested data doesn't break things in
      the newer client; a new flag to suppress data rather than enhancing
      the existing VIR_DOMAIN_XML_SECURE may form a data leak or even a
      security hole).
      
      In the qemu driver, there are multiple callers all funnelling to
      qemuDomainDefFormatBufInternal(); many of them already validated
      flags (and often only a subset of the full set of possible flags),
      but for ease of maintenance, we can also check flags at the common
      helper function.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      27c8fd74
  14. 04 2月, 2019 1 次提交
  15. 25 1月, 2019 2 次提交