1. 03 9月, 2013 1 次提交
  2. 02 9月, 2013 1 次提交
    • F
      qemu: Support setting the 'removable' flag for USB disks · feba2feb
      Fred A. Kemp 提交于
      Add an attribute named 'removable' to the 'target' element of disks,
      which controls the removable flag. For instance, on a Linux guest it
      controls the value of /sys/block/$dev/removable. This option is only
      valid for USB disks (i.e. bus='usb'), and its default value is 'off',
      which is the same behaviour as before.
      
      To achieve this, 'removable=on' (or 'off') is appended to the '-device
      usb-storage' parameter sent to qemu when adding a USB disk via
      '-disk'. A capability flag QEMU_CAPS_USB_STORAGE_REMOVABLE was added
      to keep track if this option is supported by the qemu version used.
      
      Bug: https://bugzilla.redhat.com/show_bug.cgi?id=922495Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
      feba2feb
  3. 29 8月, 2013 1 次提交
    • P
      qemu: Remove hostdev entry when freeing the depending network entry · 50348e6e
      Peter Krempa 提交于
      When using a <interface type="network"> that points to a network with
      hostdev forwarding mode a hostdev alias is created for the network. This
      allias is inserted into the hostdev list, but is backed with a part of
      the network object that it is connected to.
      
      When a VM is being stopped qemuProcessStop() calls
      networkReleaseActualDevice() which eventually frees the memory for the
      hostdev object. Afterwards when the domain definition is being freed by
      virDomainDefFree() an invalid pointer is accessed by
      virDomainHostdevDefFree() and may cause a crash of the daemon.
      
      This patch removes the entry in the hostdev list before freeing the
      depending memory to avoid this issue.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1000973
      50348e6e
  4. 27 8月, 2013 3 次提交
    • J
      Add pcihole64 element to root PCI controllers · 01cda918
      Ján Tomko 提交于
      <controller type='pci' index='0' model='pci-root'>
        <pcihole64 unit='KiB'>1048576</pcihole64>
      </controller>
      
      It can be used to adjust (or disable) the size of the 64-bit
      PCI hole. The size attribute is in kilobytes (different unit
      can be specified on input), but it gets rounded up to
      the nearest GB by QEMU.
      
      Disabling it will be needed for guests that crash with the
      64-bit PCI hole (like Windows XP), see:
      https://bugzilla.redhat.com/show_bug.cgi?id=990418
      01cda918
    • A
      Add ftp protocol support for cdrom disk · 796513d7
      Aline Manera 提交于
      The ftp protocol is already recognized by qemu/KVM so add this support to
      libvirt as well.
      The xml should be as following:
      
           <disk type='network' device='cdrom'>
             <source protocol='ftp' name='/url/path'>
               <host name='host.name' port='21'/>
             </source>
           </disk>
      Signed-off-by: NAline Manera <alinefm@br.ibm.com>
      796513d7
    • A
      Add http protocol support for cdrom disk · 3485ce4e
      Aline Manera 提交于
      QEMU/KVM already allows a HTTP URL for the cdrom ISO image so add this support
      to libvirt as well.
      The xml should be as following:
      
          <disk type='network' device='cdrom'>
            <source protocol='http' name='/url/path'>
              <host name='host.name' port='80'/>
            </source>
          </disk>
      Signed-off-by: NAline Manera <alinefm@br.ibm.com>
      3485ce4e
  5. 21 8月, 2013 1 次提交
    • E
      selinux: distinguish failure to label from request to avoid label · 0f082e69
      Eric Blake 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=924153
      
      Commit 904e05a2 (v0.9.9) added a per-<disk> seclabel element with
      an attribute relabel='no' in order to try and minimize the
      impact of shutdown delays when an NFS server disappears.  The idea
      was that if a disk is on NFS and can't be labeled in the first
      place, there is no need to attempt the (no-op) relabel on domain
      shutdown.  Unfortunately, the way this was implemented was by
      modifying the domain XML so that the optimization would survive
      libvirtd restart, but in a way that is indistinguishable from an
      explicit user setting.  Furthermore, once the setting is turned
      on, libvirt avoids attempts at labeling, even for operations like
      snapshot or blockcopy where the chain is being extended or pivoted
      onto non-NFS, where SELinux labeling is once again possible.  As
      a result, it was impossible to do a blockcopy to pivot from an
      NFS image file onto a local file.
      
      The solution is to separate the semantics of a chain that must
      not be labeled (which the user can set even on persistent domains)
      vs. the optimization of not attempting a relabel on cleanup (a
      live-only annotation), and using only the user's explicit notation
      rather than the optimization as the decision on whether to skip
      a label attempt in the first place.  When upgrading an older
      libvirtd to a newer, an NFS volume will still attempt the relabel;
      but as the avoidance of a relabel was only an optimization, this
      shouldn't cause any problems.
      
      In the ideal future, libvirt will eventually have XML describing
      EVERY file in the backing chain, with each file having a separate
      <seclabel> element.  At that point, libvirt will be able to track
      more closely which files need a relabel attempt at shutdown.  But
      until we reach that point, the single <seclabel> for the entire
      <disk> chain is treated as a hint - when a chain has only one
      file, then we know it is accurate; but if the chain has more than
      one file, we have to attempt relabel in spite of the attribute,
      in case part of the chain is local and SELinux mattered for that
      portion of the chain.
      
      * src/conf/domain_conf.h (_virSecurityDeviceLabelDef): Add new
      member.
      * src/conf/domain_conf.c (virSecurityDeviceLabelDefParseXML):
      Parse it, for live images only.
      (virSecurityDeviceLabelDefFormat): Output it.
      (virDomainDiskDefParseXML, virDomainChrSourceDefParseXML)
      (virDomainDiskSourceDefFormat, virDomainChrDefFormat)
      (virDomainDiskDefFormat): Pass flags on through.
      * src/security/security_selinux.c
      (virSecuritySELinuxRestoreSecurityImageLabelInt): Honor labelskip
      when possible.
      (virSecuritySELinuxSetSecurityFileLabel): Set labelskip, not
      norelabel, if labeling fails.
      (virSecuritySELinuxSetFileconHelper): Fix indentation.
      * docs/formatdomain.html.in (seclabel): Document new xml.
      * docs/schemas/domaincommon.rng (devSeclabel): Allow it in RNG.
      * tests/qemuxml2argvdata/qemuxml2argv-seclabel-*-labelskip.xml:
      * tests/qemuxml2argvdata/qemuxml2argv-seclabel-*-labelskip.args:
      * tests/qemuxml2xmloutdata/qemuxml2xmlout-seclabel-*-labelskip.xml:
      New test files.
      * tests/qemuxml2argvtest.c (mymain): Run the new tests.
      * tests/qemuxml2xmltest.c (mymain): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      0f082e69
  6. 06 8月, 2013 2 次提交
    • L
      qemu: add dmi-to-pci-bridge controller · 62ac6b43
      Laine Stump 提交于
      This PCI controller, named "dmi-to-pci-bridge" in the libvirt config,
      and implemented with qemu's "i82801b11-bridge" device, connects to a
      PCI Express slot (e.g. one of the slots provided by the pcie-root
      controller, aka "pcie.0" on the qemu commandline), and provides 31
      *non-hot-pluggable* PCI (*not* PCIe) slots, numbered 1-31.
      
      Any time a machine is defined which has a pcie-root controller
      (i.e. any q35-based machinetype), libvirt will automatically add a
      dmi-to-pci-bridge controller if one doesn't exist, and also add a
      pci-bridge controller. The reasoning here is that any useful domain
      will have either an immediate (startup time) or eventual (subsequent
      hot-plug) need for a standard PCI slot; since the pcie-root controller
      only provides PCIe slots, we need to connect a dmi-to-pci-bridge
      controller to it in order to get a non-hot-plug PCI slot that we can
      then use to connect a pci-bridge - the slots provided by the
      pci-bridge will be both standard PCI and hot-pluggable.
      
      Since pci-bridge devices themselves can not be hot-plugged into a
      running system (although you can hot-plug other devices into a
      pci-bridge's slots), any new pci-bridge controller that is added can
      (and will) be plugged into the dmi-to-pci-bridge as long as it has
      empty slots available.
      
      This patch is also changing the qemuxml2xml-pcie test from a "DO_TEST"
      to a "DO_DIFFERENT_TEST". This is so that the "before" xml can omit
      the automatically added dmi-to-pci-bridge and pci-bridge devices, and
      the "after" xml can include it - this way we are testing if libvirt is
      properly adding these devices.
      62ac6b43
    • L
      qemu: add pcie-root controller · 48a3f48a
      Laine Stump 提交于
      This controller is implicit on q35 machinetypes. It provides 31 PCIe
      (*not* PCI) slots as controller 0.
      
      Currently there are no devices that can connect to pcie-root, and no
      implicit pci controller on a q35 machine, so q35 is still
      unusable. For a usable q35 system, we need to add a
      "dmi-to-pci-bridge" pci controller, which can connect to pcie-root,
      and provides standard pci slots that can be used to connect other
      devices.
      48a3f48a
  7. 31 7月, 2013 1 次提交
  8. 24 7月, 2013 1 次提交
    • L
      qemu: set/validate slot/connection type when assigning slots for PCI devices · 3ceb4c7d
      Laine Stump 提交于
      Since PCI bridges, PCIe bridges, PCIe switches, and PCIe root ports
      all share the same namespace, they are all defined as controllers of
      type='pci' in libvirt (but with a differing model attribute). Each of
      these controllers has a certain connection type upstream, allows
      certain connection types downstream, and each can either allow a
      single downstream connection at slot 0, or connections from slot 1 -
      31.
      
      Right now, we only support the pci-root and pci-bridge devices, both
      of which only allow PCI devices to connect, and both which have usable
      slots 1 - 31. In preparation for adding other types of controllers
      that have different capabilities, this patch 1) adds info to the
      qemuDomainPCIAddressBus object to indicate the capabilities, 2) sets
      those capabilities appropriately for pci-root and pci-bridge devices,
      and 3) validates that the controller being connected to is the proper
      type when allocating slots or validating that a user-selected slot is
      appropriate for a device..
      
      Having this infrastructure in place will make it much easier to add
      support for the other PCI controller types.
      
      While it would be possible to do all the necessary checking by just
      storing the controller model in the qemyuDomainPCIAddressBus, it
      greatly simplifies all the validation code to also keep a "flags",
      "minSlot" and "maxSlot" for each - that way we can just check those
      attributes rather than requiring a nearly identical switch statement
      everywhere we need to validate compatibility.
      
      You may notice many places where the flags are seemingly hard-coded to
      
        QEMU_PCI_CONNECT_HOTPLUGGABLE | QEMU_PCI_CONNECT_TYPE_PCI
      
      This is currently the correct value for all PCI devices, and in the
      future will be the default, with small bits of code added to change to
      the flags for the few devices which are the exceptions to this rule.
      
      Finally, there are a few places with "FIXME" comments. Note that these
      aren't indicating places that are broken according to the currently
      supported devices, they are places that will need fixing when support
      for new PCI controller models is added.
      
      To assure that there was no regression in the auto-allocation of PCI
      addresses or auto-creation of integrated pci-root, ide, and usb
      controllers, a new test case (pci-bridge-many-disks) has been added to
      both the qemuxml2argv and qemuxml2xml tests. This new test defines a
      domain with several dozen virtio disks but no pci-root or
      pci-bridges. The .args file of the new test case was created using
      libvirt sources from before this patch, and the test still passes
      after this patch has been applied.
      3ceb4c7d
  9. 23 7月, 2013 3 次提交
    • J
      qemu: Translate the iscsi pool/volume disk source · 1b4eaa61
      John Ferlan 提交于
      The difference with already supported pool types (dir, fs, block)
      is: there are two modes for iscsi pool (or network pools in future),
      one can specify it either to use the volume target path (the path
      showed up on host) with mode='host', or to use the remote URI qemu
      supports (e.g. file=iscsi://example.org:6000/iqn.1992-01.com.example/1)
      with mode='direct'.
      
      For 'host' mode, it copies the volume target path into disk->src. For
      'direct' mode, the corresponding info in the *one* pool source host def
      is copied to disk->hosts[0].
      1b4eaa61
    • J
      conf: Introduce virDomainDiskSourceIsBlockType · 1f49b05a
      John Ferlan 提交于
      Introduce a new helper to check if the disk source is of block type
      1f49b05a
    • J
      conf: Introduce new XML tag "mode" for disk source · c00b2f0d
      John Ferlan 提交于
      There are two ways to use a iSCSI LUN as disk source for qemu.
      
       * The LUN's path as it shows up on host, e.g.
         /dev/disk/by-path/ip-$ip:3260-iscsi-$iqn-fc18:iscsi.iscsi0-lun-1
      
       * The libiscsi URI from the storage pool source element host attribute, e.g.
         iscsi://demo.org:6000/iqn.1992-01.com.example/1
      
      For a "volume" type disk, if the specified "pool" is of iscsi
      type, we should support to use the LUN in either of above 2 ways.
      That's why to introduce a new XML tag "mode" for the disk source
      (libvirt should support iscsi pool with libiscsi, but it's another
      new feature, which should be done later).
      
      The "mode" can be either of "host" or "direct". Use "host" to indicate
      use of the LUN with the path as it shows up on host. Use "direct" to
      indicate to use it with the source pool host URI (future patches may support
      to use network type libvirt storage too, e.g. Ceph)
      c00b2f0d
  10. 19 7月, 2013 1 次提交
  11. 18 7月, 2013 1 次提交
  12. 16 7月, 2013 2 次提交
    • J
      Add 'period' for Memballoon statistics gathering capability · 9ed3a5ca
      John Ferlan 提交于
      Add a period in seconds to allow/enable statistics gathering from the
      Balloon driver for 'virsh dommemstat <domain>'.
      9ed3a5ca
    • M
      qemu: Implement chardev hotplug on config level · 75f0fd51
      Michal Privoznik 提交于
      There are two levels on which a device may be hotplugged: config
      and live. The config level requires just an insert or remove from
      internal domain definition structure, which is exactly what this
      patch does. There is currently no implementation for a chardev
      update action, as there's not much to be updated. But more
      importantly, the only thing that can be updated is path or socket
      address by which chardevs are distinguished. So the update action
      is currently not supported.
      75f0fd51
  13. 12 7月, 2013 2 次提交
  14. 11 7月, 2013 1 次提交
  15. 04 7月, 2013 1 次提交
  16. 03 7月, 2013 1 次提交
  17. 02 7月, 2013 1 次提交
    • G
      LXC: Introduce New XML element for user namespace · 6c30ea2c
      Gao feng 提交于
      This patch introduces new element <idmap> for
      user namespace. for example
      <idmap>
          <uid start='0' target='1000' count='10'/>
          <gid start='0' target='1000' count='10'/>
      </idmap>
      
      this new element is used for setting proc files
      /proc/<pid>/{uid_map,gid_map}.
      
      This patch also supports multiple uid/gid elements
      setting in XML configuration.
      
      We don't support the semi configuation, user has to
      configure uid and gid both.
      Signed-off-by: NGao feng <gaofeng@cn.fujitsu.com>
      6c30ea2c
  18. 21 6月, 2013 1 次提交
  19. 11 6月, 2013 1 次提交
    • M
      qemu_migrate: Dispose listen address if set from config · 6546017c
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=971485
      
      As of d7f9d827 we copy the listen
      address from the qemu.conf config file in case none has been provided
      via XML. But later, when migrating, we should not include such listen
      address in the migratable XML as it is something autogenerated, not
      requested by user. Moreover, the binding to the listen address will
      likely fail, unless the address is '0.0.0.0' or its IPv6 equivalent.
      This patch introduces a new boolean attribute to virDomainGraphicsListenDef
      to distinguish autofilled listen addresses. However, we must keep the
      attribute over libvirtd restarts, so it must be kept within status XML.
      6546017c
  20. 07 6月, 2013 1 次提交
    • O
      qemu: Report the offset from host UTC for RTC_CHANGE event · e31b5cf3
      Osier Yang 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=964177
      
      Though both libvirt and QEMU's document say RTC_CHANGE returns
      the offset from the host UTC, qemu actually returns the offset
      from the specified date instead when specific date is provided
      (-rtc base=$date).
      
      It's not safe for qemu to fix it in code, it worked like that
      for 3 years, changing it now may break other QEMU use cases.
      What qemu tries to do is to fix the document:
      
      http://lists.gnu.org/archive/html/qemu-devel/2013-05/msg04782.html
      
      And in libvirt side, instead of replying on the value from qemu,
      this converts the offset returned from qemu to the offset from
      host UTC, by:
      
        /*
         * a: the offset from qemu RTC_CHANGE event
         * b: The specified date (-rtc base=$date)
         * c: the host date when libvirt gets the RTC_CHANGE event
         * offset: What libvirt will report
         */
      
        offset = a + (b - c);
      
      The specified date (-rtc base=$date) is recorded in clock's def as
      an internal only member (may be useful to exposed outside?).
      
      Internal only XML tag "basetime" is introduced to not lose the
      guest's basetime after libvirt restarting/reloading:
      
      <clock offset='variable' adjustment='304' basis='utc' basetime='1370423588'/>
      e31b5cf3
  21. 22 5月, 2013 2 次提交
    • M
      Introduce /domain/devices/interface/driver/@queues attribute · 7e744f81
      Michal Privoznik 提交于
      This attribute is going to represent number of queues for
      multique vhost network interface. This commit implements XML
      extension part of the feature and add one test as well. For now,
      we can only do xml2xml test as qemu command line generation code
      is not adapted yet.
      7e744f81
    • G
      conf: add 'sharePolicy' attribute to graphics element for vnc · 2a58d076
      Guannan Ren 提交于
       -vnc :5900,share=allow-exclusive
      allows clients to ask for exclusive access which is
      implemented by dropping other connections Connecting
      multiple clients in parallel requires all clients asking
      for a shared session (vncviewer: -shared switch)
      
       -vnc :5900,share=force-shared
      disables exclusive client access.  Useful for shared
      desktop sessions, where you don't want someone forgetting
      specify -shared disconnect everybody else.
      
       -vnc :5900,share=ignore
      completely ignores the shared flag and allows everybody
      connect unconditionally
      2a58d076
  22. 21 5月, 2013 1 次提交
  23. 17 5月, 2013 4 次提交
    • O
      qemu: Change values of disk discard · 9049d6a8
      Osier Yang 提交于
      QEMU might support more values for "-drive discard", so using Bi-state
      values (on/off) for it doesn't make sense.
      
      "on" maps to "unmap", "off" maps to "ignore":
      
      <...>
      @var{discard} is one of "ignore" (or "off") or "unmap" (or "on") and
      controls whether @dfn{discard} (also known as @dfn{trim} or @dfn{unmap})
      requests are ignored or passed to the filesystem.  Some machine types
      may not support discard requests.
      </...>
      9049d6a8
    • J
      Add support for locking domain's memory pages · 55586638
      Jiri Denemark 提交于
      The following XML configuration can be used to request all domain's
      memory pages to be kept locked in host's memory (i.e., domain's memory
      pages will not be swapped out):
      
            <memoryBacking>
              <locked/>
            </memoryBacking>
      55586638
    • O
      conf: Introduce sgio for hostdev · 67653160
      Osier Yang 提交于
      "sgio" is only valid for scsi host device.
      67653160
    • O
      Rename virDomainDiskSGIO to virDomainDeviceSGIO · ead43915
      Osier Yang 提交于
      SCSI host device will also support "sgio", and perhaps we could
      use "sgio" in other places too in future, renaming the enum to
      reuse.
      ead43915
  24. 16 5月, 2013 1 次提交
  25. 15 5月, 2013 3 次提交
    • O
      qemu: Support discard for disk · a7c4202c
      Osier Yang 提交于
      QEMU introduced "discard" option for drive since commit a9384aff53,
      
      <...>
      @var{discard} is one of "ignore" (or "off") or "unmap" (or "on") and
      controls whether @dfn{discard} (also known as @dfn{trim} or @dfn{unmap})
      requests are ignored or passed to the filesystem.  Some machine types
      may not support discard requests.
      </...>
      
      This patch exposes the support in libvirt.
      
      QEMU supported "discard" for "-drive" since v1.5.0-rc0:
      
      % git tag --contains a9384aff53
      contains
      v1.5.0-rc0
      v1.5.0-rc1
      
      So this only detects the capability bit using virQEMUCapsProbeQMPCommandLine.
      a7c4202c
    • M
      Add VNC WebSocket support · f1ad8d20
      Martin Kletzander 提交于
      Adding support for new attribute 'websocket' in the '<graphics>'
      element, the attribute value is the port to listen on with '-1'
      meaning auto-allocation, '0' meaning no websockets.
      f1ad8d20
    • O
      qemu: New XML to disable memory merge at guest startup · 77b54b96
      Osier Yang 提交于
      QEMU introduced command line "-mem-merge=on|off" (defaults to on) to
      enable/disable the memory merge (KSM) at guest startup. This exposes
      it by new XML:
        <memoryBacking>
          <nosharepages/>
        </memoryBacking>
      
      The XML tag is same with what we used internally for old RHEL.
      77b54b96
  26. 13 5月, 2013 2 次提交
    • D
      Add 'nbd' as a valid filesystem driver type · 13579d45
      Daniel P. Berrange 提交于
      The <filesystem> element can now accept a <driver type='nbd'/>
      as an alternative to 'loop'. The benefit of NBD is support
      for non-raw disk image formats.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      13579d45
    • D
      Add support for storage format in FS <driver> · ada14b86
      Daniel P. Berrange 提交于
      Extend the <driver> element in filesystem devices to
      allow a storage format to be set. The new attribute
      uses 'format' to reflect the storage format. This is
      different from the <driver> element in disk devices
      which use 'type' to reflect the storage format. This
      is because the 'type' attribute on filesystem devices
      is already used for the driver backend, for which the
      disk devices use the 'name' attribute. Arggggh.
      
      Anyway for disks we have
      
         <driver name="qemu" type="raw"/>
      
      And for filesystems this change means we now have
      
         <driver type="loop" format="raw"/>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      ada14b86