1. 15 2月, 2011 5 次提交
    • E
      qemu: ignore failure of qemu -M ? on older qemu · e046d41f
      Eric Blake 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=676563
      
      Regression introduced in commit 22115181.
      
      * src/qemu/qemu_capabilities.c (qemuCapsProbeMachineTypes): Allow
      non-zero exit status.
      e046d41f
    • E
      xml: avoid compiler warning · 83a0489a
      Eric Blake 提交于
      Detected by clang.
      
      * src/util/xml.c (virXPathStringLimit): Use %zd, not obsolete %Zd.
      83a0489a
    • S
      nwfilter: reorder match extensions relative to state match · 13e9ba7c
      Stefan Berger 提交于
      This patch reorders the connlimit and comment match extensions relative to the state match (-m state); connlimit being most useful if found after a -m state --state NEW and not before it.
      13e9ba7c
    • J
      conf: Fix XML generation for smartcards · f7bec649
      Jiri Denemark 提交于
      When formatting XML for smartcard device with mode=host, libvirt
      generates invalid XML if the device has address info associated:
      
      <smartcard mode='host' <address type='ccid' controller='0' slot='1'/>
      f7bec649
    • D
      Fix cleanup on VM state after failed QEMU startup · 41f551e2
      Daniel P. Berrange 提交于
      Commit 9962e406 introduced a
      problem where if the VM failed to startup, it would not be
      correctly cleaned up. Amongst other things the SELinux
      security label would not be removed, which prevents the VM
      from ever starting again.
      
      The virDomainIsActive() check at the start of qemudShutdownVMDaemon
      checks for vm->def->id not being -1. By moving the assignment of the
      VM id to the start of qemudStartVMDaemon, we can ensure cleanup will
      occur on failure
      
      * src/qemu/qemu_driver.c: Move initialization of 'vm->def->id'
        so that qemudShutdownVMDaemon() will process the shutdown
      41f551e2
  2. 14 2月, 2011 2 次提交
  3. 13 2月, 2011 1 次提交
  4. 12 2月, 2011 7 次提交
    • E
      virsh: avoid mingw compiler warnings · 92f0ed03
      Eric Blake 提交于
      Compilation on mingw was warning about %lld use in fprintf, and
      in the gnulib strptime module about dead labels.
      
      * tools/virsh.c (vshPrint): Change redirect.
      (vshPrintExtra): Allow use within vshPrint.  Avoid fprintf on
      arbitrary formats, since we aren't using gnulib module; instead,
      use virVasprintf to pre-format.
      (vshError): Likewise.
      * .gnulib: Update to latest, for mingw strptime warning fix.
      Reported by Matthias Bolte.
      92f0ed03
    • E
      build: avoid problems with autogen.sh runs from tarball · 3a97fa28
      Eric Blake 提交于
      Introduced by commit fac97c65 distributing cfg.mk, which
      previously could blindly assume it was in a git checkout.
      
      * cfg.mk (_update_required): Also check for .git.
      * autogen.sh: Don't run bootstrap from a tarball.
      Reported by Daniel Veillard.
      3a97fa28
    • M
      docs: Distribute XSLT files to generate HACKING · 117b2a67
      Matthias Bolte 提交于
      117b2a67
    • 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
  5. 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
  6. 10 2月, 2011 15 次提交
    • D
      Avoid pthread_sigmask on Win32 platforms · 100f4a63
      Daniel P. Berrange 提交于
      Win32 doesn't have a concept of signal masks so disable that
      code. It is unclear how SIGINT is delivered (if at all) on
      Win32, so this might further work to provide an alternative
      to pthread_sigmask
      
      * tools/virsh.c: Avoid pthread_sigmask on Win32
      100f4a63
    • 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
    • E
      build: distribute 'make syntax-check' tweaks · fac97c65
      Eric Blake 提交于
      * Makefile.am (EXTRA_DIST): Distribute cfg.mk.
      fac97c65
    • M
      9a527462
    • E
      maint: whitespace cleanup · 1652fa2f
      Eric Blake 提交于
      * .dir-locals.el (html-mode): Let emacs help out.
      * cfg.mk (sc_TAB_in_indentation): Check more files.
      * docs/internals/command.html.in: Fix offenders.
      * docs/formatdomain.html.in: Likewise.
      * docs/internals.html.in: Likewise.
      Reported by Jiri Denemark.
      1652fa2f
    • 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
    • D
      Support SCSI RAID type & lower log level for unknown types · cd782cc3
      Daniel P. Berrange 提交于
      The Linux kernel headers don't have a value for SCSI type 12,
      but HAL source code shows this to be a 'raid'. Add workaround
      for this type. Lower log level for unknown types since
      this is not a fatal error condition. Include the device sysfs
      path in the log output to allow identification of which device
      has problems.
      
      * src/node_device/node_device_udev.c: Add SCSI RAID type
      cd782cc3
    • D
      Only initialize/cleanup libpciaccess once · 2215050e
      Daniel P. Berrange 提交于
      libpciaccess has many bugs in its pci_system_init/cleanup
      functions that makes calling them multiple times unwise.
      eg it will double close() FDs, and leak other FDs.
      
      * src/node_device/node_device_udev.c: Only initialize
        libpciaccess once
      2215050e
  7. 09 2月, 2011 8 次提交
    • S
      Don't use CLONE_NEWUSER for now · 28209ca0
      Serge E. Hallyn 提交于
      Until now, user namespaces have not done much, but (for that
      reason) have been innocuous to glob in with other CLONE_
      flags.  Upcoming userns development, however, will make tasks
      cloned with CLONE_NEWUSER far more restricted.  In particular,
      for some time they will be unable to access files with anything
      other than the world access perms.
      
      This patch assumes that noone really needs the user namespaces
      to be enabled.  If that is wrong, then we can try a more
      baroque patch where we create a file owned by a test userid with
      700 perms and, if we can't access it after setuid'ing to that
      userid, then return 0.  Otherwise, assume we are using an
      older, 'harmless' user namespace implementation.
      
      Comments appreciated.  Is it ok to do this?
      Signed-off-by: NSerge Hallyn <serge.hallyn@canonical.com>
      28209ca0
    • E
      sysinfo: implement qemu support · 5ec8fb56
      Eric Blake 提交于
      * src/qemu/qemu_driver.c (qemuGetSysinfo): New function.
      (qemuDriver): Install it.
      5ec8fb56
    • E
      sysinfo: refactor xml formatting · cb5b5380
      Eric Blake 提交于
      * src/util/sysinfo.h (virSysinfoFormat): New prototype.
      * src/conf/domain_conf.c (virDomainSysinfoDefFormat): Move guts...
      * src/util/sysinfo.c (virSysinfoFormat): ...into new function.
      * src/libvirt_private.syms: Export it.
      cb5b5380
    • E
      sysinfo: implement virsh support · c82be053
      Eric Blake 提交于
      * tools/virsh.c (cmdSysinfo): New function.
      (hostAndHypervisorCmds): Add it.
      * tools/virsh.pod: Document it.
      c82be053
    • E
      sysinfo: implement the remote protocol · 5c8deddd
      Eric Blake 提交于
      Done by editing the first three files, then running
      'make -C src rpcgen', then editing src/remote_protocol-structs
      to match.
      
      * daemon/remote.c (remoteDispatchGetSysinfo): New function.
      * src/remote/remote_driver.c (remoteGetSysinfo, remote_driver):
      Client side serialization.
      * src/remote/remote_protocol.x (remote_get_sysinfo_args)
      (remote_get_sysinfo_ret): New types.
      (REMOTE_PROC_GET_SYSINFO): New enum value.
      * daemon/remote_dispatch_args.h: Regenerate.
      * daemon/remote_dispatch_prototypes.h: Likewise.
      * daemon/remote_dispatch_ret.h: Likewise.
      * daemon/remote_dispatch_table.h: Likewise.
      * src/remote/remote_protocol.c: Likewise.
      * src/remote/remote_protocol.h: Likewise.
      * src/remote_protocol-structs: Likewise.
      5c8deddd
    • E
      sysinfo: implement the public API · addee8a0
      Eric Blake 提交于
      * src/libvirt.c (virConnectGetSysinfo): New function.
      * docs/formatdomain.html.in: Mention it.
      addee8a0
    • E
      sysinfo: define internal driver API · dec13a5a
      Eric Blake 提交于
      * src/driver.h (virDrvGetSysinfo): New typedef.
      (_virDriver): New callback member.
      * src/esx/esx_driver.c (esxDriver): Add stub for driver.
      * src/lxc/lxc_driver.c (lxcDriver): Likewise.
      * src/opennebula/one_driver.c (oneDriver): Likewise.
      * src/openvz/openvz_driver.c (openvzDriver): Likewise.
      * src/phyp/phyp_driver.c (phypDriver): Likewise.
      * src/qemu/qemu_driver.c (qemuDriver): Likewise.
      * src/remote/remote_driver.c (remote_driver): Likewise.
      * src/test/test_driver.c (testDriver): Likewise.
      * src/uml/uml_driver.c (umlDriver): Likewise.
      * src/vbox/vbox_tmpl.c (Driver): Likewise.
      * src/vmware/vmware_driver.c (vmwareDriver): Likewise.
      * src/xen/xen_driver.c (xenUnifiedDriver): Likewise.
      * src/xenapi/xenapi_driver.c (xenapiDriver): Likewise.
      dec13a5a
    • E
      sysinfo: expose new API · 353b7609
      Eric Blake 提交于
      The new virConnectGetSysinfo() API allows one to get the system
      information associated to a connection host, providing the same
      data as a guest that uses <os><smbios mode='host'/></os>, and in
      a format that can be pasted into the guest and edited when using
      <os><smbios mode='sysinfo'/></os>.
      
      * include/libvirt/libvirt.h.in (virConnectGetSysinfo): Declare.
      * src/libvirt_public.syms: Export new symbol.
      353b7609