1. 11 7月, 2014 2 次提交
  2. 10 7月, 2014 2 次提交
  3. 09 7月, 2014 32 次提交
    • M
      qemu: don't error out when cgroups don't exist · 0c04906f
      Martin Kletzander 提交于
      When creating cgroups for vcpu and emulator threads whilst starting a
      domain, we explicitly skip creating those cgroups in case priv->cgroup
      is NULL (cgroups not supported) because SetAffinity() serves the same
      purpose.  If the host supports only some cgroups (the ones we need are
      either unmounted or disabled in qemu.conf), we error out with weird
      message even though we could continue starting the domain.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1097028Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      0c04906f
    • P
      util: storage: Fix build after 25924dec · 61e45dfb
      Peter Krempa 提交于
      The commit referenced above changed function arguments of
      virStorageFileGetMetadataFromBuf() but didn't tweak the
      ATTRIBUTE_NONNULL tied to them. This was caught by coverity as it
      actually obeys them. We disabled them for GCC and thus it didn't show
      up.
      
      Additionally in commit 3ea661de I passed
      NULL to the backingFormat argument which was also marked as nonnull. Use
      a dummy int's address when the argument isn't supplied so that the code
      doesn't need to change much.
      61e45dfb
    • P
      conf: Improve metadata type verification · 37381666
      Peter Krempa 提交于
      Split out checking of invalid metadata type from the switch statement so
      that we can use the typecasted enum value to allow tracking addition of
      new items by the compliler.
      
      Also avoids two dead-code break statements.
      37381666
    • J
      qemu: fix domxml-to-native failing when spice_tls is not enabled · e871ab88
      Jincheng Miao 提交于
      The default graphics channel mode is 'any', so as to defaultMode attribute.
      If defaultMode and channel mode are all the default value 'any',
      qemuConnectDomainXMLToNative will set TLSPort.
      But in qemuBuildGraphicsSPICECommandLine, if spice_tls is not enabled, libvirtd
      will report an error to tell the user that spice TLS is disabled in qemu.conf.
      
      So qemuConnectDomainXMLToNative should check spice_tls is enabled,
      then decide to allocate an tlsPort number to this graphics.
      
      If user specified defaultMode is 'secure', qemuConnectDomainXMLToNative
      could allocate tlsPort, and then let qemuBuildGraphicsSPICECommandLine reports
      the spice_tls disabled error.
      
      The related bug is:
      https://bugzilla.redhat.com/show_bug.cgi?id=1113868Signed-off-by: NJincheng Miao <jmiao@redhat.com>
      Signed-off-by: NJán Tomko <jtomko@redhat.com>
      e871ab88
    • P
      qemu: snapshot: Refactor image labelling of new snapshot files · 52c21204
      Peter Krempa 提交于
      Now that cgroups/security driver/locking driver support labelling of
      individual images and tolerate network storage we don't have to refrain
      from passing all image files to it. This allows removing the checking
      code as we already make sure that the snapshot function won't be called
      with unsupported options.
      52c21204
    • P
      qemu: Refactor qemuDomainPrepareDiskChainElement · 66df8bf4
      Peter Krempa 提交于
      Now that security, cgroup and locking APIs support working on individual
      images and we track the backing chain security info on a per-image basis
      we can finally kill swapping the disk source in virDomainDiskDef and use
      the virStorageSource directly.
      66df8bf4
    • P
      qemu: snapshot: Improve approach to deal with snapshot metadata · 363e9a68
      Peter Krempa 提交于
      Until now we were changing information about the disk source via
      multiple steps of copying data. Now that we changed to a pointer to
      store the disk source we might use it to change the approach to track
      the data.
      
      Additionally this will allow proper tracking of the backing chain.
      363e9a68
    • P
      qemu: block: Properly track disk source while pivoting to new image · 4cc1f1a0
      Peter Krempa 提交于
      When pivoting to a new disk source after a block commit (and possibly
      after a soon-to-be-added active block commit) we changed just a few
      fields to the new target. In case we'd copy a network disk to a local
      file we'd not change the type properly.
      
      To avoid such problems, switch to tracking of the source via changing of
      the complete source struct to the one tracking the mirroring info.
      4cc1f1a0
    • P
      qemu: blockcopy: Use the mirror disk source to label the files · 9ff75a85
      Peter Krempa 提交于
      Use the source struct and the corresponding function so that we can
      avoid using the path separately. Now that
      qemuDomainPrepareDiskChainElementPath isn't use anywhere, we can safely
      remove it.
      
      Additionally, the removal fixes a misaligned comment as the removed
      function was added under a comment for a different function.
      9ff75a85
    • P
      util: storage: Return complete parent info from virStorageFileChainLookup · 75017710
      Peter Krempa 提交于
      Instead of just returning the parent path, return the complete parent
      source structure.
      75017710
    • P
      util: storage: Make virStorageFileChainLookup more network storage aware · 09cea692
      Peter Krempa 提交于
      Add a few checks and avoid resolving relative links on networked
      storage.
      09cea692
    • P
      security: AppArmor: Implement per-image seclabel set · cd7b63e6
      Peter Krempa 提交于
      Refactor the code and reuse it to implement the functionality.
      cd7b63e6
    • P
      security: AppArmor: Implement per-image seclabel restore · 15cad657
      Peter Krempa 提交于
      Refactor the existing code to allow re-using it for the per-image label
      restore too.
      15cad657
    • P
      security: DAC: Implement per-image seclabel set · 7077cfef
      Peter Krempa 提交于
      Refactor the code and reuse it to implement the functionality.
      7077cfef
    • P
      security: DAC: Implement per-image seclabel restore · 4f2170dc
      Peter Krempa 提交于
      Refactor the existing code to allow re-using it for the per-image label
      restore too.
      4f2170dc
    • P
      security: selinux: Implement per-image seclabel set · 49839317
      Peter Krempa 提交于
      Refactor the code and reuse it to implement the functionality.
      49839317
    • P
      security: selinux: Implement per-image seclabel restore · b2790e33
      Peter Krempa 提交于
      Refactor the existing code to allow re-using it for the per-image label
      restore too.
      b2790e33
    • P
      security: Introduce APIs to label single images · 1797128e
      Peter Krempa 提交于
      Add security driver functions to label separate storage images using the
      virStorageSource definition. This will help to avoid the need to do ugly
      changes to the disk struct and use the source directly.
      1797128e
    • P
      locking: Add APIs to lock individual image files · 68f0deb0
      Peter Krempa 提交于
      Add helper APIs to manage individual image files rather than disks. To
      simplify the addition some parts of the code were refactored in this
      patch.
      68f0deb0
    • P
      qemu: cgroup: Setup only the top level disk image for read-write access · 1ba14d6d
      Peter Krempa 提交于
      Only the top level gets writes, so the rest of the backing chain
      requires only read-only access.
      1ba14d6d
    • P
      qemu: cgroup: Add functions to set cgroup image stuff on individual imgs · aa53c77e
      Peter Krempa 提交于
      Add functions that will allow to set all the required cgroup stuff on
      individual images taking a virStorageSourcePtr. Also convert functions
      designed to setup whole backing chain to take advantage of the change.
      aa53c77e
    • M
      virEventPollDispatchHandles: Honour array boundaries · 52f50a71
      Michal Privoznik 提交于
      When dispatching events from the event loop, the array of registered
      handles is searched to see what handles happened an event on. However,
      the array is searched in weird way: the check for the array boundaries
      is at the end, so we may touch the elements after the end of the
      array:
      
      ==10434== Invalid read of size 4
      ==10434==    at 0x52D06B6: virEventPollDispatchHandles (vireventpoll.c:486)
      ==10434==    by 0x52D10E4: virEventPollRunOnce (vireventpoll.c:660)
      ==10434==    by 0x52CF207: virEventRunDefaultImpl (virevent.c:308)
      ==10434==    by 0x1639D1: virNetServerRun (virnetserver.c:1139)
      ==10434==    by 0x1220DC: main (libvirtd.c:1507)
      ==10434==  Address 0xc11ff04 is 4 bytes after a block of size 960 alloc'd
      ==10434==    at 0x4C2CA5E: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==10434==    by 0x52AD378: virReallocN (viralloc.c:245)
      ==10434==    by 0x52AD46E: virExpandN (viralloc.c:294)
      ==10434==    by 0x52AD5B1: virResizeN (viralloc.c:352)
      ==10434==    by 0x52CF2EC: virEventPollAddHandle (vireventpoll.c:116)
      ==10434==    by 0x52CEF5B: virEventAddHandle (virevent.c:78)
      ==10434==    by 0x11F69A90: nodeStateInitialize (node_device_udev.c:1797)
      ==10434==    by 0x53C3C89: virStateInitialize (libvirt.c:743)
      ==10434==    by 0x120563: daemonRunStateInit (libvirtd.c:919)
      ==10434==    by 0x5317719: virThreadHelper (virthread.c:197)
      ==10434==    by 0x8376F39: start_thread (in /lib64/libpthread-2.17.so)
      ==10434==    by 0x8A7F9FC: clone (in /lib64/libc-2.17.so)
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      52f50a71
    • P
      util: XML: Avoid forward function declaration · 036dd423
      Peter Krempa 提交于
      Recursive functions apparently don't need them, but I originally thought
      they do.
      036dd423
    • P
      util: cgroup: Fix build on non-cgroup platforms · 464f7678
      Peter Krempa 提交于
      Commit a48f4451 introduced a helper
      function to convert cgroup device mode to string. The function was only
      conditionally compiled on platforms that support cgroup. This broke the
      build when attempting to export the symbol:
      
        CCLD     libvirt.la
        Cannot export virCgroupGetDevicePermsString: symbol not defined
      
      Move the function out of the ifdef, as it doesn't really depend on the
      cgroup code being present.
      464f7678
    • J
      Allow updating names in DHCP hosts by matching IPs. · 2d49518a
      Ján Tomko 提交于
      Also fix the error message if an IPv6 host with no MAC
      is not found.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=991290
      2d49518a
    • J
    • J
      libxl: fix crash in migrate confirm for transient domains · 72a84539
      Jim Fehlig 提交于
      In libxlDomainMigrationConfirm(), a transient domain is removed
      from the domain list after successful migration.  Later in cleanup,
      the domain object is unlocked, resulting in a crash
      
      Program received signal SIGSEGV, Segmentation fault.
      [Switching to Thread 0x7fb4208ed700 (LWP 12044)]
      0x00007fb4267251e6 in virClassIsDerivedFrom (klass=0xdeadbeef,
        parent=0x7fb42830d0c0) at util/virobject.c:169
      169	        if (klass->magic == parent->magic)
      (gdb) bt
      0  0x00007fb4267251e6 in virClassIsDerivedFrom (klass=0xdeadbeef,
        parent=0x7fb42830d0c0) at util/virobject.c:169
      1  0x00007fb42672591b in virObjectIsClass (anyobj=0x7fb4100082b0,
        klass=0x7fb42830d0c0) at util/virobject.c:365
      2  0x00007fb42672583c in virObjectUnlock (anyobj=0x7fb4100082b0)
        at util/virobject.c:338
      3  0x00007fb41a8c7d7a in libxlDomainMigrationConfirm (driver=0x7fb4100404c0,
        vm=0x7fb4100082b0, flags=1, cancelled=0) at libxl/libxl_migration.c:583
      
      Fix by setting the virDomainObjPtr to NULL after removing it from
      the domain list.
      72a84539
    • J
      libxl: acquire job though begin phase only · bab7ad4c
      Jim Fehlig 提交于
      During migration, the libxl driver starts a modify job in the
      begin phase, ending the job in the confirm phase.  This is
      essentially VIR_MIGRATE_CHANGE_PROTECTION semantics, but the
      driver does not support that flag.  Without CHANGE_PROTECTION
      support, the job would never be terminated in error conditions
      where migrate confirm phase is not executed.  Further attempts
      to modify the domain would result in failure to acquire a job
      after LIBXL_JOB_WAIT_TIME.
      
      Similar to the qemu driver, end the job in the begin phase.
      Protecting the domain object across all phases of migration can
      be done in a future patch adding CHANGE_PROTECTION support.
      bab7ad4c
    • J
      libxl: remove domain when migration prepare fails · c4f66bb8
      Jim Fehlig 提交于
      In libxlDomainMigrationPrepare(), a new virDomainObj is created
      from the incoming domain def and added to the driver's domain
      list, but never removed if there are subsequent failures during
      the prepare phase.
      
      targethost# virsh list --all
      
      sourcehost# virsh migrate --live dom xen+ssh://targethost/system
         error: operation failed: Fail to create socket for incoming migration.
      
      targethost# virsh list --all
      error: Failed to list domains
      error: name in virGetDomain must not be NULL
      
      After adding code to remove the domain on prepare failure, noticed
      that libvirtd crashed due to double free of the virDomainDef.  Similar
      to the qemu driver, pass a pointer to virDomainDefPtr so it can be set
      to NULL once a virDomainObj is created from it.
      c4f66bb8
    • J
      libxl: rename goto label · 92cd6b67
      Jim Fehlig 提交于
      In libxlDomainMigrationPrepare(), the cleanup label handles error
      conditions and should be renamed as such for clarity.
      92cd6b67
    • C
      LXC: fix an improper comments for lxcDomainDestroyFlags · 110b959f
      Chen Hanxiao 提交于
      Currently @flag is not used yet.
      Signed-off-by: NChen Hanxiao <chenhanxiao@cn.fujitsu.com>
      110b959f
    • G
      qemu: raise an eror when using aio=native without cache=none · 05838400
      Giuseppe Scrivano 提交于
      Qemu will fallback to aio=threads when the cache mode doesn't use
      O_DIRECT, even if aio=native was explictly set.
      
      Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1086704Signed-off-by: NGiuseppe Scrivano <gscrivan@redhat.com>
      05838400
  4. 08 7月, 2014 4 次提交