1. 02 5月, 2016 9 次提交
    • 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
  2. 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
  3. 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
  4. 27 4月, 2016 1 次提交
  5. 26 4月, 2016 15 次提交
    • 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
    • J
      secret: Create virsecretobj.c and virsecretconf.h · 4652b158
      John Ferlan 提交于
      Move virSecretObj from secret_driver.c to virsecretobj.h
      
      To support being able to create a hashed secrets list, move the
      virSecretObj to virsecretobj.h so that the code can at least find
      the definition.
      
      This should be a temporary situation while the virsecretobj.c code
      is patched in order to support a hashed secret object while still
      having the linked list support in secret_driver.c. Eventually, the
      goal is to move the virSecretObj into virsecretobj.c, although it
      is notable that the existing model from which virSecretObj was
      derived has virDomainObj in src/conf/domain_conf.h and virNetworkObj
      in src/conf/network_conf.h, so virSecretObj wouldn't be unique if
      it were to remain in virsecretobj.h  Still adding accessors to fetch
      and store hashed object data will be the end goal.
      
      Add definitions and infrastucture in virsecretobj.c to create and
      handle a hashed virSecretObj and virSecretObjList including the class,
      object, lock setup, and disposal API's. Nothing will call these yet.
      
      This infrastructure will replace the forward linked list logic
      within the secret_driver, eventually.
      4652b158
  6. 21 4月, 2016 13 次提交