1. 24 6月, 2019 4 次提交
  2. 21 5月, 2019 3 次提交
  3. 15 5月, 2019 4 次提交
  4. 21 3月, 2019 5 次提交
    • D
      network: avoid trying to create global firewall rules if unprivileged · 3e02ee9b
      Daniel P. Berrangé 提交于
      The unprivileged libvirtd does not have permission to create firewall
      rules, or bridge devices, or do anything to the host network in
      general. Historically we still activate the network driver though and
      let the network start API call fail.
      
      The startup code path which reloads firewall rules on active networks
      would thus effectively be a no-op when unprivileged as it is impossible
      for there to be any active networks
      
      With the change to use a global set of firewall chains, however, we now
      have code that is run unconditionally.
      
      Ideally we would not register the network driver at all when
      unprivileged, but the entanglement with the virt drivers currently makes
      that impractical. As a temporary hack, we just make the firewall reload
      into a no-op.
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      (cherry picked from commit 5d010c3d)
      3e02ee9b
    • D
      network: split setup of ipv4 and ipv6 top level chains · 095c4503
      Daniel P. Berrangé 提交于
      During startup libvirtd creates top level chains for both ipv4
      and ipv6 protocols. If this fails for any reason then startup
      of virtual networks is blocked.
      
      The default virtual network, however, only requires use of ipv4
      and some servers have ipv6 disabled so it is expected that ipv6
      chain creation will fail. There could equally be servers with
      no ipv4, only ipv6.
      
      This patch thus makes error reporting a little more fine grained
      so that it works more sensibly when either ipv4 or ipv6 is
      disabled on the server. Only the protocols that are actually
      used by the virtual network have errors reported.
      Reviewed-by: NAndrea Bolognani <abologna@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      (cherry picked from commit 686803a1)
      095c4503
    • D
      network: improve error report when firewall chain creation fails · b990740b
      Daniel P. Berrangé 提交于
      During startup we create some top level chains in which all
      virtual network firewall rules will be placed. The upfront
      creation is done to avoid slowing down creation of individual
      virtual networks by checking for chain existance every time.
      
      There are some factors which can cause this upfront creation
      to fail and while a message will get into the libvirtd log
      this won't be seen by users who later try to start a virtual
      network. Instead they'll just get a message saying that the
      libvirt top level chain does not exist. This message is
      accurate, but unhelpful for solving the root cause.
      
      This patch thus saves any error during daemon startup and
      reports it when trying to create a virtual network later.
      Reviewed-by: NAndrea Bolognani <abologna@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      (cherry picked from commit 9f4e35dc)
      b990740b
    • D
      storage: add support for new rbd_list2 method · e8ec2592
      Daniel P. Berrangé 提交于
      The rbd_list method has been deprecated in Ceph >= 14.0.0
      in favour of the new rbd_list2 method which populates an
      array of structs.
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      (cherry picked from commit 3aa190f2)
      e8ec2592
    • D
      storage: split off code for calling rbd_list · 092320f1
      Daniel P. Berrangé 提交于
      The rbd_list method has a quite unpleasant signature returning an
      array of strings in a single buffer instead of an array. It is
      being deprecated in favour of rbd_list2. To maintain clarity of
      code when supporting both APIs in parallel, split the rbd_list
      code out into a separate method.
      
      In splitting this we now honour the rbd_list failures.
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      (cherry picked from commit 28c8403e)
      092320f1
  5. 04 3月, 2019 1 次提交
  6. 01 3月, 2019 2 次提交
    • E
      news: More 5.1 updates · d542b454
      Eric Blake 提交于
      Mention my snapshot bug fixes, and the corresponding virsh command-line
      parse tweak I added while working on the snapshot bug fixes.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      d542b454
    • E
      qemu: Fix snapshot redefine vs. domain state bug · 3926d0aa
      Eric Blake 提交于
      The existing qemu snapshot code has a slight bug: if the domain
      is currently pmsuspended, you can't use the _REDEFINE flag even
      though the current domain state should have no bearing on being
      able to recreate metadata state; and conversely, you can use the
      _REDEFINE flag to create snapshot metadata claiming to be
      pmsuspended as a bypass to the normal restrictions that you can't
      create an original qemu snapshot in that state (the restriction
      against pmsuspend is specific to qemu, rather than part of the
      driver-agnostic snapshot_conf code).
      
      Fix this by checking the snapshot state (when redefining) instead
      of the domain state (which is a subset of snapshot states).
      
      Fixes the second problem mentioned in https://bugzilla.redhat.com/1680304Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      3926d0aa
  7. 28 2月, 2019 7 次提交
  8. 27 2月, 2019 4 次提交
    • E
      snapshot: Permit redefine of offline external snapshot · dafef600
      Eric Blake 提交于
      Due to historical back-compat, bare 'virsh snapshot-create-as'
      favors internal snapshots (but can't be used on domains with raw
      storage), while 'virsh snapshot-create-as --disk-only' favors
      external snapshots.  What's more, snapshots created with
      --disk-only while the domain was running are marked as snapshot
      state 'disk-snapshot', while snapshots created while the domain
      was offline are marked as snapshot state 'shutdown' (a
      'disk-snapshot' image might not be quiescent, while a 'shutdown'
      snapshot always is).
      
      But this leads to some interesting problems: if we create a
      --disk-only snapshot of an offline guest, and then immediately try
      to 'virsh snapshot-create --redefine' using the resulting XML to
      overwrite the existing snapashot in place, things silently succeed,
      but 'virsh snapshot-create --redefine --disk-only' fails with an
      error message that the snapshot state is not 'disk-only'.  Worse,
      if we delete the snapshot metadata first and then try to recreate
      things, omitting --disk-only fails because the verification code
      wants to force the default of an internal snapshot (which doesn't
      work with raw disks), and using --disk-only still fails because the
      snapshot XML is not 'disk-only' - making it impossible to recreate
      the snapshot metadata (or to transfer it from one libvirtd host to
      another).  Ideally, the presence or absence of the --disk-only
      flag, and the presence or absence of an existing snapshot being
      overwritten, shouldn't matter; if the XML is valid for one
      situation, it should always be valid to redefine the metadata for
      that snapshot.
      
      Fix things by uniformly using virDomainSnapshotDefIsExternal()
      (caching the results up front, and eliminating other 'if' clauses
      now rendered redundant) when deciding whether the XML being
      requested for redefinition should permit external or force internal
      state capture (we got it right in only one out of three places in
      the function).
      
      See also https://bugzilla.redhat.com/1680304; this fixes the
      domain-agnostic problems mentioned there, but another patch is
      needed to fix further oddities with the qemu driver.  I did not
      check for sure when the problems were introduced (git blame puts
      some affected hunks as far back as 1.0.0), but it was definitely
      been broken even before when commit 670e86bf (1.1.4) factored
      redefine prep out of qemu code into the common snapshot_conf code.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      dafef600
    • E
      snapshots: Avoid term 'checkpoint' for full system snapshot · d152c727
      Eric Blake 提交于
      Upcoming patches plan to introduce virDomainCheckpointPtr as a new
      object for use in incremental backups, along with documentation on
      how incremental backups differ from snapshots.  But first, we need
      to rename any existing mention of a 'system checkpoint' to instead
      be a 'full system snapshot', so that we aren't overloading
      the term checkpoint.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      d152c727
    • E
      virsh: Elide backslash-newline in batch mode · 5817dec0
      Eric Blake 提交于
      The previous patch made it possible to split multiple commands by
      adding newline, but not to split a long single command. The sequence
      backslash-newline was being used as if it were a quoted newline
      character, rather than completely elided the way the shell does.
      
      Again, add more tests, although this time it seems more like I am
      suffering from a leaning-toothpick syndrome with all the \.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      5817dec0
    • E
      virsh: Treat \n like ; in batch mode · fe1b683f
      Eric Blake 提交于
      I wanted to do a demonstration with virsh batch mode, which
      takes multiple commands all packed into a single argument:
      
      $ virsh -c test:///default 'echo a; echo b;'
      a
      b
      
      but that produced a really long line, so I tried to make it
      more legible:
      
      $ virsh -c test:///default '
         echo a;
         echo b;
      '
      error: unknown command: '
      '
      
      Let's be more like the shell, and treat unquoted newline as a
      command separator just as we do for semicolon.  In fact, with
      that, I can even now mix styles:
      
      $ virsh -c test:///default '
         echo a; echo b
         echo c
      '
      a
      b
      c
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      fe1b683f
  9. 26 2月, 2019 2 次提交
  10. 25 2月, 2019 8 次提交