1. 10 6月, 2020 15 次提交
  2. 09 6月, 2020 5 次提交
  3. 05 6月, 2020 2 次提交
    • D
      5263160f
    • L
      qemu: don't reject interface update when switching to/from bridged network · bc85c34e
      Laine Stump 提交于
      If virDomainUpdateDeviceFlags() was used to update an <interface>, and
      the interface type changed from type='network' where the network was
      an unmanaged bridge (so actualType == bridge) to type='bridge'
      (i.e. actualType *also* == bridge), the update would fail due to the
      perceived change in type.
      
      In practice it is okay to switch between any interface types that end
      up using a tap device, since libvirt just needs to attach the device
      to a new bridge. But in this case we were erroneously rejecting it due
      to a conditional that was too restrictive. This is what the code was doing:
      
        if (old->type != new->type)
           [allow update]
        else
           if ((oldActual == bridge and newActual == network)
               || (oldActual == network and newActual == bridge)) {
               [allow update]
           else
               [error]
      
      In the case described above though, old->type and new->type don't match,
      but oldActual and newActual are both 'bridge', so we get an error.
      
      This patch changes the inner conditional so that any combination of
      'network' and 'bridge' for oldActual and newActual, since they both
      use a tap device connected to a bridge.
      Signed-off-by: NLaine Stump <laine@redhat.com>
      Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
      bc85c34e
  4. 04 6月, 2020 4 次提交
    • D
      conf: fix alignment in virObjectEvent to be 8 not 4 bytes · 2ac42f02
      Daniel P. Berrangé 提交于
      The previous fix accidentally picked up a debug change that put
      alignment back at 4, not 8, bytes as it claimed:
      
        commit 37ae0426
        Author: Daniel P. Berrangé <berrange@redhat.com>
        Date:   Wed Jun 3 11:18:23 2020 +0100
      
          conf: force 8 byte alignment for virObjectEvent
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      2ac42f02
    • D
      conf: force 8 byte alignment for virObjectEvent · 37ae0426
      Daniel P. Berrangé 提交于
      We need to be able to cast from virObjectEventPtr to one of
      its many subclasses. Some of these subclasses have 8 byte
      alignment on 32-bit platforms, but virObjectEventPtr only
      has 4 byte alignment.
      
      Previously the virObject base class had 8 byte alignment
      but this dropped to 4 byte when converted to inherit from
      GObject. This introduces cast alignment warnings on 32-bit:
      
      ../../src/conf/domain_event.c: In function 'virDomainEventDispatchDefaultFunc':
      ../../src/conf/domain_event.c:1656:30: error: cast increases required alignment of target type [-Werror=cast-align]
       1656 |             rtcChangeEvent = (virDomainEventRTCChangePtr)event;
            |                              ^
      ../../src/conf/domain_event.c:1785:34: error: cast increases required alignment of target type [-Werror=cast-align]
       1785 |             balloonChangeEvent = (virDomainEventBalloonChangePtr)event;
            |                                  ^
      ../../src/conf/domain_event.c:1896:35: error: cast increases required alignment of target type [-Werror=cast-align]
       1896 |             blockThresholdEvent = (virDomainEventBlockThresholdPtr)event;
            |                                   ^
      ../../src/conf/domain_event.c: In function 'virDomainQemuMonitorEventDispatchFunc':
      ../../src/conf/domain_event.c:1974:24: error: cast increases required alignment of target type [-Werror=cast-align]
       1974 |     qemuMonitorEvent = (virDomainQemuMonitorEventPtr)event;
            |                        ^
      ../../src/conf/domain_event.c: In function 'virDomainQemuMonitorEventFilter':
      ../../src/conf/domain_event.c:2179:20: error: cast increases required alignment of target type [-Werror=cast-align]
       2179 |     monitorEvent = (virDomainQemuMonitorEventPtr) event;
            |                    ^
      
      Forcing 8-byte alignment on virObjectEventPtr removes the
      alignment increase during casts to subclasses.
      Reviewed-by: NPavel Hrdina <phrdina@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      37ae0426
    • M
      Use more of VIR_XPATH_NODE_AUTORESTORE · d3a7479c
      Michal Privoznik 提交于
      This is convenience macro, use it more. This commit was generated
      using the following spatch:
      
        @@
        symbol node;
        identifier old;
        identifier ctxt;
        type xmlNodePtr;
        @@
        - xmlNodePtr old;
        + VIR_XPATH_NODE_AUTORESTORE(ctxt);
          ...
        - old = ctxt->node;
          ... when != old
        - ctxt->node = old;
      
        @@
        symbol node;
        identifier old;
        identifier ctxt;
        type xmlNodePtr;
        @@
        - xmlNodePtr old = ctxt->node;
        + VIR_XPATH_NODE_AUTORESTORE(ctxt);
          ... when != old
        - ctxt->node = old;
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      d3a7479c
    • M
      virxml: Don't overwrite ctxt->node · 52351030
      Michal Privoznik 提交于
      This reverts b897973f
      
      Even though it may have been the case in the past, relative
      XPaths don't overwrite the ctxt->node. Thus, there's no need to
      save it.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      52351030
  5. 03 6月, 2020 9 次提交
  6. 02 6月, 2020 1 次提交
  7. 01 6月, 2020 1 次提交
  8. 27 5月, 2020 1 次提交
    • C
      security: don't fail if built without attr support · 55029d93
      Christian Ehrhardt 提交于
      If built without attr support removing any image will trigger
       qemuBlockRemoveImageMetadata (the one that emits the warning)
         -> qemuSecurityMoveImageMetadata
           -> virSecurityManagerMoveImageMetadata
             -> virSecurityDACMoveImageMetadata
               -> virSecurityDACMoveImageMetadataHelper
                 -> virProcessRunInFork (spawns subprocess)
                   -> virSecurityMoveRememberedLabel
      
      In there due to !HAVE_LIBATTR virFileGetXAttrQuiet will return
      ENOSYS and from there the chain will error out.
      
      That is wrong and looks like:
        libvirtd[6320]: internal error: child reported (status=125):
        libvirtd[6320]: Unable to remove disk metadata on vm testguest from
        /var/lib/uvtool/libvirt/images/testguest.qcow (disk target vda)
      
      This change makes virSecurityDACMoveImageMetadataHelper and
      virSecuritySELinuxMoveImageMetadataHelper accept that
      error code gracefully and in that sense it is an extension of:
      5214b2f1 "security: Don't skip label restore on file systems lacking XATTRs"
      which does the same for other call chains into the virFile*XAttr functions.
      Signed-off-by: NChristian Ehrhardt <christian.ehrhardt@canonical.com>
      Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
      55029d93
  9. 26 5月, 2020 2 次提交