1. 25 11月, 2013 7 次提交
  2. 22 11月, 2013 3 次提交
    • J
      Don't start a nested job in qemuMigrationPrepareAny · 98464021
      Ján Tomko 提交于
      This nested job is canceled by the first ExitMonitor call (even though
      it was not created by the corresponding EnterMonitor call), and
      again in qemuMigrationPrepareAny if qemuProcessStart failed.
      This can lead to a crash if the vm object was disposed of before calling
      qemuDomainRemoveInactive:
      0  ..62bc in virClassIsDerivedFrom (klass=0xdeadbeef,
         parent=0x7ffce4cdd270) at util/virobject.c:166
      1 ..6666 in virObjectIsClass at util/virobject.c:362
      2 ..66b4 in virObjectLock at util/virobject.c:314
      3 ..477e in virDomainObjListRemove at conf/domain_conf.c:2359
      4 ..7a64 in qemuDomainRemoveInactive at qemu/qemu_domain.c:2087
      5 ..956c in qemuMigrationPrepareAny at qemu/qemu_migration.c:2469
      
      This was added by commit e4e28220, exposed by 5a4c2374 and c7ac2519.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1018267
      98464021
    • M
      virDomainReboot: Document that migration might be unsafe · cc38d68d
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=744967
      
      If a domain is rebooting and a migrate API is called meanwhile we would
      have to transfer the fakeReboot attribute to the destination in order to
      prevent domain doing plain shutdown over there. We shouldn't try to do
      anything clever about it other than documenting this as a known
      limitation.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      cc38d68d
    • E
      storage: use valid XML for awkward volume names · 6cc4d6a3
      Eric Blake 提交于
      $ touch /var/lib/libvirt/images/'a<b>c'
      $ virsh pool-refresh default
      $ virsh vol-dumpxml 'a<b>c' default | head -n2
      <volume>
        <name>a<b>c</name>
      
      Oops.  That's not valid XML.  And when we fix the XML
      generation, it fails RelaxNG validation.
      
      I'm also tired of seeing <key>(null)</key> in the example
      output for volume xml; while we used NULLSTR() to avoid
      a NULL deref rather than relying on glibc's printf
      extension behavior, it's even better if we avoid the issue
      in the first place.  But this requires being careful that
      we don't invalidate any storage backends that were relying
      on key being unassigned during virStoragVolCreateXML[From].
      
      I would have split this into two patches (one for escaping,
      one for avoiding <key>(null)</key>), but since they both
      end up touching a lot of the same test files, I ended up
      merging it into one.
      
      Note that this patch allows pretty much any volume name
      that can appear in a directory (excluding . and .. because
      those are special), but does nothing to change the current
      (unenforced) RelaxNG claim that pool names will consist
      only of letters, numbers, _, -, and +.  Tightening the C
      code to match RelaxNG patterns and/or relaxing the grammar
      to match the C code for pool names is a task for another
      day (but remember, we DID recently tighten C code for
      domain names to exclude a leading '.').
      
      * src/conf/storage_conf.c (virStoragePoolSourceFormat)
      (virStoragePoolDefFormat, virStorageVolTargetDefFormat)
      (virStorageVolDefFormat): Escape user-controlled strings.
      (virStorageVolDefParseXML): Parse key, for use in unit tests.
      * src/storage/storage_driver.c (storageVolCreateXML)
      (storageVolCreateXMLFrom): Ensure parsed key doesn't confuse
      volume creation.
      * docs/schemas/basictypes.rng (volName): Relax definition.
      * tests/storagepoolxml2xmltest.c (mymain): Test it.
      * tests/storagevolxml2xmltest.c (mymain): Likewise.
      * tests/storagepoolxml2xmlin/pool-dir-naming.xml: New file.
      * tests/storagepoolxml2xmlout/pool-dir-naming.xml: Likewise.
      * tests/storagevolxml2xmlin/vol-file-naming.xml: Likewise.
      * tests/storagevolxml2xmlout/vol-file-naming.xml: Likewise.
      * tests/storagevolxml2xmlout/vol-*.xml: Fix fallout.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      6cc4d6a3
  3. 21 11月, 2013 14 次提交
    • W
      docs: delete extra character · 09f23952
      Wangyufei (A) 提交于
      delete extra character 'p' from the comment of virInterfaceCreate
      Signed-off-by: NWang Yufei <james.wangyufei@huawei.com>
      09f23952
    • E
      qemu: Auto-generate controller for hotplugged hostdev · 881eb780
      Eric Farman 提交于
      If a SCSI hostdev is included in an initial domain XML, without a
      corresponding controller statement, one is created silently when the
      guest is booted.
      
      When hotplugging a SCSI hostdev, a presumption is that the controller
      is already present in the domain either from the original XML, or via
      an earlier hotplug.
      
        [root@xxxxxxxx ~]# cat disk.xml
        <hostdev mode='subsystem' type='scsi'>
          <source>
            <adapter name='scsi_host0'/>
            <address bus='0' target='3' unit='1088438288'/>
          </source>
        </hostdev>
        [root@xxxxxxxx ~]# virsh attach-device guest01 disk.xml
        error: Failed to attach device from disk.xml
        error: internal error: unable to execute QEMU command 'device_add': Bus 'scsi0.0' not found
      
      Since the infrastructure is in place, we can also create a controller
      silently for use by the hotplugged hostdev device.
      Signed-off-by: NEric Farman <farman@linux.vnet.ibm.com>
      881eb780
    • E
      qemu: Separate calls based on controller bus type · 6f22f95f
      Eric Farman 提交于
      For systems without a PCI bus, attaching a SCSI controller fails:
      
        [root@xxxxxxxx ~]# cat controller.xml
        <controller type='scsi' model='virtio-scsi' index='0' />
        [root@xxxxxxxx ~]# virsh attach-device guest01 controller.xml
        error: Failed to attach device from controller.xml
        error: XML error: No PCI buses available
      
      A similar problem occurs with the detach of a controller:
      
        [root@xxxxxxxx ~]# virsh detach-device guest01 controller.xml
        error: Failed to detach device from controller.xml
        error: operation failed: controller scsi:0 not found
      
      The qemuDomainXXtachPciControllerDevice routines made assumptions
      that any caller had a PCI bus.  These routines now selectively calls
      PCI functions where necessary, and assigns the device information
      type to one appropriate for the bus in use.
      Signed-off-by: NEric Farman <farman@linux.vnet.ibm.com>
      Signed-off-by: NJán Tomko <jtomko@redhat.com>
      6f22f95f
    • E
      qemu: Rename controller hotplug functions to not be PCI-specific · 271eb058
      Eric Farman 提交于
      For attach/detach of controller devices, we rename the functions to
      remove 'PCI' from their title.  The actual separation of PCI-specific
      operations will be handled in the next patch.
      Signed-off-by: NEric Farman <farman@linux.vnet.ibm.com>
      271eb058
    • O
      storage: Returns earlier if source adapter of the scsi pool is a HBA · b96651de
      Osier Yang 提交于
      It makes no sense to go forward to get the parent host number of a
      HBA, and treat the HBA as a vHBA with trying to delete it.
      Signed-off-by: NOsier Yang <jyang@redhat.com>
      b96651de
    • C
      qemu: Add support for virt machine type with virtio-mmio devices on armv7 · c7ccd2c4
      Clark Laughlin 提交于
      These changes allow the correct virtio-blk-device and virtio-net-device
      devices to be used for the 'virt' machine type for armv7 rather than the
      PCI virtio devices.
      
      A test case was added to qemuxml2argvtest for this change.
      Signed-off-by: NClark Laughlin <clark.laughlin@linaro.org>
      c7ccd2c4
    • E
      maint: fix comma style issues: remaining code · e44a9a70
      Eric Blake 提交于
      Most of our code base uses space after comma but not before;
      fix the remaining uses before adding a syntax check.
      
      * src/network/bridge_driver.c: Consistently use commas.
      * src/node_device/node_device_hal.c: Likewise.
      * src/node_device/node_device_udev.c: Likewise.
      * src/storage/storage_backend_rbd.c: Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      e44a9a70
    • E
      maint: fix comma style issues: remaining drivers · 64b2335c
      Eric Blake 提交于
      Most of our code base uses space after comma but not before;
      fix the remaining uses before adding a syntax check.
      
      * src/lxc/lxc_container.c: Consistently use commas.
      * src/openvz/openvz_driver.c: Likewise.
      * src/openvz/openvz_util.c: Likewise.
      * src/remote/remote_driver.c: Likewise.
      * src/test/test_driver.c: Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      64b2335c
    • E
      maint: fix comma style issues: vbox · eeed3bc6
      Eric Blake 提交于
      Most of our code base uses space after comma but not before;
      fix the remaining uses before adding a syntax check.
      
      * src/vbox/vbox_tmpl.c: Consistently use commas.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      eeed3bc6
    • E
      maint: fix comma style issues: util · c7c84fa5
      Eric Blake 提交于
      Most of our code base uses space after comma but not before;
      fix the remaining uses before adding a syntax check.
      
      * src/util/vircommand.c: Consistently use commas.
      * src/util/virlog.c: Likewise.
      * src/util/virnetdevbandwidth.c: Likewise.
      * src/util/virnetdevmacvlan.c: Likewise.
      * src/util/virnetdevvportprofile.c: Likewise.
      * src/util/virnetlink.c: Likewise.
      * src/util/virpci.c: Likewise.
      * src/util/virsysinfo.c: Likewise.
      * src/util/virusb.c: Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      c7c84fa5
    • E
      maint: fix comma style issues: qemu · 5d509e9e
      Eric Blake 提交于
      Most of our code base uses space after comma but not before;
      fix the remaining uses before adding a syntax check.
      
      * src/qemu/qemu_cgroup.c: Consistently use commas.
      * src/qemu/qemu_command.c: Likewise.
      * src/qemu/qemu_conf.c: Likewise.
      * src/qemu/qemu_driver.c: Likewise.
      * src/qemu/qemu_monitor.c: Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      5d509e9e
    • E
      maint: fix comma style issues: xen · 86f6748b
      Eric Blake 提交于
      Most of our code base uses space after comma but not before;
      fix the remaining uses before adding a syntax check.
      
      * src/libxl/libxl_driver.c: Consistently use commas.
      * src/xen/xend_internal.c: Likewise.
      * src/xen/xs_internal.c: Likewise.
      * src/xenapi/xenapi_driver.c: Likewise.
      * src/xenapi/xenapi_utils.c: Likewise.
      * src/xenxs/xen_sxpr.c: Likewise.
      * src/xenxs/xen_xm.c: Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      86f6748b
    • E
      maint: fix comma style issues: conf · 6f4901e1
      Eric Blake 提交于
      Most of our code base uses space after comma but not before;
      fix the remaining uses before adding a syntax check.
      
      * src/conf/capabilities.c: Consistently use commas.
      * src/conf/domain_conf.c: Likewise.
      * src/conf/network_conf.c: Likewise.
      * src/conf/storage_conf.c: Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      6f4901e1
    • E
      maint: fix comma style issues: nwfilter · f5690336
      Eric Blake 提交于
      Most of our code base uses space after comma but not before;
      fix the remaining uses before adding a syntax check.
      
      * src/nwfilter/nwfilter_ebiptables_driver.c: Consistently use
      commas.
      * src/nwfilter/nwfilter_gentech_driver.c: Likewise.
      * src/nwfilter/nwfilter_learnipaddr.c: Likewise.
      * src/conf/nwfilter_conf.c: Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      f5690336
  4. 20 11月, 2013 5 次提交
  5. 19 11月, 2013 4 次提交
  6. 18 11月, 2013 5 次提交
    • D
      Avoid async signal safety problem in glibc's setxid · 3563c51d
      Daniel P. Berrange 提交于
      The glibc setxid is supposed to be async signal safe, but
      libc developers confirm that it is not. This causes a problem
      when libvirt_lxc starts the FUSE thread and then runs clone()
      to start the container. If the clone() was done before the
      FUSE thread has completely started up, then the container
      will hang in setxid after clone().
      
      The fix is to avoid creating any threads until after the
      container has been clone()'d. By avoiding any threads in
      the parent, the child is no longer required to run in an
      async signal safe context, and we thus avoid the glibc
      bug.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      3563c51d
    • J
      Return -1 in virPortAllocatorAcquire if all ports are used · 8c41794a
      Ján Tomko 提交于
      Report the error in virPortAllocatorAcquire instead
      of doing it in every caller.
      
      The error contains the port range name instead of the intended
      use for the port, e.g.:
      Unable to find an unused port in range 'display' (65534-65535)
      instead of:
      Unable to find an unused port for SPICE
      
      This also adds error reporting when the QEMU driver could not
      find an unused port for VNC, VNC WebSockets or NBD migration.
      8c41794a
    • J
      Add a name to virPortAllocator · d16d90fd
      Ján Tomko 提交于
      This allows its error messages to be more specific.
      d16d90fd
    • J
      Don't release spice port twice when no TLS port is available · 28ea39a0
      Ján Tomko 提交于
      Introduced by 7b4a6304.
      28ea39a0
    • J
      Properly unref a connection with a close callback · e68432e4
      Ján Tomko 提交于
      The connection pointer in the closeCallback data was never
      initialized, making the unref in remoteClientCloseFunc a no-op.
      
      This fixes the following leak in virsh when the daemon closes
      the connection unexpectedly:
      
      1,179 (288 direct, 891 indirect) bytes in 1 blocks are
         definitely lost in loss record 745 of 792
        at 0x4C2A6D0: calloc (in vgpreload_memcheck-amd64-linux.so)
        by 0x4E9643D: virAllocVar (viralloc.c:558)
        by 0x4ED2425: virObjectNew (virobject.c:190)
        by 0x4F675AC: virGetConnect (datatypes.c:116)
        by 0x4F6EA06: do_open (libvirt.c:1136)
        by 0x4F71017: virConnectOpenAuth (libvirt.c:1481)
        by 0x129FFA: vshReconnect (virsh.c:337)
        by 0x128310: main (virsh.c:2470)
      e68432e4
  7. 15 11月, 2013 2 次提交