1. 10 5月, 2016 4 次提交
    • R
      conf: don't redefine virDomainCapsDeviceHostdev · 9dec97dd
      Roman Bogorodskiy 提交于
      Commit 5ed235c6 added unnecessary redifinition of
      virDomainCapsDeviceHostdev in conf/domain_capabilities.h. This breaks
      build with clang 3.4:
      
      In file included from conf/domain_capabilities.c:25:
      conf/domain_capabilities.h:88:44: error: redefinition of typedef
      'virDomainCapsDeviceHostdev' is a C11 feature
      [-Werror,-Wtypedef-redefinition]
      typedef struct _virDomainCapsDeviceHostdev virDomainCapsDeviceHostdev;
                                                 ^
      conf/domain_capabilities.h:86:44: note: previous definition is here
      typedef struct _virDomainCapsDeviceHostdev virDomainCapsDeviceHostdev;
      
      So drop one of those.
      9dec97dd
    • J
      conf: Fix error path in virNodeDevPCICapabilityParseXML · 9d418b20
      John Ferlan 提交于
      If the call to virXPathNodeSet to set naddresses fails, Coverity notes
      that the subsequent VIR_ALLOC_N cannot have a negative value (well it
      probably wouldn't be negative per se).
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      9d418b20
    • C
      domaincaps: Report video modelType · 5ed235c6
      Cole Robinson 提交于
      Requires adding the plumbing for <device><video>
      The value is <enum name='modelType'> to match the associated domain
      XML of <video><model type='XXX'/>
      
      Wire it up for qemu too
      5ed235c6
    • C
      domaincaps: Report graphics type enum · 6da27ad1
      Cole Robinson 提交于
      Requires adding the plumbing for <device><graphics>
      Wire it up for qemu too
      6da27ad1
  2. 09 5月, 2016 1 次提交
  3. 06 5月, 2016 2 次提交
  4. 04 5月, 2016 2 次提交
  5. 03 5月, 2016 2 次提交
  6. 02 5月, 2016 12 次提交
    • B
      qemu: add panic device support for S390 · d8554654
      Boris Fiuczynski 提交于
      If a panic device is being defined without a model in a domain
      the default value is always overwritten with model ISA. An ISA
      bus does not exist on S390 and therefore specifying a panic device
      results in an unsupported configuration.
      Since the S390 architecture inherently provides a crash detection
      capability the panic device should be defined in the domain xml.
      
      This patch adds an s390 panic device model and prevents setting a
      device address on it.
      Signed-off-by: NBoris Fiuczynski <fiuczy@linux.vnet.ibm.com>
      Reviewed-by: NCornelia Huck <cornelia.huck@de.ibm.com>
      d8554654
    • C
      nwfilter: Save config to disk if we generated a UUID · 441e881e
      Cole Robinson 提交于
      libvirt-daemon-config-nwfilter will put a bunch of xml configs
      into /etc/libvirt/nwfilter. These configs don't hardcode a UUID
      and depends on libvirt to generate one. However the generated UUID
      is never saved to disk, unless the user manually calls Define.
      
      This makes daemon reload quite noisy with many errors like:
      
      error : virNWFilterObjAssignDef:3101 : operation failed: filter 'allow-incoming-ipv4' already exists with uuid 50def3b5-48d6-46a3-b005-cc22df4e5c5c
      
      Because a new UUID is generated every time the config is read from
      disk, so libvirt constantly thinks it's finding a new nwfilter.
      
      Detect if we generated a UUID when the config file is loaded; if so,
      resave the new contents to disk to ensure the UUID is persisteny.
      
      This is similar to what was done in commit a47ae7c0 with virtual
      networks and generated MAC addresses
      441e881e
    • C
      nwfilter: Push configFile building into LoadConfig · 0feb1c6c
      Cole Robinson 提交于
      This matches the pattern used for network object APIs, and we want
      configDir in LoadConfig for upcoming patches
      0feb1c6c
    • C
      nwfilter: Fix potential locking problems on ObjLoad failure · ab05abdb
      Cole Robinson 提交于
      In virNWFilterObjLoad we can still fail after virNWFilterObjAssignDef,
      but we don't unlock and free the created virNWFilterObjPtr in the
      cleanup path.
      
      The bit we are trying to do after AssignDef is just STRDUP in the
      configFile path. However caching the configFile in the NWFilterObj
      is largely redundant and doesn't follow the same pattern we use
      for domain and network objects.
      
      So just remove all the configFile caching which fixes the latent
      bug as a side effect.
      ab05abdb
    • C
      conf: format runtime DAC seclabel, unless MIGRATABLE · 601531d6
      Cole Robinson 提交于
      We historically format runtime seclabel selinux/apparmor values,
      however we skip formatting runtime DAC values. This was added in
      
      commit 990e46c4
      Author: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
      Date:   Fri Aug 31 13:40:41 2012 +0200
      
          conf: Avoid formatting auto-generated DAC labels
      
      to maintain migration compatibility with libvirt < 0.10.0.
      
      However the formatting was skipped unconditionally. Instead only
      skip formatting in the VIR_DOMAIN_DEF_FORMAT_MIGRATABLE case.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1215833
      601531d6
    • C
      conf: storage: pool: reject name containing '/' · 20b52668
      Cole Robinson 提交于
      Trying to define a pool name containing an embedded '/'
      will immediately fail when trying to write the XML to disk.
      This patch explicitly rejects names containing a '/'
      
      Besides our stateful driver, there are two other storage impls:
      esx and phyp. esx doesn't support pool creation, so this should
      doesn't apply.
      
      phyp does support pool creation, and the name is passed to the
      'mksp' tool, which google doesn't reveal whether it accepts '/'
      or not. IMO the likeliness of this impacting any users is near zero
      20b52668
    • C
      conf: network: reject name containing '/' · 454f739f
      Cole Robinson 提交于
      Trying to define a network name containing an embedded '/'
      will immediately fail when trying to write the XML to disk.
      This patch explicitly rejects names containing a '/'
      
      Besides the network bridge driver, the only other network
      implementation is a very thin one for virtualbox, which seems to
      use the network name as a host interface name, which won't
      accept '/' anyways, so I think this is fine to do unconitionally.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=787604
      454f739f
    • C
      conf: domain: reject name containing '/' · b1fc6a7b
      Cole Robinson 提交于
      Trying to define a domain name containing an embedded '/'
      will immediately fail when trying to write the XML to disk for
      our stateful drivers. This patch explicitly rejects names
      containing a '/', and provides an xmlopt feature for drivers
      to avoid this validation check, which is enabled in every
      non-stateful driver that already has xmlopt handling wired up.
      
      (Technically this could reject a previously accepted vmname like
       '/foo', however at least for the qemu driver that falls over
       later when starting qemu)
      
      https://bugzilla.redhat.com/show_bug.cgi?id=639923
      b1fc6a7b
    • M
      conf: Parse more of our nodedev XML · 541f21af
      Martin Kletzander 提交于
      We were lacking tests that are checking for the completeness of our
      nodedev XMLs and also whether we output properly formatted ones.  This
      patch adds parsing for the capability elements inside the <capability
      type='pci'> element.  Also bunch of tests are added to show everything
      works properly.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      541f21af
    • M
      Move capability formatting together · 88c8be67
      Martin Kletzander 提交于
      All sub-PCI capabilities should be next to each other for clarity.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      88c8be67
    • M
      Change virDevicePCIAddress to virPCIDeviceAddress · c36b1f7b
      Martin Kletzander 提交于
      We had both and the only difference was that the latter also included
      information about multifunction setting.  The problem with that was that
      we couldn't use functions made for only one of the structs (e.g.
      parsing).  To consolidate those two structs, use the one in virpci.h,
      include that in domain_conf.h and add the multifunction member in it.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      c36b1f7b
    • J
      qemu: Introduce qemuDomainHostdevPrivatePtr · 27726d8c
      John Ferlan 提交于
      Modeled after the qemuDomainDiskPrivatePtr logic, create a privateData
      pointer in the _virDomainHostdevDef to allow storage of private data
      for a hypervisor in order to at least temporarily store auth/secrets
      data for usage during qemuBuildCommandLine.
      
      NB: Since the qemu_parse_command (qemuParseCommandLine) code is not
      expecting to restore the auth/secret data, there's no need to add
      code to handle this new structure there.
      
      Updated copyrights for modules touched. Some didn't have updates in a
      couple years even though changes have been made.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      27726d8c
  7. 30 4月, 2016 1 次提交
    • L
      Revert "libvirt domain xml allow to set peer address" · 1d14b13f
      Laine Stump 提交于
      This reverts commit 690969af, which
      added the domain config parts to support a "peer" attribute in domain
      interface <ip> elements.
      
      It's being removed temporarily for the release of libvirt 1.3.4
      because the feature doesn't work, and there are concerns that it may
      need to be modified in an externally visible manner which could create
      backward compatibility problems.
      1d14b13f
  8. 28 4月, 2016 1 次提交
    • M
      qemu: Regenerate VNC socket paths · 55320c23
      Martin Kletzander 提交于
      Similarly to what commit 71408079 did with some internal paths,
      clear vnc socket paths that were generated by us.  Having such path in
      the definition can cause trouble when restoring the domain.  The path is
      generated to the per-domain directory that contains the domain ID.
      However, that ID will be different upon restoration, so qemu won't be
      able to create that socket because the directory will not be prepared.
      
      To be able to migrate to older libvirt, skip formatting the socket path
      in migratable XML if it was autogenerated.  And mark it as autogenerated
      if it already exists and we're parsing live XML.
      
      Best viewed with '-C'.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1326270Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      55320c23
  9. 27 4月, 2016 1 次提交
  10. 26 4月, 2016 14 次提交
    • C
      conf: Drop restrictions on rng backend path · 67f2b727
      Cole Robinson 提交于
      Currently we only allow /dev/random and /dev/hwrng as host input
      for <rng><backend model='random'/> device. This was added after
      various upstream discussions in commit 4932ef45
      
      However this restriction has generated quite a few complaints over
      the years, so a new discussion was initiated:
      
      http://www.redhat.com/archives/libvir-list/2016-April/msg00987.html
      
      Several people suggested removing the restriction, and nobody really
      spoke up to defend it. So this patch drops the path restriction
      entirely
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1074464
      67f2b727
    • J
      secret: Change virSecretDef variable names · 662bf30c
      John Ferlan 提交于
      Change 'ephemeral' to 'isephemeral' and 'private' to 'isprivate' since
      both are bools.
      662bf30c
    • J
      secret: Introduce virSecretObjGetValue and virSecretObjGetValueSize · 43d3e3c1
      John Ferlan 提交于
      Introduce the final accessor's to _virSecretObject data and move the
      structure from virsecretobj.h to virsecretobj.c
      
      The virSecretObjSetValue logic will handle setting both the secret
      value and the value_size. Some slight adjustments to the error path
      over what was in secretSetValue were made.
      
      Additionally, a slight logic change in secretGetValue where we'll
      check for the internalFlags and error out before checking for
      and erroring out for a NULL secret->value. That way, it won't be
      obvious to anyone that the secret value wasn't set rather they'll
      just know they cannot get the secret value since it's private.
      43d3e3c1
    • J
      secret: Introduce virSecretObj{Get|Set}Def · 9e1e5621
      John Ferlan 提交于
      Introduce fetch and set accessor to the secretObj->def field for usage
      by the driver to avoid the driver needing to know the format of virSecretObj
      9e1e5621
    • J
      secret: Introduce virSecretObjSave{Config|Data} · ac9ffd60
      John Ferlan 提交于
      Move and rename the secretRewriteFile, secretSaveDef, and secretSaveValue
      from secret_driver to virsecretobj
      
      Need to make some slight adjustments since the secretSave* functions
      called secretEnsureDirectory, but otherwise mostly just a move of code.
      ac9ffd60
    • J
      secret: Introduce virSecretObjDelete{Config|Data} · d467ac07
      John Ferlan 提交于
      Move and rename secretDeleteSaved from secret_driver into virsecretobj and
      split it up into two parts since there is error path code that looks to
      just delete the secret data file
      d467ac07
    • J
      secret: Move and rename secretLoadAllConfigs · 85ec94f8
      John Ferlan 提交于
      Move to secret_conf.c and rename to virSecretLoadAllConfigs. Also includes
      moving/renaming the supporting virSecretLoad, virSecretLoadValue, and
      virSecretLoadValidateUUID.
      85ec94f8
    • J
      secret: Use the hashed virSecretObjList · 993f9128
      John Ferlan 提交于
      This patch replaces most of the guts of secret_driver.c with recently
      added secret_conf.c APIs in order manage secret lists and objects
      using the hashed virSecretObjList* lookup API's.
      993f9128
    • J
      secret: Introduce virSecretObjListGetUUIDs · bb1fba62
      John Ferlan 提交于
      Add function to return counted listed of uuids to from the hashed secrets
      object list. This will replace the guts of secretConnectListSecrets.
      bb1fba62
    • J
      secret: Introduce virSecretObjListExport · d12c6721
      John Ferlan 提交于
      Add function to return a "match" filtered list of secret objects. This
      function replaces the guts of secretConnectListAllSecrets.
      
      Need to also move and make global virSecretUsageIDForDef since it'll
      be used by both secret_driver.c and secret_conf.c
      d12c6721
    • J
      secret: Introduce virSecretObjListNumOfSecrets · 5249d076
      John Ferlan 提交于
      Add function to count the hashed secret obj list with filters. This
      will replace the guts of secret_driver's secretConnectNumOfSecrets.
      5249d076
    • J
      secret: Introduce virSecretObjListAdd* and virSecretObjListRemove · d4287b98
      John Ferlan 提交于
      Add the functions to add/remove elements from the hashed secret obj list.
      These will replace secret_driver functions secretAssignDef and secretObjRemove.
      
      The virSecretObjListAddLocked will perform the necessary lookups and
      decide whether to replace an existing hash entry or create a new one.
      This includes setting up the configPath and base64Path as well as being
      able to support the caller's need to restore from a previous definition
      in case something goes wrong in the caller.
      d4287b98
    • J
      secret: Introduce virSecretUsageIDForDef · 615c8cce
      John Ferlan 提交于
      Move the driver specific secretUsageIDForDef into secret_conf.c. It could
      be more of a general purpose API.
      615c8cce
    • J
      secret: Introduce virSecretObjListFindBy{UUID|Usage} support · 00a3f0d0
      John Ferlan 提交于
      New API's including unlocked and Locked versions in order to be able
      to use in either manner.
      
      Support for searching hash object lists instead of linked lists will
      replace existing secret_driver functions secretFindByUUID and
      secretFindByUsage
      00a3f0d0