1. 28 11月, 2012 1 次提交
    • D
      Fix error handling in virSecurityManagerGetMountOptions · 3f6470f7
      Daniel P. Berrange 提交于
      The impls of virSecurityManagerGetMountOptions had no way to
      return errors, since the code was treating 'NULL' as a success
      value. This is somewhat pointless, since the calling code did
      not want NULL in the first place and has to translate it into
      the empty string "". So change the code so that the impls can
      return "" directly, allowing use of NULL for error reporting
      once again
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      3f6470f7
  2. 27 11月, 2012 6 次提交
    • E
      storage: fix device detach regression with cgroup ACLs · 1b2ebf95
      Eric Blake 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=876828
      
      Commit 38c4a9cc introduced a regression in hot unplugging of disks
      from qemu, where cgroup device ACLs were no longer being revoked
      (thankfully not a security hole: cgroup ACLs only prevent open()
      of the disk; so reverting the ACL prevents future abuse but doesn't
      stop abuse from an fd that was already opened before the ACL change).
      
      The actual regression is due to a latent bug.  The hot unplug code
      was computing the set of files needing cgroup ACL revocation based
      on the XML passed in by the user, rather than based on the domain's
      details on which disk was being deleted.  As long as the revoke
      path was always recomputing the backing chain, this didn't really
      matter; but now that we want to compute the chain exactly once and
      remember that computation, we need to hang on to the backing chain
      until after the revoke has happened.
      
      * src/qemu/qemu_hotplug.c (qemuDomainDetachPciDiskDevice):
      Transfer backing chain before deletion.
      1b2ebf95
    • H
    • H
      qemu: Add support for gluster protocol based network storage backend. · c33c36d2
      Harsh Prateek Bora 提交于
      Qemu accepts gluster protocol as supported storage backend beside others.
      Signed-off-by: NHarsh Prateek Bora <harsh@linux.vnet.ibm.com>
      c33c36d2
    • H
      Add Gluster protocol as supported network disk backend · a2d2b80f
      Harsh Prateek Bora 提交于
      This patch introduces the RNG schema and updates necessary data strucutures
      to allow various hypervisors to make use of Gluster protocol as one of the
      supported network disk backend. Next patch will add support to make use of
      this feature in Qemu since it now supports Gluster protocol as one of the
      network based storage backend.
      
      Two new optional attributes for <host> element are introduced - 'transport'
      and 'socket'. Valid transport values are tcp, unix or rdma. If none specified,
      tcp is assumed. If transport is unix, socket specifies path to unix socket.
      
      This patch allows users to specify disks on gluster backends like this:
      
          <disk type='network' device='disk'>
            <driver name='qemu' type='raw'/>
            <source protocol='gluster' name='Volume1/image'>
              <host name='example.org' port='6000' transport='tcp'/>
            </source>
            <target dev='vda' bus='virtio'/>
          </disk>
      
          <disk type='network' device='disk'>
            <driver name='qemu' type='raw'/>
            <source protocol='gluster' name='Volume2/image'>
              <host transport='unix' socket='/path/to/sock'/>
            </source>
            <target dev='vdb' bus='virtio'/>
          </disk>
      Signed-off-by: NHarsh Prateek Bora <harsh@linux.vnet.ibm.com>
      a2d2b80f
    • E
      build: avoid C99 for loop · 7e5aa78d
      Eric Blake 提交于
      Although we require various C99 features, we don't yet require a
      complete C99 compiler.  On RHEL 5, compilation complained:
      
      qemu/qemu_command.c: In function 'qemuBuildGraphicsCommandLine':
      qemu/qemu_command.c:4688: error: 'for' loop initial declaration used outside C99 mode
      
      * src/qemu/qemu_command.c (qemuBuildGraphicsCommandLine): Declare
      variable sooner.
      * src/qemu/qemu_process.c (qemuProcessInitPasswords): Likewise.
      7e5aa78d
    • A
      Refactor ESX storage driver to implement facade pattern · 067e83eb
      Ata E Husain Bohra 提交于
      The patch refactors the current ESX storage driver due to following reasons:
      
      1. Given most of the public APIs exposed by the storage driver in Libvirt
      remains same, ESX storage driver should not implement logic specific
      for only one supported format (current implementation only supports VMFS).
      2. Decoupling interface from specific storage implementation gives us an
      extensible design to hook implementation for other supported storage
      formats.
      
      This patch refactors the current driver to implement it as a facade pattern i.e.
      the driver exposes all the public libvirt APIs, but uses backend drivers to get
      the required task done. The backend drivers provide implementation specific to
      the type of storage device.
      
      File changes:
      ------------------
      esx_storage_driver.c ----> esx_storage_driver.c (base storage driver)
                           |
                           |---> esx_storage_backend_vmfs.c (VMFS backend)
      067e83eb
  3. 26 11月, 2012 7 次提交
    • P
      lxc: Don't crash if no security driver is specified in libvirt_lxc · 99a388e6
      Peter Krempa 提交于
      When no security driver is specified libvirt_lxc segfaults as a debug
      message tries to access security labels for the container that are not
      present.
      
      This problem was introduced in commit 6c3cf57d.
      99a388e6
    • P
      lxc: Avoid segfault of libvirt_lxc helper on early cleanup paths · 81efb13b
      Peter Krempa 提交于
      Early jumps to the cleanup label caused a crash of the libvirt_lxc
      container helper as the cleanup section called
      virLXCControllerDeleteInterfaces(ctrl) without checking the ctrl argument
      for NULL. The argument was de-referenced soon after.
      
      $ /usr/libexec/libvirt_lxc
      /usr/libexec/libvirt_lxc: missing --name argument for configuration
      Segmentation fault
      81efb13b
    • A
      Add private data pointer to virStoragePool and virStorageVol · 2b121dbc
      Ata E Husain Bohra 提交于
      This will simplify the refactoring of the ESX storage driver to support
      a VMFS and an iSCSI backend.
      
      One of the tasks the storage driver needs to do is to decide which backend
      driver needs to be invoked for a given request. This approach extends
      virStoragePool and virStorageVol to store extra parameters:
      
      1. privateData: stores pointer to respective backend storage driver.
      2. privateDataFreeFunc: stores cleanup function pointer.
      
      virGetStoragePool and virGetStorageVol are modfied to accept these extra
      parameters as user params. virStoragePoolDispose and virStorageVolDispose
      checks for cleanup operation if available.
      
      The private data pointer allows the ESX storage driver to store a pointer
      to the used backend with each storage pool and volume. This avoids the need
      to detect the correct backend in each storage driver function call.
      2b121dbc
    • P
      cpu: Add Intel Haswell cpu model · bb2704e7
      Peter Krempa 提交于
      The new model supports following features in addition to those supported
      by SandyBridge:
      
      fma, pcid, movbe, fsgsbase, bmi1, hle, avx2, smep, bmi2, erms, invpcid,
      rtm
      bb2704e7
    • J
      storage: fix logical volume cloning · 70f0bbe8
      Ján Tomko 提交于
      Commit 258e06c8 removed setting of the volume type to
      VIR_STORAGE_VOL_BLOCK, which leads to failures in
      storageVolumeCreateXMLFrom.
      
      The type (and target.format) of the volume was set to zero. In
      virStorageBackendGetBuildVolFromFunction, this gets interpreted as
      VIR_STORAGE_FILE_NONE and the qemu-img tool is called with unknown
      "none" format.
      
      Bug: https://bugzilla.redhat.com/show_bug.cgi?id=879780
      70f0bbe8
    • J
      build: fix build --without-network · 5efacd78
      Ján Tomko 提交于
      bridge_driver.h: silence gcc warnings:
      statement with no effect [-Wunused-value]
      unused variable 'net' [-Wunused-variable]
      
      virdrivermoduletest.c: don't require network driver module
      if it hasn't been built.
      5efacd78
    • O
      util: Use virReportSystemError for system error in pci.c · a7035662
      Osier Yang 提交于
      a7035662
  4. 25 11月, 2012 1 次提交
  5. 23 11月, 2012 6 次提交
  6. 22 11月, 2012 13 次提交
    • P
      qemu: Stop recursive detection of image chains when an image is missing · 58a54dc3
      Peter Krempa 提交于
      Commit e0c469e5 that fixes the detection
      of image chain wasn't complete. Iteration through the backing image
      chain has to stop at the last existing image if some of the images are
      missing otherwise the backing chain that is cached contains entries with
      paths being set to NULL resulting to:
      
      error: Unable to allow access for disk path (null): Bad address
      
      Fortunately stat() is kind enough not to crash when it's presented with
      a NULL argument. At least on Linux.
      58a54dc3
    • M
      conf: Report sensible error for invalid disk name · 03cd6e4a
      Martin Kletzander 提交于
      The error "... but the cause is unknown" appeared for XMLs similar to
      this:
      
       <disk type='file' device='cdrom'>
         <driver name='qemu' type='raw'/>
         <source file='/dev/zero'/>
         <target dev='sr0'/>
       </disk>
      
      Notice unsupported disk type (for the driver), but also no address
      specified. The first part is not a problem and we should not abort
      immediately because of that, but the combination with the address
      unknown was causing an unspecified error.
      
      While fixing this, I added an error to one place where this return
      value was not managed properly.
      03cd6e4a
    • N
      build: trivial fix error: implicit declaration of function 'malloc' · 89ad205f
      Natanael Copa 提交于
      Fixes this error when building with -Werror on Alpine Linux:
      
      util/processinfo.c: In function 'virProcessInfoSetAffinity':
      util/processinfo.c:52:5: error: implicit declaration of function 'malloc' [-Werror=implicit-function-declaration]
      Signed-off-by: NNatanael Copa <ncopa@alpinelinux.org>
      89ad205f
    • D
      Log an audit message with the LXC init pid · a6158336
      Daniel P. Berrange 提交于
      Currently the LXC driver logs audit messages when a container
      is started or stopped. These audit messages, however, contain
      the PID of the libvirt_lxc supervisor process. To enable
      sysadmins to correlate with audit messages generated by
      processes /inside/ the container, we need to include the
      container init process PID.
      
      We can't do this in the main 'start' audit message, since
      the init PID is not available at that point. Instead we output
      a completely new audit record, that lists both PIDs.
      
      type=VIRT_CONTROL msg=audit(1353433750.071:363): pid=20180 uid=0 auid=501 ses=3 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='virt=lxc op=init vm="busy" uuid=dda7b947-0846-1759-2873-0f375df7d7eb vm-pid=20371 init-pid=20372 exe="/home/berrange/src/virt/libvirt/daemon/.libs/lt-libvirtd" hostname=? addr=? terminal=pts/6 res=success'
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      a6158336
    • D
      Use virNetServerRun instead of custom main loop · f33e43c2
      Daniel P. Berrange 提交于
      The LXC controller code currently directly invokes the
      libvirt main loop code. The problem is that this misses
      the cleanup of virNetServerClient connections that
      virNetServerRun takes care of.
      
      The result is that when libvirtd is stopped, the
      libvirt_lxc controller process gets stuck in a I/O loop.
      When libvirtd is then started again, it fails to connect
      to the controller and thus kills off the entire domain.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      f33e43c2
    • O
      storage: Improve virStorageBackendFileSystemStop · 104650db
      Osier Yang 提交于
      It's actually not used for DIR pool. So removing the checking.
      104650db
    • O
      storage: Fix bug of fs pool destroying · f4ac0656
      Osier Yang 提交于
      Regression introduced by commit 258e06c8, "ret" could be set to 1
      or 0 by virStorageBackendFileSystemIsMounted before goto cleanup.
      This could mislead the callers (up to the public API
      virStoragePoolDestroy) to return success even the underlying umount
      command fails.
      f4ac0656
    • S
      qemu: fix RBD attach regression · f0e72b2f
      Scott Sullivan 提交于
      I have been testing libvirt v1.0.0 for deployment within my
      organization, and in the process discovered what appears to be a bug
      that breaks virsh attach-device, when attaching an RBD volume to an
      instance. First, here is the error presented, with v1.0.0 (this worked
      in v0.10.2):
      
      [root@host ~]# virsh attach-device W5APQ8  G84VV1.xml
      error: Failed to attach device from G84VV1.xml
      error: cannot open file 'dc3-1-test/G84VV1': No such file or directory
      
      Using git bisect, I narrowed the problem down to this as the first
      commit to break this setup:
      
      4d34c929 is the first bad commit
      f0e72b2f
    • J
      tests: update qemuhelptest data · bb2f6216
      Ján Tomko 提交于
      Both generated with
      qemu-system-x86_64 --help > qemu-1.2.0
      
      qemu-system-x86_64 \
      -device ? \
      -device pci-assign,? \
      -device virtio-blk-pci,? \
      -device virtio-net-pci,? \
      -device scsi-disk,? \
      -device PIIX4_PM,? \
      -device usb-redir,? \
      -device ide-drive,? \
      -device usb-host,? 2> qemu-1.2.0-device
      
      It seems I missed a few -device flags when doing this last time and I
      mixed up qemu and qemu-kvm.
      bb2f6216
    • J
      c5834ec1
    • J
      docs: Fix a few spaces · e628dbfb
      Ján Tomko 提交于
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      e628dbfb
    • J
      docs: boot order for host and redirected USB devices · 08c1435f
      Ján Tomko 提交于
      08c1435f
    • J
      conf: add support for booting from redirected USB devices · cc244e24
      Ján Tomko 提交于
      Commit a4c19459 only added the
      QEMU capability flag, command line option and added the boot element
      for redirdev's in the XML schema.
      
      This patch adds support for parsing and writing the XML with redirdevs
      with the boot flag. It also ignores unknown XML elements in redirdev
      instead of failing with:
      "error: An error occurred, but the cause is unknown"
      
      Bug: https://bugzilla.redhat.com/show_bug.cgi?id=805414
      cc244e24
  7. 21 11月, 2012 4 次提交
  8. 20 11月, 2012 2 次提交
    • E
      snapshot: make cloning of domain definition easier · 0b5617a6
      Eric Blake 提交于
      Upcoming patches for revert-and-clone branching of snapshots need
      to be able to copy a domain definition; make this step reusable.
      
      * src/conf/domain_conf.h (virDomainDefCopy): New prototype.
      * src/conf/domain_conf.c (virDomainObjCopyPersistentDef): Split...
      (virDomainDefCopy): ...into new function.
      (virDomainObjSetDefTransient): Use it.
      * src/libvirt_private.syms (domain_conf.h): Export it.
      * src/qemu/qemu_driver.c (qemuDomainRevertToSnapshot): Use it.
      0b5617a6
    • E
      snapshot: expose location through virsh snapshot-info · 0f9b6ee4
      Eric Blake 提交于
      Now that we can filter on this information, we should also make
      it easy to get at.
      
      * tools/virsh-snapshot.c (cmdSnapshotInfo): Add another output
      row, and switch to XPath queries rather than strstr.
      0f9b6ee4