1. 17 3月, 2017 2 次提交
  2. 15 3月, 2017 3 次提交
    • M
      qemu: Introduce label-size for NVDIMMs · e433546b
      Michal Privoznik 提交于
      For NVDIMM devices it is optionally possible to specify the size
      of internal storage for namespaces. Namespaces are a feature that
      allows users to partition the NVDIMM for different uses.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      e433546b
    • M
      conf: Introduce @access to <memory/> · 80af11d3
      Michal Privoznik 提交于
      Now that NVDIMM has found its way into libvirt, users might want
      to fine tune some settings for each module separately. One such
      setting is 'share=on|off' for the memory-backend-file object.
      This setting - just like its name suggest already - enables
      sharing the nvdimm module with other applications. Under the hood
      it controls whether qemu mmaps() the file as MAP_PRIVATE or
      MAP_SHARED.
      
      Yet again, we have such config knob in domain XML, but it's just
      an attribute to numa <cell/>. This does not give fine enough
      tuning on per-memdevice basis so we need to have the attribute
      for each device too.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      80af11d3
    • M
      Introduce NVDIMM memory model · b4e8a49f
      Michal Privoznik 提交于
      NVDIMM is new type of memory introduced into QEMU 2.6. The idea
      is that we have a Non-Volatile memory module that keeps the data
      persistent across domain reboots.
      
      At the domain XML level, we already have some representation of
      'dimm' modules. Long story short, NVDIMM will utilize the
      existing <memory/> element that lives under <devices/> by adding
      a new attribute 'nvdimm' to the existing @model and introduce a
      new <path/> element for <source/> while reusing other fields. The
      resulting XML would appear as:
      
          <memory model='nvdimm'>
            <source>
              <path>/tmp/nvdimm</path>
            </source>
            <target>
              <size unit='KiB'>523264</size>
              <node>0</node>
            </target>
            <address type='dimm' slot='0'/>
          </memory>
      
      So far, this is just a XML parser/formatter extension. QEMU
      driver implementation is in the next commit.
      
      For more info on NVDIMM visit the following web page:
      
          http://pmem.io/Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      b4e8a49f
  3. 12 3月, 2017 1 次提交
    • F
      bhyve: add video support · 04664327
      Fabian Freyer 提交于
      bhyve supports 'gop' video device that allows clients to connect
      to VMs using VNC clients. This commit adds support for that to
      the bhyve driver:
      
       - Introducr 'gop' video device type
       - Add capabilities probing for the 'fbuf' device that's
         responsible for graphics
       - Update command builder routines to let users configure
         domain's VNC via gop graphics.
      Signed-off-by: NRoman Bogorodskiy <bogorodskiy@gmail.com>
      04664327
  4. 10 3月, 2017 1 次提交
  5. 09 3月, 2017 2 次提交
    • P
      conf: properly skip graphics listen element in migratable XML · cba1672d
      Pavel Hrdina 提交于
      We should skip <listen type='socket'/> only if the 'socket' path
      is specified because if there is no 'socket' path we need to
      keep that element in migratable XML.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1366088Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      cba1672d
    • P
      conf: store "autoGenerated" for graphics listen in status XML · cd4a8b93
      Pavel Hrdina 提交于
      When libvirtd is started we call qemuDomainRecheckInternalPaths
      to detect whether a domain has VNC socket path generated by libvirt
      based on option from qemu.conf.  However if we are parsing status XML
      for running domain the existing socket path can be generated also if
      the config XML uses the new <listen type='socket'/> element without
      specifying any socket.
      
      The current code doesn't make difference how the socket was generated
      and always marks it as "fromConfig".  We need to store the
      "autoGenerated" value in the status XML in order to preserve that
      information.
      
      The difference between "fromConfig" and "autoGenerated" is important
      for migration, because if the socket is based on "fromConfig" we don't
      print it into the migratable XML and we assume that user has properly
      configured qemu.conf on both hosts.  However if the socket is based
      on "autoGenerated" it means that a new feature was used and therefore
      we need to leave the socket in migratable XML to make sure that if
      this feature is not supported on destination the migration will fail.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      cd4a8b93
  6. 23 2月, 2017 2 次提交
    • D
      Add ATTRIBUTE_FALLTHROUGH for switch cases without break · 5d84f596
      Daniel P. Berrange 提交于
      In GCC 7 there is a new warning triggered when a switch
      case has a conditional statement (eg if ... else...) and
      some of the code paths fallthrough to the next switch
      statement. e.g.
      
      conf/domain_conf.c: In function 'virDomainChrEquals':
      conf/domain_conf.c:14926:12: error: this statement may fall through [-Werror=implicit-fallthrough=]
               if (src->targetTypeAttr != tgt->targetTypeAttr)
                  ^
      conf/domain_conf.c:14928:5: note: here
           case VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE:
           ^~~~
      conf/domain_conf.c: In function 'virDomainChrDefFormat':
      conf/domain_conf.c:22143:12: error: this statement may fall through [-Werror=implicit-fallthrough=]
               if (def->targetTypeAttr) {
                  ^
      conf/domain_conf.c:22151:5: note: here
           default:
           ^~~~~~~
      
      GCC introduced a __attribute__((fallthrough)) to let you
      indicate that this is intentionale behaviour rather than
      a bug.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      5d84f596
    • A
      conf: Make switch statements more strict · 77edbf51
      Andrea Bolognani 提交于
      When switching over the values in the virDomainControllerModelPCI
      enumeration, make sure the proper cast is in place so that the
      compiler can warn us when the coverage is not exaustive.
      
      For the same reason, remove the 'default' case from one of the
      existing switch statements.
      77edbf51
  7. 22 2月, 2017 1 次提交
    • M
      conf: Don't accept dummy values for <memoryBacking/> attributes · 0888cb6a
      Michal Privoznik 提交于
      Our virSomeEnumTypeFromString() functions return either the value
      of item from the enum or -1 on error. Usually however the value 0
      means 'this value is not set in the domain XML, use some sensible
      default'. Therefore, we don't accept corresponding string in
      domain XML, for instance:
      
      <memoryBacking>
        <source mode="none"/>
        <access mode="default"/>
        <allocation mode="none"/>
      </memoryBacking>
      
      should be rejected as invalid XML.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      0888cb6a
  8. 21 2月, 2017 7 次提交
  9. 17 2月, 2017 1 次提交
  10. 10 2月, 2017 1 次提交
  11. 09 2月, 2017 1 次提交
    • J
      conf: Add new xml elements for file memorybacking support · bc6d3121
      Jaroslav Safka 提交于
      This part introduces new xml elements for file based
      memorybacking support and their parsing.
      (It allows vhost-user to be used without hugepages.)
      
      New xml elements:
      <memoryBacking>
        <source type="file|anonymous"/>
        <access mode="shared|private"/>
        <allocation mode="immediate|ondemand"/>
      </memoryBacking>
      bc6d3121
  12. 01 2月, 2017 1 次提交
  13. 27 1月, 2017 1 次提交
  14. 26 1月, 2017 1 次提交
  15. 25 1月, 2017 1 次提交
  16. 20 1月, 2017 1 次提交
    • M
      virDomainHostdevSubsysSCSIVHostDefParseXML: Don't leak @protocol · 0cacdc6f
      Michal Privoznik 提交于
      ==24748== 12 bytes in 2 blocks are definitely lost in loss record 25 of 84
      ==24748==    at 0x4C2BF80: malloc (vg_replace_malloc.c:296)
      ==24748==    by 0x1A1E1E78: xmlStrndup (in /usr/lib64/libxml2.so.2.9.4)
      ==24748==    by 0x18D0495F: virXMLPropString (virxml.c:506)
      ==24748==    by 0x18D1FB3E: virDomainHostdevSubsysSCSIVHostDefParseXML (domain_conf.c:6280)
      ==24748==    by 0x18D20350: virDomainHostdevDefParseXMLSubsys (domain_conf.c:6450)
      ==24748==    by 0x18D34E7D: virDomainHostdevDefParseXML (domain_conf.c:13218)
      ==24748==    by 0x18D42598: virDomainDefParseXML (domain_conf.c:17745)
      ==24748==    by 0x18D440A9: virDomainDefParseNode (domain_conf.c:18236)
      ==24748==    by 0x18D43EFA: virDomainDefParse (domain_conf.c:18180)
      ==24748==    by 0x18D43FA0: virDomainDefParseFile (domain_conf.c:18206)
      ==24748==    by 0x44EDA1: testCompareDomXML2XMLFiles (testutils.c:1140)
      ==24748==    by 0x4365F8: testXML2XMLActive (qemuxml2xmltest.c:59)
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      0cacdc6f
  17. 20 12月, 2016 2 次提交
  18. 09 12月, 2016 1 次提交
    • N
      qemu: Fix xml dump of autogenerated websocket · 61a0026a
      Nikolay Shirokovskiy 提交于
      When save/migrate a domain and we autogenerated a port, then if we
      print the inactive domain config, write out a -1 for the socket value;
      otherwise, it's possible that the subsequent start will fail if the
      autogenerated websocket used conflicts with an existing running config
      that also used autogenerated websockets.
      
      Examples:
      
      == A. Can not restore domain with autoconfigured websocket.
      
      domain 1 and 2 have autoconfigured websocket.
      
      1. domain 1 is started then, saved
      2. domain 2 is started
      3. domain 1 restoration is failed:
      
      error: internal error: qemu unexpectedly closed the monitor: 2016-11-21T10:23:11.356687Z
      qemu-kvm: -vnc 0.0.0.0:2,websocket=5700: Failed to start VNC server on `(null)':
      Failed to bind socket: Address already in use
      
      == B. Can not migrate domain with autoconfigured websocket.
      
      domain 1 on host A, domain 2 on host B, both have autoconfigured websocket
      
      1. domain 1 started, domain 2 started
      2. domain 1 migration to host B is failed with the above error.
      61a0026a
  19. 08 12月, 2016 2 次提交
  20. 06 12月, 2016 2 次提交
  21. 05 12月, 2016 3 次提交
  22. 30 11月, 2016 1 次提交
    • C
      virt-aa-helper: fix parsing security labels by introducing VIR_DOMAIN_DEF_PARSE_SKIP_SECLABEL · dffdac06
      Christian Ehrhardt 提交于
      When virt-aa-helper parses xml content it can fail on security labels.
      
      It fails by requiring to parse active domain content on seclabels that
      are not yet filled in.
      
      Testcase with virt-aa-helper on a minimal xml:
       $ cat << EOF > /tmp/test.xml
      <domain type='kvm'>
          <name>test-seclabel</name>
          <uuid>12345678-9abc-def1-2345-6789abcdef00</uuid>
          <memory unit='KiB'>1</memory>
          <os><type arch='x86_64'>hvm</type></os>
          <seclabel type='dynamic' model='apparmor' relabel='yes'/>
          <seclabel type='dynamic' model='dac' relabel='yes'/>
      </domain>
      EOF
       $ /usr/lib/libvirt/virt-aa-helper -d -r -p 0 \
         -u libvirt-12345678-9abc-def1-2345-6789abcdef00 < /tmp/test.xml
      
      Current Result:
       virt-aa-helper: error: could not parse XML
       virt-aa-helper: error: could not get VM definition
      Expected Result is a valid apparmor profile
      Signed-off-by: NChristian Ehrhardt <christian.ehrhardt@canonical.com>
      Signed-off-by: NGuido Günther <agx@sigxcpu.org>
      dffdac06
  23. 25 11月, 2016 2 次提交
    • E
      conf: Wire up the vhost-scsi connection from/to XML · ae5d30a0
      Eric Farman 提交于
      With the QEMU components in place, provide the XML parsing to
      invoke that code when given the following XML snippet:
      
          <hostdev mode='subsystem' type='scsi_host'>
            <source protocol='vhost' wwpn='naa.501234567890abcd'/>
          </hostdev>
      
      An optional address element can be specified within the hostdev
      (pick CCW or PCI as necessary):
      
          <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0625'/>
          <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
      
      Add basic vhost-scsi tests which were cloned from hostdev-scsi-virtio-scsi
      in both xml2argv and xml2xml. Added ones for both vhost-scsi-ccw and
      vhost-scsi-pci since the syntaxes are slightly different between them.
      
      Also adjusted the docs to describe the changes.
      Signed-off-by: NEric Farman <farman@linux.vnet.ibm.com>
      Reviewed-by: NBoris Fiuczynski <fiuczy@linux.vnet.ibm.com>
      ae5d30a0
    • E
      Introduce framework for a hostdev SCSI_host subsystem type · fc0e627b
      Eric Farman 提交于
      We already have a "scsi" hostdev subsys type, which refers to a single
      LUN that is passed through to a guest.  But what of things where
      multiple LUNs are passed through via a single SCSI HBA, such as with
      the vhost-scsi target?  Create a new hostdev subsys type that will
      carry this.
      Signed-off-by: NEric Farman <farman@linux.vnet.ibm.com>
      fc0e627b