1. 17 2月, 2011 2 次提交
    • O
      storage: Allow to delete device mapper disk partition · df1011ca
      Osier Yang 提交于
      The name convention of device mapper disk is different, and 'parted'
      can't be used to delete a device mapper disk partition. e.g.
      
      Name                 Path
      -----------------------------------------
      3600a0b80005ad1d7000093604cae912fp1 /dev/mapper/3600a0b80005ad1d7000093604cae912fp1
      
      Error: Expecting a partition number.
      
      This patch introduces 'dmsetup' to fix it.
      
      Changes:
        - New function "virIsDevMapperDevice" in "src/utils/utils.c"
        - remove "is_dm_device" in "src/storage/parthelper.c", use
          "virIsDevMapperDevice" instead.
        - Requires "device-mapper" for 'with-storage-disk" in "libvirt.spec.in"
        - Check "dmsetup" in 'configure.ac' for "with-storage-disk"
        - Changes on "src/Makefile.am" to link against libdevmapper
        - New entry for "virIsDevMapperDevice" in "src/libvirt_private.syms"
      
      Changes from v1 to v3:
        - s/virIsDeviceMapperDevice/virIsDevMapperDevice/g
        - replace "virRun" with "virCommand"
        - sort the list of util functions in "libvirt_private.syms"
        - ATTRIBUTE_NONNULL(1) for virIsDevMapperDevice declaration.
      
      e.g.
      
      Name                 Path
      -----------------------------------------
      3600a0b80005ad1d7000093604cae912fp1 /dev/mapper/3600a0b80005ad1d7000093604cae912fp1
      
      Vol /dev/mapper/3600a0b80005ad1d7000093604cae912fp1 deleted
      
      Name                 Path
      -----------------------------------------
      df1011ca
    • O
      qemu: Error prompt when saving a shutoff domain · cd951ad2
      Osier Yang 提交于
      "qemudDomainSaveFlag" goto wrong label "endjob", which will cause
      error when security manager trying to restore label (regression).
      
      As it's more reasonable to check if vm is shutoff immediately, and
      return right away if it is, remove the checking in "qemudDomainSaveFlag",
      and add checking in "qemudDomainSave".
      
      * src/qemu/qemu_driver.c
      cd951ad2
  2. 16 2月, 2011 7 次提交
    • E
      cgroup: preserve correct errno on failure · 76c57a7c
      Eric Blake 提交于
      * src/util/cgroup.c (virCgroupSetValueStr, virCgroupGetValueStr)
      (virCgroupRemoveRecursively): VIR_DEBUG can clobber errno.
      (virCgroupRemove): Use VIR_DEBUG rather than DEBUG.
      76c57a7c
    • J
      qemu: Fix command line generation with faked host CPU · 453d05da
      Jiri Denemark 提交于
      The code expected that host CPU architecture matches the architecture on
      which libvirt runs. This is normally true but not in tests, where host
      CPU is faked to produce consistent results.
      453d05da
    • E
      docs: fix typos · c106a837
      Eric Blake 提交于
      * docs/drvopenvz.html.in: Spell administrator correctly.
      * docs/drvuml.html.in: Likewise.
      * src/qemu/qemu.conf: Likewise.  Fix other typos, too.
      c106a837
    • E
      build: address clang reports about virCommand · 3db08aea
      Eric Blake 提交于
      clang had 5 reports against virCommand; three were false positives
      (a NULL deref in ProcessIO solved by sa_assert, and two uninitialized
      memory operations solved by adding an initializer), but two were real.
      
      * src/util/command.c (virCommandProcessIO): Fix real bug of
      possible NULL dereference.  Teach clang that buf is never NULL.
      (virCommandRun): Teach clang that infd is only ever accessed when
      initialized.
      3db08aea
    • E
      qemu: don't mask real error with oom report · 56152be5
      Eric Blake 提交于
      * src/qemu/qemu_command.c (qemuBuildCommandLine): Don't report oom
      after qemuBuildControllerDevStr, which reported its own errors.
      56152be5
    • E
      qemu: avoid NULL derefs · abaa6560
      Eric Blake 提交于
      The processWatchdogEvent fix is real, although it can only trigger
      on OOM, since bad things happen if doCoreDump is called with a NULL
      pathname argument.  The other fixes silence clang, but aren't a real
      bug because virReportErrorHelper tolerates a NULL format string even
      though *printf does not.
      
      * src/qemu/qemu_driver.c (processWatchdogEvent): Exit on OOM.
      (qemuDomainIsActive, qemuDomainIsPersistent, qemuDomainIsUpdated):
      Provide valid message.
      abaa6560
    • E
      virDomainMemoryStats: avoid null dereference · ae891f95
      Eric Blake 提交于
      * src/libvirt.c (virDomainMemoryStats): Check domain before flags.
      ae891f95
  3. 15 2月, 2011 14 次提交
  4. 14 2月, 2011 1 次提交
  5. 13 2月, 2011 1 次提交
  6. 12 2月, 2011 4 次提交
    • M
      qemu: Report a more informative error for missing cgroup controllers · 1682bcf7
      Matthias Bolte 提交于
      Also use VIR_ERR_OPERATION_INVALID instead of VIR_ERR_NO_SUPPORT, as
      the operation could succeed when the cgroup controller was mounted.
      1682bcf7
    • O
      xen: Prevent updating device when attaching a device · 0e629db3
      Osier Yang 提交于
      When attaching a device that already exists, xend driver updates
      the device with "device_configure", it causes problems (e.g. for
      disk device, 'device_configure' only can be used to update device
      like CDROM), on the other hand, we provide additional API
      (virDomainUpdateDevice) to update device, this fix is to raise up
      errors instead of updating the existed device which is not CDROM
      device.
      
      Changes from v1 to v2:
        - allow to update CDROM
      
      * src/xen/xend_internal.c
      0e629db3
    • E
      build: fix cygwin strerror_r failure · 699a5888
      Eric Blake 提交于
      Building the 0.8.8 release candidate on cygwin produced this compiler
      warning, which is indicative of catastrophic failure on any attempt to
      print an error message with errno turned to a string:
      
        CC       strerror_r.lo
      strerror_r.c: In function 'rpl_strerror_r':
      strerror_r.c:67: warning: assignment makes integer from pointer without a cast
      
      This has been fixed in gnulib.
      
      * .gnulib: Update to latest, for strerror_r fix.
      * src/util/memory.c (includes): Satisfy 'make syntax-check'.
      699a5888
    • P
      qemu: Fix escape_monitor(escape_shell(command)) · f370fc37
      Philipp Hahn 提交于
      Suspending a VM which contains shell meta characters doesn't work with
      libvirt-0.8.7:
      /var/log/libvirt/qemu/andreas_231-ne\ doch\ nicht.log:
        sh: -c: line 0: syntax error near unexpected token `doch'
        sh: -c: line 0: `cat | { dd bs=4096 seek=1 if=/dev/null && dd bs=1048576; }
      
      Although target="andreas_231-ne doch nicht" contains shell meta
      characters (here: blanks), they are not properly escaped by
      src/qemu/qemu_monitor_{json,text}.c#qemuMonitor{JSON,Text}MigrateToFile()
      
      First, the filename needs to be properly escaped for the shell, than
      this command line has to be properly escaped for qemu again.
      
      For this to work, remove the old qemuMonitorEscapeArg() wrapper, rename
      qemuMonitorEscape() to it removing the handling for shell=TRUE, and
      implement a new qemuMonitorEscapeShell() returning strings using single
      quotes.
      
      Using double quotes or escaping special shell characters with backslashes
      would also be possible, but the set of special characters heavily
      depends on the concrete shell (dsh, bash, zsh) and its setting (history
      expansion, interactive use, ...)
      Signed-off-by: NPhilipp Hahn <hahn@univention.de>
      f370fc37
  7. 11 2月, 2011 2 次提交
    • D
      Imprint all logs with version + package build information · cee61fc2
      Daniel P. Berrange 提交于
      The logging functions are enhanced so that immediately prior to
      the first log message being printed to any output channel, the
      libvirt package version will be printed.
      
      eg
      
       $ LIBVIRT_DEBUG=1 virsh
       18:13:28.013: 17536: info : libvirt version: 0.8.7
       18:13:28.013: 17536: debug : virInitialize:361 : register drivers
       ...
      
      The 'configure' script gains two new arguments which can be
      used as
      
         --with-packager="Fedora Project, x86-01.phx2.fedoraproject.org, 01-27-2011-18:00:10"
         --with-packager-version="1.fc14"
      
      to allow distros to append a custom string with package specific
      data.
      
      The RPM specfile is modified so that it appends the RPM version,
      the build host, the build date and the packager name.
      
      eg
      
       $ LIBVIRT_DEBUG=1 virsh
       18:14:52.086: 17551: info : libvirt version: 0.8.7, package: 1.fc13 (Fedora Project, x86-01.phx2.fedoraproject.org, 01-27-2011-18:00:10)
       18:14:52.086: 17551: debug : virInitialize:361 : register drivers
      
      Thus when distro packagers receive bug reports they can clearly
      see what version was in use, even if the bug reporter mistakenly
      or intentionally lies about version/builds
      
      * src/util/logging.c: Output version data prior to first log message
      * libvirt.spec.in: Include RPM release, date, hostname & packager
      * configure.ac: Add --with-packager & --with-packager-version args
      cee61fc2
    • W
      qemu: fix attach-interface regression · 6bf4788e
      Wen Congyang 提交于
      QEMUD_CMD_FLAG_PCI_MULTIBUS should be set in the function
      qemuCapsExtractVersionInfo()
      
      The flag QEMUD_CMD_FLAG_PCI_MULTIBUS is used in the function
      qemuBuildDeviceAddressStr(). All callers get qemuCmdFlags
      by the function qemuCapsExtractVersionInfo() except that
      testCompareXMLToArgvFiles() in qemuxml2argvtest.c.
      
      So we should set QEMUD_CMD_FLAG_PCI_MULTIBUS in the function
      qemuCapsExtractVersionInfo() instead of qemuBuildCommandLine()
      because the function qemuBuildCommandLine() does not be called
      when we attach a pci device.
      
      tests: set QEMUD_CMD_FLAG_PCI_MULTIBUS in testCompareXMLToArgvFiles()
      
      set QEMUD_CMD_FLAG_PCI_MULTIBUS before calling qemuBuildCommandLine()
      as the flags is not set by qemuCapsExtractVersionInfo().
      Signed-off-by: NWen Congyang <wency@cn.fujitsu.com>
      6bf4788e
  8. 10 2月, 2011 9 次提交
    • D
      Reduce log level when cgroups aren't mounted · eacb3bb0
      Daniel P. Berrange 提交于
      Quite a few hosts don't have cgroups mounted and so see warnings
      from libvirt logged, which then cause bug reports, etc. Reduce
      the log level to INFO so they're not visible by default
      
      * src/qemu/qemu_driver.c: Reduce log level for cgroups
      eacb3bb0
    • D
      Avoid warnings from nwfilter driver when run non-root · 525434dd
      Daniel P. Berrange 提交于
      When run non-root the nwfilter driver logs error messages about
      being unable to find iptables/ebtables commands (they are in
      /sbin which isn't in $PATH). The nwfilter driver can't ever work
      as non-root, so simply skip it entirely thus avoiding the error
      messages
      
      * src/conf/nwfilter_conf.h, src/nwfilter/nwfilter_driver.c,
        src/nwfilter/nwfilter_gentech_driver.c,
        src/nwfilter/nwfilter_gentech_driver.h: Pass 'bool privileged'
        flag down to final driver impl
      * src/nwfilter/nwfilter_ebiptables_driver.c: Skip initialization
        if not privileged
      525434dd
    • M
      Fix typo in parsing of spice 'auth' data · 10713b1b
      Michal Privoznik 提交于
      A typo s/spice/vnc/ caused parsing of the spice 'auth' data
      to write into the wrong part of the struct, blowing away
      other unrelated data.
      
      * src/conf/domain_conf.c: s/vnc/spice/ in parsing spice auth
      10713b1b
    • D
      Adjust some log levels in udev driver · 7a4bc156
      Daniel P. Berrange 提交于
      Most of te VIR_INFO calls in the udev driver are only relevant
      to developers so can switch to VIR_DEBUG. Failure to initialize
      libpciaccess though is a fatal error
      
      * src/node_device/node_device_udev.c: Adjust log levels
      7a4bc156
    • D
      Add check for binary existing in machine type probe · bf6a3825
      Daniel P. Berrange 提交于
      When probing machine types if the QEMU binary does not exist
      we get a hard to diagnose error, due to the execve() in the
      child failing
      
      error: internal error Child process exited with status 1.
      
      Add an explicit check so that we get
      
      error: Cannot find QEMU binary /usr/libexec/qem3u-kvm: No such file or directory
      
      * src/qemu/qemu_capabilities.c: Check for QEMU binary
      bf6a3825
    • D
      Add a little more debugging for async events · 2222bd24
      Daniel P. Berrange 提交于
      To make it easier to investigate problems with async event
      delivery, add two more debugging lines
      
      * daemon/remote.c: Debug when an event is queued for dispatch
      * src/remote/remote_driver.c: Debug when an event is received
        for processing
      2222bd24
    • D
      Move connection driver modules directory · 8ce5d404
      Daniel P. Berrange 提交于
      When built as modules, the connection drivers live
      in $LIBDIR/libvirt/drivers. Now we add lock manager
      drivers, we need to distinguish. So move the existing
      modules to 'connection-driver'
      
      * src/Makefile.am: Move module install dir
      * src/driver.c: Move module search dir
      8ce5d404
    • D
      Reset logging filter function when forking · 88d04d17
      Daniel P. Berrange 提交于
      To ensure child processes will log all error messages, reset
      the logging filter function when forking
      
      * src/util/util.c: Reset log filter in fork
      88d04d17
    • D
      Block SIGPIPE around virExec hook functions · ab07533e
      Daniel P. Berrange 提交于
      Some functionality run in virExec hooks may do I/O which
      can trigger SIGPIPE. Renable SIGPIPE blocking around the
      hook function
      
      * src/util/util.c: Block SIGPIPE around hooks
      ab07533e