1. 21 4月, 2015 3 次提交
    • C
      domain: conf: Better errors on bad os <type> values · 3700c065
      Cole Robinson 提交于
      If no <os><type> was specified:
        before: unknown OS type no OS type
        after : xml error: an os <type> must be specified
      
      If an <os><type> is specified that's not in our capabiliities data:
        before: unknown OS type: $type
        after : unsupported configuration: no support found for os <type> '$type'
      
      VIR_ERR_OS_TYPE is now unused (as it should be frankly) so drop its strings
      as well to save our translators some effort.
      3700c065
    • N
      parallels: make device addressing consistent · 6b7b677a
      Nikolay Shirokovskiy 提交于
      In Parallels we do not support device name hints
      aka <target dev=../> option and full-fledged device
      disk device addressing through
      <address type=.. controller=.. bus=.. target=.. unit=../>
      and have only one index instead.
      In this situation to be consistent we can only take
      one-to-one mapping from some reasonable subset
      of full address. Values outside this subset are
      invalid to create Parallels VMs.
      
      Reasonable mapping is default one defined in virDomainDiskDefAssignAddress.
      Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@parallels.com>
      6b7b677a
    • N
      parallels: fix return status for parallelsConnectOpen · 21f62d60
      Nikolay Shirokovskiy 提交于
      We should return VIR_DRV_OPEN_ERROR in case
      if we handle scheme in query but some
      error occur. Previously we sometimes
      return VIR_DRV_OPEN_DECLINE.
      Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@parallels.com>
      21f62d60
  2. 20 4月, 2015 5 次提交
  3. 17 4月, 2015 20 次提交
    • M
      domcaps: Check for architecture more wisely · 0af9325e
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1209948
      
      So we have this bug. The virConnectGetDomainCapabilities() API
      performs a couple of checks before it produces any result. One of
      the checks is if the architecture requested by user can be run by
      the binary (again user provided). However, the check is pretty
      dumb. It merely compares if the default binary architecture
      matches the one provided by user. However, a qemu binary can run
      multiple architectures. For instance: qemu-system-ppc64 can run:
      ppc, ppcle, ppc64, ppc64le and ppcemb. The default is ppc64, so
      if user requested something else, like ppc64le, the check would
      have failed without obvious reason.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      0af9325e
    • M
      schema: Allow multiple machines for VMs and unite architectures · 450a59ba
      Martin Kletzander 提交于
      Use the same pattern for all machine types on all archs and same archs
      for hvm and exe types.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      450a59ba
    • Z
      qemuDomainShutdownFlags: Set fakeReboot more frequently · 8be502fd
      zhang bo 提交于
      When a qemu domain is to be rebooted, from outside, at libvirt
      level it looks like regular shutdown. To really restart the
      domain, libvirt needs to issue reset command on the monitor once
      SHUTDOWN event appeared. So, in order to differentiate bare
      shutdown and reboot libvirt uses a variable within domain private
      data. It's called fakeReboot. When the reboot API is called, the
      variable is set, but when the shutdown API is called it must be
      cleared out. But it was not for every possible case. So if user
      called virDomainReboot(), and there was no ACPI daemon running
      inside the guest (so guest didn't initiated shutdown sequence)
      and then virDomainShutdown(mode=agent) was called bad thing
      happened. We remembered the fakeReboot and instead of shutting
      the domain down, we just rebooted it.
      Signed-off-by: NZhang Bo <oscar.zhangbo@huawei.com>
      Signed-off-by: NWang Yufei <james.wangyufei@huawei.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      8be502fd
    • M
      Introduce virNetDevBandwidthUpdateFilter · 176a95fd
      Michal Privoznik 提交于
      This is a simple wrapper around virNetDevBandwidthManipulateFilter() that
      will update the desired filter on an interface (usually a network bridge)
      with a new MAC address. Although, the MAC address in question usually
      refers to some other interface - the one that the filter is constructed
      for. Yeah, hard to parse. Thing is, our NATed network has a bridge where
      some part of QoS takes place. And vNICs from guests are plugged into
      the bridge. However, if a guest decides to change the MAC of its vNIC,
      the corresponding qemu process emits an event which we can use to
      update the QoS configuration based on the new MAC address.. However,
      our QoS hierarchy is currently not notified, therefore it falls apart.
      This function (when called in response to the aforementioned event)
      will update our QoS hierarchy and duct tape it together again.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      176a95fd
    • M
      virnetdevbandwidth.c: Separate tc filter creation to a function · c6f0be2f
      Michal Privoznik 提交于
      Not only this simplifies the code a bit, it prepares the
      environment for upcoming patches. The new
      virNetDevBandwidthManipulateFilter() function is capable of both
      removing a filter and adding a new one. At the same time! Yeah,
      this is not currently used anywhere but look at the next commit
      where you'll see it.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      c6f0be2f
    • M
      virNetDevBandwidthSet: Add priority to filter · 2397be69
      Michal Privoznik 提交于
      Currently, when constructing traffic shaping rules, the ingress
      filter is created without any priority specified on the command
      line. This makes kernel to make up one. While this works, it
      simplifies things a bit if we provide the filter priority. In
      this case, since it's the root filter lets give it the highest
      priority of number 1.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      2397be69
    • M
      virDomainActualNetDefContentsFormat: Format class_id more frequently · b68a56bc
      Michal Privoznik 提交于
      After a3609121 the formatting of virDomainActualNetDefPtr was
      changed a bit. However, during the function rewrite, iface's class_id
      is not formatted as frequently as it could be. In fact, after rewrite
      it's formatted only for iface of type VIR_DOMAIN_NET_TYPE_DIRECT where
      it makes no sense and is unused. While where needed (_TYPE_NETWORK) is
      not formatted at all. This makes the daemon forget it upon daemon
      restart resulting in bad behaviour.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      b68a56bc
    • M
      nwfilter: Partly initialize driver even for non-privileged users · 77d92e2e
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1211436
      
      This reverts commit b7829f95.
      
      The previous fix was not correct. Like everywhere else, a driver is a
      global variable allocated in stateInitialize function (or something
      similar for stateless drivers). Later, when a driver API is called,
      it's possible that the global variable is accessed and dereferenced.
      Now, some drivers require root privileges because they undertake some
      actions reserved only for the system admin (e.g. manipulating host
      firewall). And here's the trouble, the NWFilter state initializer
      exited too early when finding out it's running unprivileged, leaving
      the global NWFilter driver variable uninitialized. Any subsequent
      API call that tried to lock the driver resulted in dereferencing the
      driver and thus crash.
      
      On the other hand, in order to not resurrect the bug the original
      commit was fixing, Let's forbid the nwfilter define in session mode.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      
      Conflicts:
      	src/nwfilter/nwfilter_driver.c: Context. Code changed a bit
              since 2013.
      77d92e2e
    • M
      virNetSocketNewConnectUNIX: Don't unlink(NULL) · 1fdac3d9
      Michal Privoznik 提交于
      There is a possibility that we jump onto error label with @lockpath
      still initialized to NULL. Here, the @lockpath should be unlink()-ed,
      but passing there a NULL is not a good idea. Don't do that. In fact,
      we should call unlink() only if we created the lock file successfully.
      Reported-by: NJohn Ferlan <jferlan@redhat.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      1fdac3d9
    • L
      lxc: move wireless PHYs to a network namespace · 3a495948
      Lubomir Rintel 提交于
      The 802.11 interfaces can not be moved by themselves, their Phy has to move too.
      
      If there are other interfaces, they have to move too -- hopefully it's not too
      confusing. This is a less-invasive alternative to defining a new hostdev type
      for PHYs.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      3a495948
    • J
      libxl: drop virDomainObj lock when destroying a domain · 6dfec1ef
      Jim Fehlig 提交于
      A destroy operation can take considerable time on large memory
      domains due to scrubbing the domain's memory.  Unlock the
      virDomainObj while libxl_domain_destroy is executing.
      
      Implement libxlDomainDestroyInternal wrapper to handle unlocking,
      calling destroy, and locking.  Change all callers of
      libxl_domain_destroy to use the wrapper.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      6dfec1ef
    • J
      libxl: acquire a job when destroying a domain · 894d2ff7
      Jim Fehlig 提交于
      A job should be acquired at the beginning of a domain destroy operation,
      not at the end when cleaning up the domain.  Fix two occurrences of this
      late job acquisition in the libxl driver.  Doing so renders
      libxlDomainCleanupJob unused, so it is removed.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      894d2ff7
    • J
      libxl: Move job acquisition in libxlDomainStart to callers · f86ae403
      Jim Fehlig 提交于
      Let callers of libxlDomainStart decide when it is appropriate to
      acquire a job on the associated virDomainObj.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      f86ae403
    • J
      libxl: support HVM direct kernel boot · 13e2c220
      Jim Fehlig 提交于
      Add support for HVM direct kernel boot in libxl.  Also add a
      test to verify domXML <-> native conversions.
      Signed-off-by: NChunyan Liu <cyliu@suse.com>
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      13e2c220
    • J
      xenconfig: don't use "kernel" for hvmloader · 0fe504f1
      Jim Fehlig 提交于
      In xl config, hvmloader is implied for hvm guests.  It is not
      specified with the "kernel" option like xm config.  The "kernel"
      option, along with "ramdisk" and "extra", is used for HVM direct
      kernel boot.  Instead of using "kernel" option to populate
      virDomainDef object's os.loader->path, use hvmloader discovered
      when gathering capabilities.
      
      This change required fixing initialization of capabilities in
      the test utils and removing 'kernel = "/usr/lib/xen/boot/hvmloader"'
      from the test config files.
      0fe504f1
    • J
      xenconfig: move <os> parsing/formating to config-specific files · 717a9251
      Jim Fehlig 提交于
      xl and xm differ a bit in how <os> configuration is represented.
      E.g. xl config supports <os><nvram .../></os> via its "bios"
      setting.
      
      Move the xenParseOS and xenFormatOS functions from xen_common.c
      and copy to xen_xl.c and xen_xm.c so they can be customized for
      xm vs xl config.  An unfortunate fallout is reordering of entries
      in the test config files.
      717a9251
    • J
      xenconfig: remove redunant parsing of device_model · a9b0d647
      Jim Fehlig 提交于
      device_model is parsed in xenParseOS(), then later in
      xenParseConfigCommon().  <emulator> is not part of <os>,
      so makes sense to remove the parsing in xenParseOS().
      a9b0d647
    • J
      xenconfig: export xenConfigCopyString · 8680a19b
      Jim Fehlig 提交于
      Export xenConfigCopyString for use outside of xen_common.c
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      8680a19b
    • P
      virbuffer: fix build on rhel-6 · 358dbf84
      Pavel Hrdina 提交于
      On rhel-6 is broken gcc that reports this warning:
      
      util/virbuffer.c:500: error: logical '&&' with non-zero constant will
          always evaluate as true [-Wlogical-op]
      
      Move the pragma directive before function virBufferEscapeString because
      since commit aeb5262e this function uses 'strchr' too.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      358dbf84
    • J
      storage: Refactor virStorageBackendSCSINewLun · 0cf87b51
      John Ferlan 提交于
      Invert the logical of retval and clean up code paths, especially goto's
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      0cf87b51
  4. 16 4月, 2015 12 次提交