]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
15 years agovirDiskNameToIndex: ignore trailing digits
Jim Meyering [Fri, 19 Mar 2010 17:26:09 +0000 (18:26 +0100)]
virDiskNameToIndex: ignore trailing digits

* src/util/util.c (virDiskNameToIndex): Accept sda1, and map it to "sda".
I.e., accept and ignore any string of trailing digits.

15 years agoutil: Add stubs for some functions on Windows
Matthias Bolte [Sat, 20 Mar 2010 10:57:30 +0000 (11:57 +0100)]
util: Add stubs for some functions on Windows

virSetCloseExec and virExecDaemonize were missing a body on Windows.

15 years agoAdd HAVE_PTHREAD_H guard for pthread_sigmask
Matthias Bolte [Fri, 19 Mar 2010 20:09:30 +0000 (21:09 +0100)]
Add HAVE_PTHREAD_H guard for pthread_sigmask

Correctly disable pthread related code if pthread is not avialable,
in order to get it compile with MinGW on Windows.

15 years agobootstrap: Enable copy-mode for MinGW builds
Matthias Bolte [Wed, 17 Mar 2010 18:22:50 +0000 (19:22 +0100)]
bootstrap: Enable copy-mode for MinGW builds

MSYS' ln doesn't work well in the way bootstrap uses it with relative paths.

15 years agoutil: Handle lack of (f)chmod and (f)chown on Windows
Matthias Bolte [Wed, 17 Mar 2010 15:36:08 +0000 (16:36 +0100)]
util: Handle lack of (f)chmod and (f)chown on Windows

Even if gnulib can provide stubs, it won't help that much. So just
replace affected util functions (virFileOperation and virDirCreate)
with stubs on Windows. Both functions aren't used on libvirt's
client side, so this is fine for MinGW builds.

15 years agobootstrap: Remove rsync from buildreq list
Matthias Bolte [Wed, 17 Mar 2010 15:13:45 +0000 (16:13 +0100)]
bootstrap: Remove rsync from buildreq list

rsync is used to download .po files, but SKIP_PO=true is set and
downloading .po files is skipped.

This also fixes a problem with MinGW builds, because rsync is not
available for MinGW.

15 years agoutil: Make some conditional symbols unconditional
Matthias Bolte [Wed, 17 Mar 2010 00:06:31 +0000 (01:06 +0100)]
util: Make some conditional symbols unconditional

Add dummy bodies for HAVE_GETPWUID_R and HAVE_MNTENT_H dependent
functions for MinGW builds.

15 years agoMake sure virtTestCaptureProgramOutput has a body on Windows
Matthias Bolte [Tue, 16 Mar 2010 23:36:07 +0000 (00:36 +0100)]
Make sure virtTestCaptureProgramOutput has a body on Windows

Now the virsh tests compile at least.

15 years agoFix export of virConnectAuthPtrDefault for MinGW builds
Matthias Bolte [Tue, 16 Mar 2010 22:54:22 +0000 (23:54 +0100)]
Fix export of virConnectAuthPtrDefault for MinGW builds

Use the __declspec(dllexport/dllimport) stuff to export the symbol,
otherwise accessing virConnectAuthPtrDefault triggers a segfault.

15 years agoRemove interfaceRegister from libvirt_private.syms
Matthias Bolte [Tue, 16 Mar 2010 22:38:01 +0000 (23:38 +0100)]
Remove interfaceRegister from libvirt_private.syms

This symbol is conditional, it would need to be exported conditional to
work properly with MinGW. So just remove it, as no other driver register
function is listed in the symbols files.

15 years agoExport conditional state driver symbols only when they are defined
Matthias Bolte [Mon, 15 Mar 2010 01:02:57 +0000 (02:02 +0100)]
Export conditional state driver symbols only when they are defined

This is necessary for MinGW builds.

15 years agoMake sure uid_t and gid_t are available
Matthias Bolte [Mon, 15 Mar 2010 01:02:10 +0000 (02:02 +0100)]
Make sure uid_t and gid_t are available

15 years agoesx: Add esxVI_LookupVirtualMachineByName
Matthias Bolte [Tue, 2 Mar 2010 23:57:57 +0000 (00:57 +0100)]
esx: Add esxVI_LookupVirtualMachineByName

Used in esxDomainLookupByName and to be used in esxDomainDefineXML later.

15 years agoesx: Fix potential memory leak in esxVI_BuildFullTraversalSpecItem
Matthias Bolte [Tue, 2 Mar 2010 22:15:00 +0000 (23:15 +0100)]
esx: Fix potential memory leak in esxVI_BuildFullTraversalSpecItem

If esxVI_String_DeepCopyValue or esxVI_SelectionSpec_AppendToList fail
then selectionSpec would leak. Add a free call in the failure path to
fix the leak.

15 years agoesx: Cleanup file header comments
Matthias Bolte [Tue, 2 Mar 2010 21:19:24 +0000 (22:19 +0100)]
esx: Cleanup file header comments

Replace 'method' with 'function' and get the filename's suffix right.

15 years agoesx: Generate method mappings via macros
Matthias Bolte [Tue, 23 Feb 2010 00:06:58 +0000 (01:06 +0100)]
esx: Generate method mappings via macros

This is actually a consequence of the reworked required parameter
checking: Unify the required parameter check into a Validate function
instead of doing it separately im the (de)serialization part.

The required parameter checking for the mapped methods parameter was
done in the (de)serialize functions before. Now it's explicitly done
in the mapped method itself.

15 years agoAvoid libvirtd crash when cgroups is not configured on host
Jim Fehlig [Mon, 22 Mar 2010 15:42:14 +0000 (09:42 -0600)]
Avoid libvirtd crash when cgroups is not configured on host

Invoking virDomainSetMemory() on lxc driver results in libvirtd
segfault when cgroups has not been configured on the host.

Ensure driver->cgroup is non-null before invoking
virCgroupForDomain().  To prevent similar segfaults in the future,
ensure driver parameter to virCgroupForDomain() is non-null before
dereferencing.

15 years agosecurity: selinux: Fix crash when releasing non-existent label
Cole Robinson [Mon, 22 Mar 2010 14:45:36 +0000 (10:45 -0400)]
security: selinux: Fix crash when releasing non-existent label

This can be triggered by the qemuStartVMDaemon cleanup path if a
VM references a non-existent USB device (by product) in the XML.

15 years agoDon't crash without a security driver
Guido Günther [Wed, 17 Mar 2010 20:04:11 +0000 (21:04 +0100)]
Don't crash without a security driver

"virsh dominfo <vm>" crashes if there's no primary security driver set
since we only intialize the secmodel.model and secmodel.doi if we have
one. Attached patch checks for securityPrimaryDriver instead of
securityDriver since the later is always set in qemudSecurityInit().

Closes: http://bugs.debian.org/574359
15 years agoAdd migrate-setmaxdowntime command to virsh
Jiri Denemark [Wed, 17 Mar 2010 16:18:36 +0000 (17:18 +0100)]
Add migrate-setmaxdowntime command to virsh

15 years agoImplement virDomainMigrateSetMaxDowntime in qemu driver
Jiri Denemark [Wed, 17 Mar 2010 15:53:14 +0000 (16:53 +0100)]
Implement virDomainMigrateSetMaxDowntime in qemu driver

15 years agoImplement virDomainMigrateSetMaxDowntime in remote driver
Jiri Denemark [Wed, 17 Mar 2010 15:49:38 +0000 (16:49 +0100)]
Implement virDomainMigrateSetMaxDowntime in remote driver

15 years agoWire protocol and dispatcher for virDomainMigrateSetMaxDowntime
Jiri Denemark [Fri, 12 Mar 2010 15:21:10 +0000 (16:21 +0100)]
Wire protocol and dispatcher for virDomainMigrateSetMaxDowntime

15 years agoPublic virDomainMigrateSetMaxDowntime API
Jiri Denemark [Fri, 12 Mar 2010 13:55:27 +0000 (14:55 +0100)]
Public virDomainMigrateSetMaxDowntime API

15 years agoInternal driver API for virDomainMigrateSetMaxDowntime
Jiri Denemark [Fri, 12 Mar 2010 13:55:08 +0000 (14:55 +0100)]
Internal driver API for virDomainMigrateSetMaxDowntime

15 years agoVirsh support for vol wiping
David Allan [Tue, 2 Mar 2010 03:10:40 +0000 (22:10 -0500)]
Virsh support for vol wiping

15 years agoSimplified version of volume wiping based on feedback from the list.
David Allan [Tue, 23 Feb 2010 03:13:18 +0000 (22:13 -0500)]
Simplified version of volume wiping based on feedback from the list.

15 years agoImplement remote bits for vol wiping
David Allan [Mon, 1 Mar 2010 20:32:35 +0000 (15:32 -0500)]
Implement remote bits for vol wiping

15 years agoImplement the public API for vol wiping
David Allan [Mon, 1 Mar 2010 20:27:27 +0000 (15:27 -0500)]
Implement the public API for vol wiping

15 years agoDefine the internal driver API for vol wiping
David Allan [Mon, 1 Mar 2010 20:15:16 +0000 (15:15 -0500)]
Define the internal driver API for vol wiping

Also add vol wiping to ESX storage driver struct

15 years agoAdd public API for volume wiping
David Allan [Mon, 1 Mar 2010 19:56:46 +0000 (14:56 -0500)]
Add public API for volume wiping

15 years agoSupport vhost-net mode at qemu startup for virtio network devices
Laine Stump [Fri, 19 Mar 2010 15:58:14 +0000 (16:58 +0100)]
Support vhost-net mode at qemu startup for virtio network devices

Attempt to turn on vhost-net mode for devices of type NETWORK, BRIDGE,
and DIRECT (macvtap).

* src/qemu/qemu_conf.h: add vhostfd to qemuBuildHostNetStr prototype
  add qemudOpenVhostNet prototype new flag to set when :,vhost=" found in
  qemu help
* src/qemu/qemu_conf.c: * set QEMUD_CMD_FLAG_VNET_HOST is ",vhost=" found
  in qemu help
   - qemudOpenVhostNet - opens /dev/vhost-net to pass to qemu if everything
     is in place to use it.
   - qemuBuildHostNetStr - add vhostfd to commandline if it's not empty
     (higher levels decide whether or not to fill it in)
   - qemudBuildCommandLine - if /dev/vhost-net is successfully opened, add
     its fd to tapfds array so it isn't closed on qemu exec, and populate
     vhostfd_name to be passed in to commandline builder.
* src/qemu/qemu_driver.c: add filler 0 for new arg to qemuBuildHostNetStr,
  along with a note that this must be implemented in order for hot-plug of
  vhost-net virtio devices to work properly (once qemu "netdev_add" monitor
  command is implemented).

15 years agoqemu: Fix FD leak in qemudStartVMDaemon
Matthias Bolte [Wed, 17 Mar 2010 21:21:03 +0000 (22:21 +0100)]
qemu: Fix FD leak in qemudStartVMDaemon

The logfile FD is dup2'ed in __virExec in the child. The FD needs to
be closed in the parent, otherwise it leaks.

15 years agoutil: ensure virMutexInit is not recursive
Eric Blake [Thu, 18 Mar 2010 17:32:16 +0000 (11:32 -0600)]
util: ensure virMutexInit is not recursive

POSIX states that creation of a mutex with default attributes
is unspecified whether the mutex is recursive or non-recursive.
We specifically want non-recursive (deadlock is desirable in
flushing out coding bugs that used our mutex incorrectly).

* src/util/threads-pthread.c (virMutexInit): Specifically request
non-recursive mutex, rather than relying on unspecified default.

15 years agomaint: enforce recent copyright style
Eric Blake [Thu, 18 Mar 2010 17:25:01 +0000 (11:25 -0600)]
maint: enforce recent copyright style

* cfg.mk (sc_copyright_format): New rule.

15 years agomaint: make Red Hat copyright notices consistent
Eric Blake [Fri, 12 Mar 2010 17:47:26 +0000 (10:47 -0700)]
maint: make Red Hat copyright notices consistent

Spell out 'Red Hat, Inc.':
 git grep -i 'Copyright.*Red Hat' | grep -v Inc

Include (C) consistently:
 git grep -i 'Copyright [^(].*Red Hat'

* src/lxc/lxc_container.c: Update copyright formatting.
* src/node_device/node_device_udev.c: Likewise.
* src/node_device/node_device_udev.h: Likewise.
* src/xen/xend_internal.h: Likewise.
* src/xen/xm_internal.c: Likewise.
* src/xen/xm_internal.h: Likewise.
* tests/xmconfigtest.c: Likewise.
* tests/object-locking.ml: Likewise.
* tools/virt-pki-validate.in: Likewise.
* tools/virt-xml-validate.in: Likewise.

15 years agomaint: fix typo
Eric Blake [Thu, 18 Mar 2010 14:39:59 +0000 (08:39 -0600)]
maint: fix typo

* cfg.mk (sc_prohibit_gettext_noop): Fix typo

15 years agomaint: enforce recent N_ usage
Eric Blake [Thu, 18 Mar 2010 13:05:44 +0000 (14:05 +0100)]
maint: enforce recent N_ usage

* cfg.mk (sc_prohibit_gettext_noop): New rule applied in "make syntax-check"

15 years agoFix logroate rpm build breakage
Daniel Veillard [Thu, 18 Mar 2010 12:50:08 +0000 (13:50 +0100)]
Fix logroate rpm build breakage

related to fix of bug https://bugzilla.redhat.com/show_bug.cgi?id=547514

15 years agoFix LSB compliance of init script
Daniel Veillard [Wed, 3 Mar 2010 10:55:06 +0000 (11:55 +0100)]
Fix LSB compliance of init script

https://bugzilla.redhat.com/show_bug.cgi?id=538701

* daemon/libvirtd.init.in: daemon/libvirtd.init.in were not mentionned
  in the usage message and if a missing or wrong argument is given it
  should return 2, not 1

15 years agodocs: <pre> cannot be nested in <p>
Matthias Bolte [Sat, 13 Mar 2010 14:04:34 +0000 (15:04 +0100)]
docs: <pre> cannot be nested in <p>

xsltproc complained about this.

15 years agopython: Fix networkLookupByUUID
Philip Hahn [Wed, 17 Mar 2010 16:34:04 +0000 (12:34 -0400)]
python: Fix networkLookupByUUID

According to:

http://libvirt.org/html/libvirt-libvirt.html#virNetworkLookupByUUID

virNetworkLookupByUUID() expects a virConnectPtr as its first argument,
thus making it a method of the virConnect Python class.

Currently it's a method of libvirt.virNetwork.

@@ -805,13 +805,6 @@ class virNetwork:
         if ret == -1: raise libvirtError ('virNetworkGetAutostart() failed', net=self)
         return ret

-    def networkLookupByUUID(self, uuid):
-        """Try to lookup a network on the given hypervisor based on its UUID. """
-        ret = libvirtmod.virNetworkLookupByUUID(self._o, uuid)
-        if ret is None:raise libvirtError('virNetworkLookupByUUID() failed', net=self)
-        __tmp = virNetwork(self, _obj=ret)
-        return __tmp
-
 class virInterface:
     def __init__(self, conn, _obj=None):
         self._conn = conn
@@ -1689,6 +1682,13 @@ class virConnect:
         __tmp = virDomain(self,_obj=ret)
         return __tmp

+    def networkLookupByUUID(self, uuid):
+        """Try to lookup a network on the given hypervisor based on its UUID. """
+        ret = libvirtmod.virNetworkLookupByUUID(self._o, uuid)
+        if ret is None:raise libvirtError('virNetworkLookupByUUID() failed', conn=self)
+        __tmp = virNetwork(self, _obj=ret)
+        return __tmp
+

15 years ago.gitignore: Ignore generated daemon/libvirtd.logrotate
Cole Robinson [Wed, 17 Mar 2010 16:27:41 +0000 (12:27 -0400)]
.gitignore: Ignore generated daemon/libvirtd.logrotate

15 years agoFix make dist with XenAPI changes
Cole Robinson [Wed, 17 Mar 2010 16:25:50 +0000 (12:25 -0400)]
Fix make dist with XenAPI changes

15 years agoAllow suspend during live migration
Jiri Denemark [Mon, 15 Mar 2010 13:19:00 +0000 (14:19 +0100)]
Allow suspend during live migration

Currently no command can be sent to a qemu process while another job is
active. This patch adds support for signaling long-running jobs (such as
migration) so that other threads may request predefined operations to be
done during such jobs. Two signals are defined so far:
    - QEMU_JOB_SIGNAL_CANCEL
    - QEMU_JOB_SIGNAL_SUSPEND

The first one is used by qemuDomainAbortJob.

The second one is used by qemudDomainSuspend for suspending a domain
during migration, which allows for changing live migration into offline
migration. However, there is a small issue in the way qemudDomainSuspend
is currently implemented for migrating domains. The API calls returns
immediately after signaling migration job which means it is asynchronous
in this specific case.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
15 years agodo not require two ./autogen.sh runs to permit "make"
Jim Meyering [Tue, 16 Mar 2010 20:08:31 +0000 (21:08 +0100)]
do not require two ./autogen.sh runs to permit "make"

* autogen.sh (bootstrap_hash): New function.
Running bootstrap may update the gnulib SHA1, yet we were computing
t=$(git submodule status ...) *prior* to running bootstrap, and
then recording that sometimes-stale value in the stamp file upon
a successful bootstrap run.  That would require two (lengthy!)
bootstrap runs to update the stamp file.

15 years agophyp: Use virRequestUsername and virRequestPassword
Matthias Bolte [Sun, 14 Mar 2010 20:46:32 +0000 (21:46 +0100)]
phyp: Use virRequestUsername and virRequestPassword

15 years agoxenapi: Don't leak url and caps in case of error
Matthias Bolte [Sun, 14 Mar 2010 20:31:14 +0000 (21:31 +0100)]
xenapi: Don't leak url and caps in case of error

15 years agoxenapi: Check for NULL before accessing the scheme
Matthias Bolte [Sun, 14 Mar 2010 20:29:06 +0000 (21:29 +0100)]
xenapi: Check for NULL before accessing the scheme

15 years agoxenapi: Request a username if there is non in the URI
Matthias Bolte [Sun, 14 Mar 2010 20:00:43 +0000 (21:00 +0100)]
xenapi: Request a username if there is non in the URI

Use virRequestUsername and virRequestPassword.

15 years agoxenapi: Check for valid private data in xenapiSessionErrorHandle
Matthias Bolte [Sun, 14 Mar 2010 20:53:01 +0000 (21:53 +0100)]
xenapi: Check for valid private data in xenapiSessionErrorHandle

15 years agoesx: Move username and password helper functions to authhelper.c
Matthias Bolte [Sun, 14 Mar 2010 19:50:14 +0000 (20:50 +0100)]
esx: Move username and password helper functions to authhelper.c

15 years agofix two "make syntax check" failures
Jim Meyering [Tue, 16 Mar 2010 18:32:05 +0000 (19:32 +0100)]
fix two "make syntax check" failures

* src/xenapi/xenapi_driver.c (xenapiOpen): Remove useless-if-before-free.
* po/POTFILES.in: Add src/xenapi/xenapi_utils.c.

15 years agoUse WARN_CFLAGS when compiling virsh.c
Jiri Denemark [Tue, 16 Mar 2010 10:51:36 +0000 (11:51 +0100)]
Use WARN_CFLAGS when compiling virsh.c

15 years agoUse fsync() at the end of file allocation instead of O_DSYNC
Jiri Denemark [Tue, 16 Mar 2010 15:03:59 +0000 (16:03 +0100)]
Use fsync() at the end of file allocation instead of O_DSYNC

Instead of opening storage file with O_DSYNC, make sure data are written
to a disk only before we claim allocation has finished.

15 years agoRevert f5a6ce44ce8368d4183b69a31b77f67688d9af43
Jim Meyering [Mon, 15 Mar 2010 15:43:23 +0000 (16:43 +0100)]
Revert f5a6ce44ce8368d4183b69a31b77f67688d9af43

* src/qemu/qemu_driver.c (qemudDomainAttachSCSIDisk): The ".controller"
member is an index, and *may* be 0.  As such, the commit that we're
reverting broke SCSI disk hot-plug on controller 0.
Reported by Wolfgang Mauerer.

15 years agosecurity: Set permissions for kernel/initrd
Cole Robinson [Fri, 12 Mar 2010 18:38:39 +0000 (13:38 -0500)]
security: Set permissions for kernel/initrd

Fixes URL installs when running virt-install as root on Fedora.

15 years agoqemu: Fix USB by product with security enabled
Cole Robinson [Fri, 12 Mar 2010 17:37:52 +0000 (12:37 -0500)]
qemu: Fix USB by product with security enabled

We need to call PrepareHostdevs to determine the USB device path before
any security calls. PrepareHostUSBDevices was also incorrectly skipping
all USB devices.

15 years agoqemu: Add some debugging at domain startup
Cole Robinson [Fri, 12 Mar 2010 17:36:56 +0000 (12:36 -0500)]
qemu: Add some debugging at domain startup

15 years agoqemu: pass the information when disks are read-only
Daniel Veillard [Thu, 11 Mar 2010 16:53:49 +0000 (17:53 +0100)]
qemu: pass the information when disks are read-only

* src/qemu/qemu_conf.c: add the ",readonly=on" for read-only disks
  and also parse it back in qemuParseCommandLineDisk()
* tests/qemuxml2argvtest.c
  tests/qemuxml2argvdata/qemuxml2argv-disk-drive-readonly-disk.args
  tests/qemuxml2argvdata/qemuxml2argv-disk-drive-readonly-disk.xml:
  add a specific regression test

15 years agoFix syntax-check errors
Jiri Denemark [Mon, 15 Mar 2010 13:14:06 +0000 (14:14 +0100)]
Fix syntax-check errors

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
15 years agoFix error messages in qemu text monitor
Jiri Denemark [Mon, 15 Mar 2010 13:01:20 +0000 (14:01 +0100)]
Fix error messages in qemu text monitor

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
15 years agoxenapi: Initial commit of the new driver
Sharadha Prabhakar [Sun, 14 Mar 2010 11:11:51 +0000 (12:11 +0100)]
xenapi: Initial commit of the new driver

15 years agoesx: Improve documentation about remote URIs
Matthias Bolte [Fri, 12 Mar 2010 21:09:11 +0000 (22:09 +0100)]
esx: Improve documentation about remote URIs

15 years agomacvtap: Only export symbols if support is enabled
Matthias Bolte [Fri, 12 Mar 2010 21:09:50 +0000 (22:09 +0100)]
macvtap: Only export symbols if support is enabled

15 years agoOnly use the numa functions when they are available.
Chris Lalancette [Fri, 12 Mar 2010 15:41:49 +0000 (10:41 -0500)]
Only use the numa functions when they are available.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoMake nodeGetInfo report the correct number of NUMA nodes.
Chris Lalancette [Thu, 11 Mar 2010 20:45:11 +0000 (15:45 -0500)]
Make nodeGetInfo report the correct number of NUMA nodes.

The nodeGetInfo code was always assuming that machine had a
single NUMA node, which is not correct.  The good news is that
libnuma gives us this information pretty easily, so let's
properly report it.

NOTE: With recent hardware starting to support CPU hot-add
and hot-remove, both this code and the nodeCapsInitNUMA()
code are quickly going to become obsolete.  We'll have to
think of a more dynamic solution for dealing with NUMA
nodes and CPUs that can come and go at will.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoFix crash in virsh after bogus command
Chris Lalancette [Fri, 12 Mar 2010 11:00:46 +0000 (12:00 +0100)]
Fix crash in virsh after bogus command

If you ran virsh in interactive mode and ran a command
that virsh could not parse, it would then SEGV
on subsequent commands.  The problem is that we are
freeing the vshCmd structure in the syntaxError label
at the end of vshCommandParse, but forgetting to
set ctl->cmd to NULL.  This means that on the next command,
we would try to free the same structure again, leading
to badness.

* tools/virsh.c: Make sure to set ctl->cmd to NULL after
  freeing it in vshCommandParse()

15 years agoFix virsh command 'cd'
Chris Lalancette [Fri, 12 Mar 2010 10:49:16 +0000 (11:49 +0100)]
Fix virsh command 'cd'

* tools/virsh.c: cmdCd was returning a 0 on success and -1 on error,
  when the rest of the code expected a TRUE on success and a
  FALSE on error.

15 years agoFix compiler warnings in virsh.c
Laine Stump [Fri, 12 Mar 2010 10:39:24 +0000 (11:39 +0100)]
Fix compiler warnings in virsh.c

No functional change. These all generated compiler warnings which, for
some reason weren't converted to errors by
--enable-compiler-warnings=error.

* tools/virsh.c:
  - change return type from int to void on two functions that don't
    return a value.
  - remove unused variables/labels from two functions
  - eliminate non-literal format strings
  - typecast char* into xmlChar* when calling
  - xmlParseBalancedChunkMemory

15 years agoSilence compiler complaints about non-literal format strings
Laine Stump [Fri, 12 Mar 2010 10:36:05 +0000 (11:36 +0100)]
Silence compiler complaints about non-literal format strings

* src/util/macvtap.c: replace _("....") with "%s", _("...") in two places

15 years agoUpdate commiters list
Daniel Veillard [Fri, 12 Mar 2010 10:30:07 +0000 (11:30 +0100)]
Update commiters list

15 years agoFix hang in qemudDomainCoreDump.
Chris Lalancette [Wed, 10 Mar 2010 21:50:13 +0000 (16:50 -0500)]
Fix hang in qemudDomainCoreDump.

Currently if you dump the core of a qemu guest with
qemudDomainCoreDump, subsequent commands will hang
up libvirtd.  This is because qemudDomainCoreDump
uses qemuDomainWaitForMigrationComplete, which expects
the qemuDriverLock to be held when it's called.  This
patch does the simple thing and moves the qemuDriveUnlock
to the end of the qemudDomainCoreDump so that the driver
lock is held for the entirety of the call (as it is done
in qemudDomainSave).  We will probably want to make the
lock more fine-grained than that in the future, but
we can fix both qemudDomainCoreDump and qemudDomainSave
at the same time.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoMake sure qemudDomainSetVcpus doesn't hang.
Chris Lalancette [Wed, 10 Mar 2010 20:52:39 +0000 (15:52 -0500)]
Make sure qemudDomainSetVcpus doesn't hang.

The code to add job support into libvirtd caused a problem
in qemudDomainSetVcpus.  In particular, a qemuDomainObjEndJob()
call was added at the end of the function, but a
corresponding qemuDomainObjBeginJob() was not.  Additionally,
a call to qemuDomainObj{Enter,Exit}Monitor() was also missed
in qemudDomainHotplugVcpus().  These missing calls conspired to
cause a hang in the libvirtd process after the command was
finished.  Fix this by adding the missing calls.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoRemove qemudDomainSetMaxMemory.
Chris Lalancette [Wed, 10 Mar 2010 19:14:53 +0000 (14:14 -0500)]
Remove qemudDomainSetMaxMemory.

As previously discussed[1], this patch removes the
qemudDomainSetMaxMemory() function, since it doesn't
work.  This means that instead of getting somewhat
cryptic errors, you will now get:

error: Unable to change MaxMemorySize
error: this function is not supported by the hypervisor: virDomainSetMaxMemory

Which describes the situation perfectly.

[1] https://www.redhat.com/archives/libvir-list/2010-February/msg00928.html

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoFix a JSON CPU information bug.
Chris Lalancette [Wed, 10 Mar 2010 18:22:02 +0000 (13:22 -0500)]
Fix a JSON CPU information bug.

When using the JSON monitor, qemuMonitorJSONExtractCPUInfo
was returning 0 on success.  Unfortunately, higher levels of
the cpuinfo code expect that it returns the number of CPUs
it found on success.  This one-line patch fixes it so that
it returns the correct number.  This makes "virsh vcpuinfo <domain>"
work when using the JSON monitor.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoAllow devices without a parent
Ed Swierk [Wed, 10 Mar 2010 18:48:49 +0000 (13:48 -0500)]
Allow devices without a parent

* Allow devices without parent links to be created and set their parent to the root "computer" node

15 years agobuild: change to gnulib module list should rerun bootstrap
Eric Blake [Wed, 10 Mar 2010 17:03:29 +0000 (10:03 -0700)]
build: change to gnulib module list should rerun bootstrap

* autogen.sh (curr_status): Also include hash of bootstrap.conf
when checking for changes that require bootstrap rerun.
* cfg.mk (_update_required): Likewise.

15 years agobuild: enforce preprocessor indentation
Eric Blake [Tue, 9 Mar 2010 21:22:14 +0000 (14:22 -0700)]
build: enforce preprocessor indentation

Since cppi is not part of Fedora Core 12, the check is conditional:
without cppi, running 'make syntax-check' merely warns:

$ make sc_preprocessor_indentation
preprocessor_indentation
maint.mk: skipping test sc_preprocessor_indentation: cppi not installed

* cfg.mk (sc_preprocessor_indentation): New syntax-check rule.
(preprocessor_exempt): New macro, with first exemption.

15 years agobuild: update gnulib submodule to newer (but not latest)
Jim Meyering [Wed, 10 Mar 2010 16:26:40 +0000 (17:26 +0100)]
build: update gnulib submodule to newer (but not latest)

This is a stop-gap measure to make autogen.sh rerun ./bootstrap,
(required due to recent bootstrap.conf addition) while we prepare
the fix to automatically detect the case of an updated modules list.

15 years agoFree resources on error in udev startup
David Allan [Thu, 4 Mar 2010 18:17:24 +0000 (13:17 -0500)]
Free resources on error in udev startup

* The udev driver didn't properly free resources that it allocates when setting up the 'computer' device in the error case.

15 years agoMake virsh reconnect when losing connection
Daniel Veillard [Fri, 5 Mar 2010 09:59:52 +0000 (10:59 +0100)]
Make virsh reconnect when losing connection

When the daemon libvirtd restarts, a connected virsh gets a SIGPIPE
and dies. This change the behaviour to try to reconnect if the
signal was received or command error indicated a connection or RPC
failure. Note that the failing command is not restarted.

* tools/virsh.c: catch SIGPIPE signals as well as connection related
  failures, add some automatic reconnection code and appropriate error
  messages.

15 years agoFix up nodeinfo parsing code.
Chris Lalancette [Tue, 9 Mar 2010 15:17:59 +0000 (10:17 -0500)]
Fix up nodeinfo parsing code.

As pointed out by eblake, I made a real hash of the
nodeinfo code with commit
aa2f6f96ddd7a57011c3d25586d588100651feb2.  This patch
cleans it up:

1)  Do more work at compile time instead of runtime (minor)
2)  Properly handle the hex digits that come from
/sys/devices/system/cpu/cpu*/topology/thread_siblings
3)  Fix up some error paths that could cause SEGV
4)  Used unsigned's for the cpu numbers (cpu -1 doesn't
make any sense)

Along with the recent patch from jdenemar to zero out
the nodeinfo structure, I've re-tested this on the
machines having the problems, and it seems to be good.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoChange logrotate to be per-hypervisor logs
Daniel Veillard [Thu, 4 Mar 2010 14:17:08 +0000 (15:17 +0100)]
Change logrotate to be per-hypervisor logs

Having a single logrotate configuration file for all hypervisors
did not work as logrotate would get confused if an hypervisor not
supported on that platform was still listed. Simplest is to split
the logrotate as separate per hypervisor files and change the
spec file to only install the ones compiled in.
* daemon/libvirtd.lxc.logrotate.in daemon/libvirtd.qemu.logrotate.in
  daemon/libvirtd.uml.logrotate.in: copy and split the original
  daemon/libvirtd.logrotate.in file
* daemon/Makefile.am: update to support the different files and
  cleanup in sed suggested by Eric Blake
* libvirt.spec.in: only install the relevant logrotate configs
* daemon/.gitignore: update logrotate generated list

15 years agobuild: consistently indent preprocessor directives
Eric Blake [Tue, 9 Mar 2010 18:22:22 +0000 (19:22 +0100)]
build: consistently indent preprocessor directives

* global: patch created by running:
for f in $(git ls-files '*.[ch]') ; do
    cppi $f > $f.t && mv $f.t $f
done

15 years agovirsh: use N_ rather than gettext_noop
Eric Blake [Tue, 9 Mar 2010 17:05:02 +0000 (10:05 -0700)]
virsh: use N_ rather than gettext_noop

With N_() in place, we can use it for a smaller file.

* doc/api-extension/0008-Step-8-of-8-Add-virsh-support.patch:
Replace all uses of gettext_noop with N_.
* tools/virsh.c: Likewise, throughout the file.

15 years agovirsh: fix existing N_ uses
Eric Blake [Tue, 9 Mar 2010 17:05:01 +0000 (10:05 -0700)]
virsh: fix existing N_ uses

It is a bad idea to call gettext on an already-translated
string.  In cases where a string must be translated separately
from where it is exposed to xgettext, the gettext manual
recommends the idiom of N_() wrapping gettext_noop for
marking the string.

* src/internal.h (N_): Fix definition to match gettext manual.
* tools/virsh.c: (cmdHelp, cmdList, cmdDomstate, cmdDominfo)
(cmdVcpuinfo, vshUsage): Replace incorrect use of N_ with _.
(vshCmddefHelp): Likewise.  Mark C format strings appropriately.

15 years agodoc: fix typos in hacking.html.in; mark HACKING as read-only
Jim Meyering [Tue, 9 Mar 2010 16:59:25 +0000 (17:59 +0100)]
doc: fix typos in hacking.html.in; mark HACKING as read-only

* HACKING: Mark as read-only.  Soon we'll generate it from...
* docs/hacking.html.in: ... this file.  More typo fixes.

15 years agoFix copy&paste typos in virProcessInfoGetAffinity
Jiri Denemark [Tue, 9 Mar 2010 13:59:01 +0000 (14:59 +0100)]
Fix copy&paste typos in virProcessInfoGetAffinity

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
15 years agoWipe nodeinfo structure before filling it
Jiri Denemark [Tue, 9 Mar 2010 13:54:01 +0000 (14:54 +0100)]
Wipe nodeinfo structure before filling it

The nodeinfo structure wasn't initialized in qemu driver and with the
recent change in CPU topology parsing, old value of nodeinfo->sockets
could be used and incremented giving totally bogus results.

Let's just wipe the structure completely.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
15 years agodoc: fix more typos in HACKING
Jim Meyering [Tue, 9 Mar 2010 16:21:55 +0000 (17:21 +0100)]
doc: fix more typos in HACKING

* HACKING: More spelling/typo fixes.

15 years agoAUTHORS: add recent contributors
Eric Blake [Mon, 8 Mar 2010 21:59:52 +0000 (14:59 -0700)]
AUTHORS: add recent contributors

15 years agohacking: add a section on preprocessor conventions
Eric Blake [Tue, 9 Mar 2010 00:02:45 +0000 (17:02 -0700)]
hacking: add a section on preprocessor conventions

* doc/hacking.html.in (preprocessor): New section to document
recently-discussed style issues.

Signed-off-by: Eric Blake <eblake@redhat.com>
15 years agohacking: fix typos
Eric Blake [Tue, 9 Mar 2010 00:02:44 +0000 (17:02 -0700)]
hacking: fix typos

* docs/hacking.html.in (committers): Fix spelling and grammar.

15 years agoFix format string warnings
Laine Stump [Tue, 9 Mar 2010 13:32:06 +0000 (14:32 +0100)]
Fix format string warnings

A few more non-literal format strings in error log messages have crept
in. Fix them in the standard way - turn the format string into "%s"
with the original string as the arg.

15 years agomacvtap build detection fix
Stefan Berger [Tue, 9 Mar 2010 13:14:48 +0000 (14:14 +0100)]
macvtap build detection fix

* configure.ac: fix the header test used for macvtap availability
  detection

15 years agoFix virDomainGetXMLDesc cache settings output
Soren Hansen [Tue, 9 Mar 2010 12:59:51 +0000 (13:59 +0100)]
Fix virDomainGetXMLDesc cache settings output

If a special cache strategy for a disk has been specified in a domain
definition, but no driverName has been set, virDomainGetXMLDesc would not
include the <driver> tag at all.

* src/conf/domain_conf.c: make sure any <driver> tag setting is
  serialized if set.

15 years agoUpdate hacking.html.in
David Allan [Mon, 8 Mar 2010 15:26:30 +0000 (10:26 -0500)]
Update hacking.html.in

* Added section on use of goto
* Added missing content from HACKING document

15 years agoGet thread and socket information in virsh nodeinfo.
Chris Lalancette [Thu, 4 Mar 2010 22:28:40 +0000 (17:28 -0500)]
Get thread and socket information in virsh nodeinfo.

The current code for "nodeinfo" is pretty naive
about socket and thread information.  To determine the
sockets, it just takes the number of cpus and divides
by the number of cores.  For the thread count, it always
sets it to 1.  With more recent Intel machines, however,
hyperthreading is again an option, meaning that these
heuristics no longer work and give bogus numbers.  This
patch goes through /sys to get the additional
information so we properly report it.

Note that I had to edit the tests not to report on
socket and thread counts, since these are determined
dynamically now.

v2: As pointed out by Eric Blake, gnulib provides
    count-one-bits (which is LGPLv2+).  Use it instead
    of a hand-coded popcnt.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoFix locking in qemudDomainMemoryStats
Adam Litke [Mon, 8 Mar 2010 14:15:44 +0000 (15:15 +0100)]
Fix locking in qemudDomainMemoryStats

When adding domainMemoryStats API support for the qemu driver, I didn't
follow the locking rules exactly.  The job condition must be held when
executing monitor commands.  This corrects the segfaults I was seeing
when calling domainMemoryStats in a multi-threaded environment.

* src/qemu/qemu_driver.c: in qemudDomainMemoryStats() add missing
  calls to qemuDomainObjBeginJob/qemuDomainObjEndJob