]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/log
people/liuw/libxenctrl-split/libvirt.git
11 years agoIndent top-level labels by one space in the rest of src/
Ján Tomko [Tue, 25 Mar 2014 06:57:22 +0000 (07:57 +0100)]
Indent top-level labels by one space in the rest of src/

11 years agoIndent top-level labels by one space in src/xen/
Ján Tomko [Tue, 25 Mar 2014 06:54:51 +0000 (07:54 +0100)]
Indent top-level labels by one space in src/xen/

11 years agoIndent top-level labels by one space in src/vbox/
Ján Tomko [Tue, 25 Mar 2014 06:54:41 +0000 (07:54 +0100)]
Indent top-level labels by one space in src/vbox/

11 years agoIndent top-level labels by one space in src/util/
Ján Tomko [Tue, 25 Mar 2014 06:53:22 +0000 (07:53 +0100)]
Indent top-level labels by one space in src/util/

11 years agoIndent top-level labels by one space in src/test/
Ján Tomko [Tue, 25 Mar 2014 06:52:53 +0000 (07:52 +0100)]
Indent top-level labels by one space in src/test/

11 years agoIndent top-level labels by one space in src/storage/
Ján Tomko [Tue, 25 Mar 2014 06:52:40 +0000 (07:52 +0100)]
Indent top-level labels by one space in src/storage/

11 years agoIndent top-level labels by one space in src/rpc/
Ján Tomko [Tue, 25 Mar 2014 06:52:31 +0000 (07:52 +0100)]
Indent top-level labels by one space in src/rpc/

11 years agoIndent top-level labels by one space in src/remote/
Ján Tomko [Tue, 25 Mar 2014 06:54:27 +0000 (07:54 +0100)]
Indent top-level labels by one space in src/remote/

11 years agoIndent top-level labels by one space in src/qemu/
Ján Tomko [Tue, 25 Mar 2014 06:49:44 +0000 (07:49 +0100)]
Indent top-level labels by one space in src/qemu/

11 years agoIndent top-level labels by one space in src/parallels/
Ján Tomko [Tue, 25 Mar 2014 06:57:01 +0000 (07:57 +0100)]
Indent top-level labels by one space in src/parallels/

11 years agoIndent top-level labels by one space in src/nwfilter/
Ján Tomko [Tue, 25 Mar 2014 06:56:49 +0000 (07:56 +0100)]
Indent top-level labels by one space in src/nwfilter/

11 years agoIndent top-level labels by one space in src/network/
Ján Tomko [Tue, 25 Mar 2014 06:56:13 +0000 (07:56 +0100)]
Indent top-level labels by one space in src/network/

11 years agoIndent top-level labels by one space in src/lxc/
Ján Tomko [Tue, 25 Mar 2014 06:49:26 +0000 (07:49 +0100)]
Indent top-level labels by one space in src/lxc/

11 years agoIndent top-level labels by one space in src/locking/
Ján Tomko [Tue, 25 Mar 2014 06:51:47 +0000 (07:51 +0100)]
Indent top-level labels by one space in src/locking/

11 years agoIndent top-level labels by one space in libvirt.c
Ján Tomko [Tue, 25 Mar 2014 06:49:02 +0000 (07:49 +0100)]
Indent top-level labels by one space in libvirt.c

11 years agoIndent top-level labels by one space in src/libxl/
Ján Tomko [Tue, 25 Mar 2014 06:51:17 +0000 (07:51 +0100)]
Indent top-level labels by one space in src/libxl/

11 years agoIndent top-level labels by one space in src/esx/
Ján Tomko [Tue, 25 Mar 2014 06:48:48 +0000 (07:48 +0100)]
Indent top-level labels by one space in src/esx/

11 years agoIndent top-level labels by one space in src/cpu/
Ján Tomko [Tue, 25 Mar 2014 06:50:40 +0000 (07:50 +0100)]
Indent top-level labels by one space in src/cpu/

11 years agoIndent top-level labels by one space in src/conf/
Ján Tomko [Tue, 25 Mar 2014 06:48:31 +0000 (07:48 +0100)]
Indent top-level labels by one space in src/conf/

11 years agoIndent top-level labels by one space in examples/
Ján Tomko [Tue, 25 Mar 2014 06:48:10 +0000 (07:48 +0100)]
Indent top-level labels by one space in examples/

11 years agoIndent top-level labels by one space in daemon/
Ján Tomko [Tue, 25 Mar 2014 06:45:38 +0000 (07:45 +0100)]
Indent top-level labels by one space in daemon/

11 years agosanlock: Forbid VIR_DOMAIN_LOCK_FAILURE_RESTART
Jiri Denemark [Mon, 24 Mar 2014 13:23:09 +0000 (14:23 +0100)]
sanlock: Forbid VIR_DOMAIN_LOCK_FAILURE_RESTART

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

When lock failure is detected by sanlock, our sanlock_helper kill script
will try to restart (shutdown followed by start) the affected domain
when RESTART action is configured for it. While shutting down kills QEMU
and removes all its leases (which is what sanlock wants to happen),
trying to start it again just hangs because libvirt tries reacquire the
locks in the failed lock space. Hence, this action cannot be supported
by sanlock driver.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
11 years agosanlock: Forbid VIR_DOMAIN_LOCK_FAILURE_IGNORE
Jiri Denemark [Mon, 24 Mar 2014 13:22:36 +0000 (14:22 +0100)]
sanlock: Forbid VIR_DOMAIN_LOCK_FAILURE_IGNORE

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

Sanlock expects that the configured kill script either kills the PID on
lock failure or removes all locks the PID owns. If none of the two
options happen, sanlock will reboot the host. Although IGNORE action is
supposed to ignore the request to kill the PID or remove all leases,
it's certainly not designed to cause the host to be rebooted. That said,
IGNORE action is incompatible with sanlock and should be forbidden by
libvirt.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
11 years agoutil: Sanitize ATTRIBUTE_NONNULL use in viriscsi.h
Peter Krempa [Tue, 25 Mar 2014 07:17:27 +0000 (08:17 +0100)]
util: Sanitize ATTRIBUTE_NONNULL use in viriscsi.h

Some of the function attributes marked as nonnull actually explicitly
handle the arguments for NULL. All changed functions handle missing
"initiatoriqn" argument well and virISCSIScanTargets also handles well
if the return pointers are missing. Remove some of the liberaly used
ATTRIBUTE_NONNULLs as coverity and possibly other compilers that honor
the attribute fail to compile the code.

Flaw introduced in commit 5e1d5dde

11 years agomaint: update to latest gnulib
Eric Blake [Mon, 24 Mar 2014 22:29:52 +0000 (16:29 -0600)]
maint: update to latest gnulib

While we aren't impacted by most of upstream's changes this
month, at least the regex improvement looks useful.

* gnulib: Synchronize to upstream.

11 years agoallow "virsh dump --memory-only" specify dump format
Qiao Nuohan [Sun, 23 Mar 2014 03:51:15 +0000 (11:51 +0800)]
allow "virsh dump --memory-only" specify dump format

This patch adds "[--format] <string>" to "virsh dump --memory-only", which is
changed to use the new virDomainCoreDumpWithFormat API.

Signed-off-by: Qiao Nuohan <qiaonuohan@cn.fujitsu.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoqemu: add support for virDomainCoreDumpWithFormat API
Qiao Nuohan [Sun, 23 Mar 2014 03:51:14 +0000 (11:51 +0800)]
qemu: add support for virDomainCoreDumpWithFormat API

This patch makes qemu driver support virDomainCoreDumpWithFormat API.

Signed-off-by: Qiao Nuohan <qiaonuohan@cn.fujitsu.com>
11 years agoqemu: add qemuMonitorGetDumpGuestMemoryCapability
Qiao Nuohan [Sun, 23 Mar 2014 03:51:13 +0000 (11:51 +0800)]
qemu: add qemuMonitorGetDumpGuestMemoryCapability

This patch adds qemuMonitorGetDumpGuestMemoryCapability, which is used to check
whether the specified dump-guest-memory format is supported by qemu.

Signed-off-by: Qiao Nuohan <qiaonuohan@cn.fujitsu.com>
11 years agoadd new virDomainCoreDumpWithFormat API
Qiao Nuohan [Sun, 23 Mar 2014 03:51:12 +0000 (11:51 +0800)]
add new virDomainCoreDumpWithFormat API

--memory-only option is introduced without compression supported. Now qemu
has support for dumping domain's memory in kdump-compressed format. This
patch adds a new virDomainCoreDumpWithFormat API, so that the format in
which qemu dumps domain's memory can be specified.

Signed-off-by: Qiao Nuohan <qiaonuohan@cn.fujitsu.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoapparmor: Fix build after split of disk source metadata
Peter Krempa [Mon, 24 Mar 2014 19:00:11 +0000 (20:00 +0100)]
apparmor: Fix build after split of disk source metadata

Commit 4f20226664b2d4d9e9496ec1e05c9280581a1ca0 breaks build with
AppArmor enabled as it missed the refactor to the new accessors.

11 years agoconf: prepare to track multiple host source files per <disk>
Eric Blake [Wed, 19 Mar 2014 17:11:16 +0000 (11:11 -0600)]
conf: prepare to track multiple host source files per <disk>

It's finally time to start tracking disk backing chains in
<domain> XML.  The first step is to start refactoring code
so that we have an object more convenient for representing
each host source resource in the context of a single guest
<disk>.  Ultimately, I plan to move the new type into src/util
where it can be reused by virStorageFile, but to make the
transition easier to review, this patch just creates the
new type then fixes everything until it compiles again.

* src/conf/domain_conf.h (_virDomainDiskDef): Split...
(_virDomainDiskSourceDef): ...to new struct.
(virDomainDiskAuthClear): Use new type.
* src/conf/domain_conf.c (virDomainDiskDefFree): Split...
(virDomainDiskSourceDefClear): ...to new function.
(virDomainDiskGetType, virDomainDiskSetType)
(virDomainDiskGetSource, virDomainDiskSetSource)
(virDomainDiskGetDriver, virDomainDiskSetDriver)
(virDomainDiskGetFormat, virDomainDiskSetFormat)
(virDomainDiskAuthClear, virDomainDiskGetActualType)
(virDomainDiskDefParseXML, virDomainDiskSourceDefFormat)
(virDomainDiskDefFormat, virDomainDiskDefForeachPath)
(virDomainDiskDefGetSecurityLabelDef)
(virDomainDiskSourceIsBlockType): Adjust all users.
* src/lxc/lxc_controller.c (virLXCControllerSetupDisk):
Likewise.
* src/lxc/lxc_driver.c (lxcDomainAttachDeviceMknodHelper):
Likewise.
* src/qemu/qemu_command.c (qemuAddRBDHost, qemuParseRBDString)
(qemuParseDriveURIString, qemuParseGlusterString)
(qemuParseISCSIString, qemuParseNBDString)
(qemuDomainDiskGetSourceString, qemuBuildDriveStr)
(qemuBuildCommandLine, qemuParseCommandLineDisk)
(qemuParseCommandLine): Likewise.
* src/qemu/qemu_conf.c (qemuCheckSharedDevice)
(qemuAddISCSIPoolSourceHost, qemuTranslateDiskSourcePool):
Likewise.
* src/qemu/qemu_driver.c (qemuDomainUpdateDeviceConfig)
(qemuDomainPrepareDiskChainElement)
(qemuDomainSnapshotCreateInactiveExternal)
(qemuDomainSnapshotPrepareDiskExternalBackingInactive)
(qemuDomainSnapshotPrepareDiskInternal)
(qemuDomainSnapshotPrepare)
(qemuDomainSnapshotCreateSingleDiskActive)
(qemuDomainSnapshotUndoSingleDiskActive)
(qemuDomainBlockPivot, qemuDomainBlockJobImpl)
(qemuDomainBlockCopy, qemuDomainBlockCommit): Likewise.
* src/qemu/qemu_migration.c (qemuMigrationIsSafe): Likewise.
* src/qemu/qemu_process.c (qemuProcessGetVolumeQcowPassphrase)
(qemuProcessInitPasswords): Likewise.
* src/security/security_selinux.c
(virSecuritySELinuxSetSecurityFileLabel): Likewise.
* src/storage/storage_driver.c (virStorageFileInitFromDiskDef):
Likewise.
* tests/securityselinuxlabeltest.c (testSELinuxLoadDef):
Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoconf: use disk source accessors in xenxs/
Eric Blake [Mon, 24 Mar 2014 18:14:48 +0000 (12:14 -0600)]
conf: use disk source accessors in xenxs/

Part of a series of cleanups to use new accessor methods.

* src/xenxs/xen_sxpr.c (xenParseSxprDisks, xenParseSxpr)
(xenFormatSxprDisk, xenFormatSxpr): Use accessors.
* src/xenxs/xen_xm.c (xenParseXM, xenFormatXMDisk, xenFormatXM):
Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoconf: use disk source accessors in xen/
Eric Blake [Tue, 18 Mar 2014 23:12:43 +0000 (17:12 -0600)]
conf: use disk source accessors in xen/

Part of a series of cleanups to use new accessor methods.

* src/xen/xend_internal.c (virDomainXMLDevID): Use accessors.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoconf: use disk source accessors in vmx/
Eric Blake [Tue, 18 Mar 2014 23:06:59 +0000 (17:06 -0600)]
conf: use disk source accessors in vmx/

Part of a series of cleanups to use new accessor methods.

* src/vmx/vmx.c (virVMXHandleLegacySCSIDiskDriverName)
(virVMXParseDisk, virVMXFormatDisk, virVMXFormatFloppy): Use
accessors.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoconf: use disk source accessors in vmware/
Eric Blake [Tue, 18 Mar 2014 21:41:28 +0000 (15:41 -0600)]
conf: use disk source accessors in vmware/

Part of a series of cleanups to use new accessor methods.

* src/vmware/vmware_conf.c (vmwareVmxPath): Use accessors.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoconf: use disk source accessors in vbox/
Eric Blake [Tue, 18 Mar 2014 21:12:57 +0000 (15:12 -0600)]
conf: use disk source accessors in vbox/

Part of a series of cleanups to use new accessor methods.

* src/vbox/vbox_tmpl.c (vboxDomainGetXMLDesc, vboxAttachDrives)
(vboxDomainAttachDeviceImpl, vboxDomainDetachDevice): Use
accessors.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoconf: use disk source accessors in uml/
Eric Blake [Tue, 18 Mar 2014 20:00:03 +0000 (14:00 -0600)]
conf: use disk source accessors in uml/

Part of a series of cleanups to use new accessor methods.

* src/uml/uml_conf.c (umlBuildCommandLine): Use accessors.
* src/uml/uml_driver.c (umlDomainAttachUmlDisk): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoconf: use disk source accessors in security/
Eric Blake [Tue, 18 Mar 2014 19:55:04 +0000 (13:55 -0600)]
conf: use disk source accessors in security/

Part of a series of cleanups to use new accessor methods.

* src/security/security_dac.c (virSecurityDACSetSecurityImageLabel)
(virSecurityDACRestoreSecurityImageLabelInt)
(virSecurityDACSetSecurityAllLabel): Use accessors.
* src/security/security_selinux.c
(virSecuritySELinuxRestoreSecurityImageLabelInt)
(virSecuritySELinuxSetSecurityImageLabel)
(virSecuritySELinuxSetSecurityAllLabel): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoconf: use disk source accessors in qemu/
Eric Blake [Tue, 18 Mar 2014 19:16:47 +0000 (13:16 -0600)]
conf: use disk source accessors in qemu/

Part of a series of cleanups to use new accessor methods.

* src/qemu/qemu_conf.c (qemuCheckSharedDevice)
(qemuAddSharedDevice, qemuRemoveSharedDevice, qemuSetUnprivSGIO):
Use accessors.
* src/qemu/qemu_domain.c (qemuDomainDeviceDefPostParse)
(qemuDomainObjCheckDiskTaint, qemuDomainSnapshotForEachQcow2Raw)
(qemuDomainCheckRemoveOptionalDisk, qemuDomainCheckDiskPresence)
(qemuDiskChainCheckBroken, qemuDomainDetermineDiskChain):
Likewise.
* src/qemu/qemu_hotplug.c (qemuDomainChangeEjectableMedia)
(qemuDomainCheckEjectableMedia)
(qemuDomainAttachVirtioDiskDevice, qemuDomainAttachSCSIDisk)
(qemuDomainAttachUSBMassstorageDevice)
(qemuDomainAttachDeviceDiskLive, qemuDomainRemoveDiskDevice)
(qemuDomainDetachVirtioDiskDevice, qemuDomainDetachDiskDevice):
Likewise.
* src/qemu/qemu_migration.c (qemuMigrationStartNBDServer)
(qemuMigrationDriveMirror, qemuMigrationCancelDriveMirror)
(qemuMigrationIsSafe): Likewise.
* src/qemu/qemu_process.c (qemuProcessGetVolumeQcowPassphrase)
(qemuProcessHandleIOError, qemuProcessHandleBlockJob)
(qemuProcessInitPasswords): Likewise.
* src/qemu/qemu_driver.c (qemuDomainChangeDiskMediaLive)
(qemuDomainGetBlockInfo, qemuDiskPathToAlias): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoconf: use disk source accessors in phyp/
Eric Blake [Mon, 17 Mar 2014 21:24:31 +0000 (15:24 -0600)]
conf: use disk source accessors in phyp/

Part of a series of cleanups to use new accessor methods.

* src/phyp/phyp_driver.c (phypDomainAttachDevice, phypBuildLpar):
Use accessors.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoconf: use disk source accessors in parallels/
Eric Blake [Mon, 17 Mar 2014 21:11:07 +0000 (15:11 -0600)]
conf: use disk source accessors in parallels/

Part of a series of cleanups to use new accessor methods.

* src/parallels/parallels_driver.c (parallelsGetHddInfo)
(parallelsAddHdd, parallelsApplyDisksParams, parallelsCreateVm):
Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoconf: use disk source accessors in lxc/
Eric Blake [Mon, 17 Mar 2014 20:49:05 +0000 (14:49 -0600)]
conf: use disk source accessors in lxc/

Part of a series of cleanups to use new accessor methods.

* src/lxc/lxc_cgroup.c (virLXCCgroupSetupDeviceACL): Use
accessors.
* src/lxc/lxc_controller.c (virLXCControllerSetupLoopDeviceDisk)
(virLXCControllerSetupNBDDeviceDisk)
(virLXCControllerSetupLoopDevices, virLXCControllerSetupDisk):
Likewise.
* src/lxc/lxc_driver.c (lxcDomainAttachDeviceDiskLive)
(lxcDomainDetachDeviceDiskLive): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoconf: use disk source accessors in locking/
Eric Blake [Mon, 17 Mar 2014 20:23:08 +0000 (14:23 -0600)]
conf: use disk source accessors in locking/

Part of a series of cleanups to use new accessor methods.

* src/locking/domain_lock.c (virDomainLockManagerAddDisk): Use
accessors.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoconf: use disk source accessors in libxl/
Eric Blake [Mon, 17 Mar 2014 20:14:11 +0000 (14:14 -0600)]
conf: use disk source accessors in libxl/

Part of a series of cleanups to use new accessor methods.

* src/libxl/libxl_conf.c (libxlMakeDisk): Use accessors.
* src/libxl/libxl_driver.c (libxlDomainChangeEjectableMedia)
(libxlDomainAttachDeviceDiskLive): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoconf: use disk source accessors in esx/
Eric Blake [Mon, 17 Mar 2014 19:04:43 +0000 (13:04 -0600)]
conf: use disk source accessors in esx/

Part of a series of cleanups to use new accessor methods.

* src/esx/esx_driver.c (esxAutodetectSCSIControllerModel)
(esxDomainDefineXML): Use accessors.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoconf: use disk source accessors in bhyve/
Eric Blake [Wed, 19 Mar 2014 12:31:04 +0000 (06:31 -0600)]
conf: use disk source accessors in bhyve/

Part of a series of cleanups to use new accessor methods.

* src/bhyve/bhyve_command.c (bhyveBuildDiskArgStr)
(virBhyveProcessBuildLoadCmd): Use accessors.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoconf: use disk source accessors in conf/
Eric Blake [Mon, 17 Mar 2014 18:53:15 +0000 (12:53 -0600)]
conf: use disk source accessors in conf/

Part of a series of cleanups to use new accessor methods.

Several places in domain_conf.c still open-code raw field access,
but that code will be touched later with the diskDef struct split
so I'm avoiding churn here.

* src/conf/domain_audit.c (virDomainAuditStart): Use accessors.
* src/conf/domain_conf.c (virDomainDiskIndexByName)
(virDomainDiskPathByName, virDomainDiskDefForeachPath)
(virDomainDiskSourceIsBlockType): Likewise.
* src/conf/snapshot_conf.c (virDomainSnapshotAlignDisks):
Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoconf: accessors for common source information
Eric Blake [Mon, 17 Mar 2014 17:39:57 +0000 (11:39 -0600)]
conf: accessors for common source information

A future patch will split virDomainDiskDef, in order to track
multiple host resources per guest <disk>.  To reduce the size
of that patch, I've factored out the four most common accesses
into functions, so that I can incrementally upgrade the code
base to use the accessors, and so that code that doesn't care
about the distinction of per-file details won't have to be
changed when the struct changes.

* src/conf/domain_conf.h (virDomainDiskGetType)
(virDomainDiskSetType, virDomainDiskGetSource)
(virDomainDiskSetSource, virDomainDiskGetDriver)
(virDomainDiskSetDriver, virDomainDiskGetFormat)
(virDomainDiskSetFormat): New prototypes.
* src/conf/domain_conf.c (virDomainDiskGetType)
(virDomainDiskSetType, virDomainDiskGetSource)
(virDomainDiskSetSource, virDomainDiskGetDriver)
(virDomainDiskSetDriver, virDomainDiskGetFormat)
(virDomainDiskSetFormat): Implement them.
* src/libvirt_private.syms (domain_conf.h): Export them.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agovmware: fix parse of disk source
Eric Blake [Tue, 18 Mar 2014 21:41:28 +0000 (15:41 -0600)]
vmware: fix parse of disk source

While writing disk source refactoring, I discovered that conversion
from XML to vmware modified the disk source in place; if the same
code is reached twice, the second call behaves differently because
the first call didn't clean up its mess.

* src/vmware/vmware_conf.c (vmwareParsePath): Avoid munging input
string.
* src/vmware/vmware_conf.h (vmwareParsePath): Make static.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoqemuDomainGetImageIds: Skip <seclabel/> without label
Michal Privoznik [Mon, 24 Mar 2014 15:44:17 +0000 (16:44 +0100)]
qemuDomainGetImageIds: Skip <seclabel/> without label

It's easy to shed the daemon these days. With this XML snippet:

    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/some/dummy/path/test.bin'>
        <seclabel model='dac' relabel='no'/>
      </source>
      <target dev='vdb' bus='virtio'/>
      <readonly/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </disk>

I get the SIGSEGV when starting the domain. The thing is, when
starting a domain, we check for its disk presence. For some reason,
when determining the disk chain, we parse the <seclabel/> (don't ask
me why). However, there's no label attribute in the XML, so we end up
calling virParseOwnershipIds() over NULL string:

 [Switching to Thread 0x7ffff10c4700 (LWP 30956)]
 __strchr_sse42 () at ../sysdeps/x86_64/multiarch/strchr.S:136
 136     ../sysdeps/x86_64/multiarch/strchr.S: No such file or directory.
 (gdb) bt
 #0  __strchr_sse42 () at ../sysdeps/x86_64/multiarch/strchr.S:136
 #1  0x00007ffff749f800 in virParseOwnershipIds (label=0x0, uidPtr=uidPtr@entry=0x7ffff10c2df0, gidPtr=gidPtr@entry=0x7ffff10c2df4) at util/virutil.c:2115
 #2  0x00007fffe929f006 in qemuDomainGetImageIds (gid=0x7ffff10c2df4, uid=0x7ffff10c2df0, disk=0x7fffe40cb000, vm=0x7fffe40a6410, cfg=0x7fffe409ae00) at qemu/qemu_domain.c:2385
 #3  qemuDomainDetermineDiskChain (driver=driver@entry=0x7fffe40120e0, vm=vm@entry=0x7fffe40a6410, disk=disk@entry=0x7fffe40cb000, force=force@entry=false) at qemu/qemu_domain.c:2414
 #4  0x00007fffe929f128 in qemuDomainCheckDiskPresence (driver=driver@entry=0x7fffe40120e0, vm=vm@entry=0x7fffe40a6410, cold_boot=cold_boot@entry=true) at qemu/qemu_domain.c:2250
 #5  0x00007fffe92b6fc8 in qemuProcessStart (conn=conn@entry=0x7fffd4000b60, driver=driver@entry=0x7fffe40120e0, vm=vm@entry=0x7fffe40a6410, migrateFrom=migrateFrom@entry=0x0, stdin_fd=stdin_fd@entry=-1, stdin_path=stdin_path@entry=0x0, snapshot=snapshot@entry=0x0,
     vmop=vmop@entry=VIR_NETDEV_VPORT_PROFILE_OP_CREATE, flags=flags@entry=1) at qemu/qemu_process.c:3813
 #6  0x00007fffe93087e8 in qemuDomainObjStart (conn=0x7fffd4000b60, driver=driver@entry=0x7fffe40120e0, vm=vm@entry=0x7fffe40a6410, flags=flags@entry=0) at qemu/qemu_driver.c:6051
 #7  0x00007fffe9308e32 in qemuDomainCreateWithFlags (dom=0x7fffcc000d50, flags=0) at qemu/qemu_driver.c:6105
 #8  0x00007ffff753c5cc in virDomainCreate (domain=domain@entry=0x7fffcc000d50) at libvirt.c:8861

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
11 years agobhyve: add domainCreateWithFlags support
Roman Bogorodskiy [Tue, 18 Mar 2014 09:31:48 +0000 (13:31 +0400)]
bhyve: add domainCreateWithFlags support

The only supported flag for now is 'autodestroy'. In order to
support 'autodestroy', add support for close callbacks.

11 years agobhyve: MAC address configuration
Wojciech Macek [Thu, 20 Mar 2014 08:39:21 +0000 (09:39 +0100)]
bhyve: MAC address configuration

Add support for MAC address configuration on network bridge
interface.

11 years agolibxl_driver.c: cleanup code
Chunyan Liu [Wed, 19 Mar 2014 03:15:25 +0000 (11:15 +0800)]
libxl_driver.c: cleanup code

Following Jim's comments about "add pci passthrough to libxl" patch:

https://www.redhat.com/archives/libvir-list/2014-March/msg00170.html

Signed-off-by: Chunyan Liu <cyliu@suse.com>
11 years agoIntroduce virFDStreamOpenPTY
Roman Bogorodskiy [Mon, 10 Mar 2014 12:32:51 +0000 (16:32 +0400)]
Introduce virFDStreamOpenPTY

Add virFDStreamOpenPTY() function which is a wrapper around
virFDStreamOpenFileInternal() with putting the device it opens into a
raw mode.

Make virChrdevOpen() use virFDStreamOpenPTY() for
VIR_DOMAIN_CHR_TYPE_PTY devices.

This fixes mangled console output when libvirt runs on FreeBSD as it
requires device it opens to be placed into a raw mode explicitly.

11 years agoAdd stubs for virDBusCreateReply{,V}
Ján Tomko [Fri, 21 Mar 2014 13:27:34 +0000 (14:27 +0100)]
Add stubs for virDBusCreateReply{,V}

Fix the build without dbus.

11 years agoFix build on mingw32
Ján Tomko [Fri, 21 Mar 2014 11:14:12 +0000 (12:14 +0100)]
Fix build on mingw32

tests/viriscsitest.c:27:12: error: 'EXIT_AM_SKIP' undeclared
(first use in this function)

11 years agolibvirt support to force convergence of live guest migration
Chegu Vinod [Thu, 6 Feb 2014 23:44:36 +0000 (15:44 -0800)]
libvirt support to force convergence of live guest migration

Busy enterprise workloads hosted on large sized VM's tend to dirty
memory faster than the transfer rate achieved via live guest migration.
Despite some good recent improvements (& using dedicated 10Gig NICs
between hosts) the live migration may NOT converge.

Recently support was added in qemu (version 1.6) to allow a user to
choose if they wish to force convergence of their migration via a
new migration capability : "auto-converge". This feature allows for qemu
to auto-detect lack of convergence and trigger a throttle-down of the
VCPUs.

This patch includes the libvirt support needed to trigger this
feature. (Testing is in progress)

Signed-off-by: Chegu Vinod <chegu_vinod@hp.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
11 years agocgroup: Fix start VMs coincidently failed
Wang Yufei [Thu, 20 Mar 2014 07:14:01 +0000 (07:14 +0000)]
cgroup: Fix start VMs coincidently failed

When I start multi VMs coincidently and any of the cgroup directories
named machine doesn't exist. There's a chance that VM start failed because
of creating directory failed:
Unable to initialize /machine cgroup: File exists
When the errno returned by mkdir in virCgroupMakeGroup is EEXIST,
we should pass it through and continue to start the VM.
Signed-off-by: Wang Yufei <james.wangyufei@huawei.com>
11 years agoAllow caller to handle DBus error messages
Daniel P. Berrange [Mon, 17 Mar 2014 17:56:48 +0000 (17:56 +0000)]
Allow caller to handle DBus error messages

The caller may not want all DBus error conditions to be turned
into libvirt errors, so provide a way for the caller to get
back the full DBusError object. They can then check the errors
and only report those that they consider to be fatal.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoIntroduce alternate way to encode/decode arrays in DBus messages
Daniel P. Berrange [Thu, 13 Mar 2014 15:38:18 +0000 (15:38 +0000)]
Introduce alternate way to encode/decode arrays in DBus messages

Currently the DBus helper APIs require the values for an array
to be passed inline in the variadic argument list. This change
introduces support for passing arrays using a pointer to a plain
C array of the basic type. This is of particular benefit for
decoding messages when you don't know how many array elements
are being received.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoRemove bogus call to dbus_set_error_from_message
Daniel P. Berrange [Mon, 17 Mar 2014 17:38:52 +0000 (17:38 +0000)]
Remove bogus call to dbus_set_error_from_message

The dbus_connection_send_with_reply_and_block method will
automatically call dbus_set_error_from_message for us. We
mistakenly thought we had todo it because of a flaw in the
systemd unit test mock impl. The latter should have directly
set the error object, instead of creating an error message
object.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoRemove bogus unref in virDBusMessageRead
Daniel P. Berrange [Wed, 19 Mar 2014 10:55:13 +0000 (10:55 +0000)]
Remove bogus unref in virDBusMessageRead

The virDBusMessageRead method should not have side-effects on
the message parameter passed in, so unref'ing it is wrong.
The caller should unref only when they decided they are done
with it.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoAdd DBus helper methods for creating reply messages
Daniel P. Berrange [Wed, 19 Mar 2014 10:58:42 +0000 (10:58 +0000)]
Add DBus helper methods for creating reply messages

The test suites often have to create DBus method reply messages
with payloads. Create two helpers for simplifying the process
of creating replies with payloads.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoRefactor dbus helper methods for method calls
Daniel P. Berrange [Thu, 13 Mar 2014 15:47:46 +0000 (15:47 +0000)]
Refactor dbus helper methods for method calls

Split the virDBusMethodCall method into a couple of new methods
virDBusCall, virDBusCreateMethod and virDBusCreateMethodV.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agovirlog: Modify virLogParseDefaultPriority's comment of return value
Zhou Yimin [Fri, 21 Mar 2014 06:52:40 +0000 (14:52 +0800)]
virlog: Modify virLogParseDefaultPriority's comment of return value

virLogParseDefaultPriority's successful return value is the same as
virLogSetDefaultPriority's successful return value. So it should be 0
rather than the parsed log level.

Signed-off-by: Zhou Yimin <zhouyimin@huawei.com>
11 years agoFix typo in configure.ac
Ján Tomko [Fri, 21 Mar 2014 09:04:59 +0000 (10:04 +0100)]
Fix typo in configure.ac

s/profram/program/

11 years agoDefine ISCSIADM unconditionally
Ján Tomko [Fri, 21 Mar 2014 08:02:44 +0000 (09:02 +0100)]
Define ISCSIADM unconditionally

Commit 5e1d5dd moved the functions using isciadm to util/viriscsi.c,
but ISCSIADM was only defined when the iscsi backend was compiled in.

Define it unconditionally to fix the build (and allow testing
of viriscsi.c) even if iscsi backend is disabled.

11 years agoCheck boot order on device attach
Jiri Denemark [Thu, 20 Mar 2014 14:34:32 +0000 (15:34 +0100)]
Check boot order on device attach

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

When attaching a new device, we need to check if its boot order
configuration is compatible with current domain definition.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
11 years agoconf: Introduce virDomainDeviceGetInfo API
Jiri Denemark [Thu, 20 Mar 2014 21:34:00 +0000 (22:34 +0100)]
conf: Introduce virDomainDeviceGetInfo API

The offset of virDomainDeviceInfo structure within a device definition
varies with device type and some types do not contain the info structure
at all. This new API makes it easier to access the info structure from a
generic virDomainDeviceDef structure.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
11 years agoPass action to virDomainDefCompatibleDevice
Jiri Denemark [Thu, 20 Mar 2014 12:39:20 +0000 (13:39 +0100)]
Pass action to virDomainDefCompatibleDevice

When checking compatibility of a device with a domain definition, we
should know what we're going to do with the device. Because we may need
to check for different things when we're attaching a new device versus
detaching an existing device.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
11 years agoFix usage of virDomainDefCompatibleDevice
Jiri Denemark [Thu, 20 Mar 2014 12:04:06 +0000 (13:04 +0100)]
Fix usage of virDomainDefCompatibleDevice

A device needs to be checked for compatibility with the domain
definition it corresponds to. Specifically, for VIR_DOMAIN_AFFECT_CONFIG
case we should check against persistent def rather than active def.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
11 years agoqemu: Return meaningful error when qemu dies early
Jiri Denemark [Mon, 17 Mar 2014 10:04:07 +0000 (11:04 +0100)]
qemu: Return meaningful error when qemu dies early

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

When qemu dies early after connecting to its monitor but before we
actually try to read something from the monitor, we would just fail
domain start with useless message:

    "An error occurred, but the cause is unknown"

This is because the real error gets reported in a monitor EOF handler
executing within libvirt's event loop.

The fix is to take any error set in qemuMonitor structure and propagate
it into the thread-local error when qemuMonitorClose is called and no
thread-local error is set.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
11 years agotests: Set abs_*dir in a consistent way
Jiri Denemark [Wed, 19 Mar 2014 13:44:24 +0000 (14:44 +0100)]
tests: Set abs_*dir in a consistent way

Use $(shell cd $(...) && pwd) to set abs_*dir variables similarly to
what src/Makefile.am does.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
11 years agoqemu: allow filtering events by regex
Eric Blake [Thu, 6 Feb 2014 21:46:52 +0000 (14:46 -0700)]
qemu: allow filtering events by regex

When listening for a subset of monitor events, it can be tedious
to register for each event name in series; nicer is to register
for multiple events in one go.  Implement a flag to use regex
interpretation of the event filter.

While at it, prove how much I hate the shift key, by adding a
way to filter for 'shutdown' instead of 'SHUTDOWN'. :)

* include/libvirt/libvirt-qemu.h
(virConnectDomainQemuMonitorEventRegisterFlags): New enum.
* src/libvirt-qemu.c (virConnectDomainQemuMonitorEventRegister):
Document flags.
* tools/virsh-domain.c (cmdQemuMonitorEvent): Expose them.
* tools/virsh.pod (qemu-monitor-event): Document this.
* src/conf/domain_event.c
(virDomainQemuMonitorEventStateRegisterID): Add flags.
(virDomainQemuMonitorEventFilter): Handle regex, and optimize
client side.
(virDomainQemuMonitorEventCleanup): Clean up regex.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoqemu: enable monitor event filtering by name
Eric Blake [Fri, 31 Jan 2014 14:02:25 +0000 (07:02 -0700)]
qemu: enable monitor event filtering by name

Filtering monitor events by name requires tracking the name for
the duration of the filtering.  In order to free the name, I
found it easiest to just piggyback on the user's freecb function,
which gets called when the event is deregistered.

For events without a name filter, we have the design of multiple
client registrations sharing a common server registration, because
the server side uses the same callback function and we reject
duplicate use of the same function.  But with events in the mix,
we want to be able to allow the same function pointer to be used
with more than one event name.  The solution is to tweak the
duplicate detection code to only act when there is no additional
filtering; if name filtering is in use, there is exactly one
client registration per server registration.  Yes, this means
that there is no longer a bound on the number of server
registrations possible, so a malicious client could repeatedly
register for the same name event to exhaust server memory.  On
the other hand, we already restricted monitor events to require
write access (compared to normal events only needing read access),
and separated it into the intentionally unsupported
libvirt-qemu.so, with documentation that using this function is
for debug purposes only; so it is not a security risk worth
worrying about a client trying to abuse multiple registrations.

* src/conf/domain_event.c (virDomainQemuMonitorEventData): New
struct.
(virDomainQemuMonitorEventFilter)
(virDomainQemuMonitorEventCleanup): New functions.
(virDomainQemuMonitorEventDispatchFunc)
(virDomainQemuMonitorEventStateRegisterID): Use new struct.
* src/conf/object_event.c (virObjectEventCallbackListCount)
(virObjectEventCallbackListAddID)
(virObjectEventCallbackListRemoveID)
(virObjectEventCallbackListMarkDeleteID): Drop duplicate detection
when filtering is in effect.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoqemu: enable monitor event reporting
Eric Blake [Thu, 30 Jan 2014 00:14:44 +0000 (17:14 -0700)]
qemu: enable monitor event reporting

Wire up all the pieces to send arbitrary qemu events to a
client using libvirt-qemu.so.  If the extra bookkeeping of
generating event objects even when no one is listening turns
out to be noticeable, we can try to further optimize things
by adding a counter for how many connections are using events,
and only dump events when the counter is non-zero; but for
now, I didn't think it was worth the code complexity.

* src/qemu/qemu_driver.c
(qemuConnectDomainQemuMonitorEventRegister)
(qemuConnectDomainQemuMonitorEventDeregister): New functions.
* src/qemu/qemu_monitor.h (qemuMonitorEmitEvent): New prototype.
(qemuMonitorDomainEventCallback): New typedef.
* src/qemu/qemu_monitor_json.c (qemuMonitorJSONIOProcessEvent):
Report events.
* src/qemu/qemu_monitor.c (qemuMonitorEmitEvent): New function, to
pass events through.
* src/qemu/qemu_process.c (qemuProcessHandleEvent): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoqemu: wire up RPC for qemu monitor events
Eric Blake [Wed, 29 Jan 2014 22:30:44 +0000 (15:30 -0700)]
qemu: wire up RPC for qemu monitor events

These are the first async events in the qemu protocol, so this
patch looks rather big compared to most RPC additions.  However,
a large majority of this patch is just mechanical copy-and-paste
from recently-added network events.  It didn't help that this
is also the first virConnect rather than virDomain prefix
associated with a qemu-specific API.

* src/remote/qemu_protocol.x (qemu_*_domain_monitor_event_*): New
structs and RPC messages.
* src/rpc/gendispatch.pl: Adjust naming conventions.
* daemon/libvirtd.h (daemonClientPrivate): Track qemu events.
* daemon/remote.c (remoteClientFreeFunc): Likewise.
(remoteRelayDomainQemuMonitorEvent)
(qemuDispatchConnectDomainMonitorEventRegister)
(qemuDispatchConnectDomainMonitorEventDeregister): New functions.
* src/remote/remote_driver.c (qemuEvents): Handle qemu events.
(doRemoteOpen): Register for events.
(remoteNetworkBuildEventLifecycle)
(remoteConnectDomainQemuMonitorEventRegister)
(remoteConnectDomainQemuMonitorEventDeregister): New functions.
* src/qemu_protocol-structs: Regenerate.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoqemu: create object for qemu monitor events
Eric Blake [Tue, 31 Dec 2013 13:33:42 +0000 (06:33 -0700)]
qemu: create object for qemu monitor events

Create qemu monitor events as a distinct class to normal domain
events, because they will be filtered differently.  For ease of
review, the logic for filtering by event name is saved for a later
patch.

* src/conf/domain_event.c (virDomainQemuMonitorEventClass): New
class.
(virDomainEventsOnceInit): Register it.
(virDomainQemuMonitorEventDispose, virDomainQemuMonitorEventNew)
(virDomainQemuMonitorEventDispatchFunc)
(virDomainQemuMonitorEventStateRegisterID): New functions.
* src/conf/domain_event.h (virDomainQemuMonitorEventNew)
(virDomainQemuMonitorEventStateRegisterID): New prototypes.
* src/libvirt_private.syms (conf/domain_conf.h): Export them.

11 years agoqemu: virsh wrapper for qemu events
Eric Blake [Fri, 31 Jan 2014 23:52:17 +0000 (16:52 -0700)]
qemu: virsh wrapper for qemu events

Any new API deserves a good virsh wrapper :)

    qemu-monitor-event [<domain>] [<event>] [--pretty] [--loop] [--timeout <number>]

Very similar to the previous work on 'virsh event'.  For an
example session:

$ virsh -c qemu:///system qemu-monitor-event --event SHUTDOWN&
$ virsh -c qemu:///system start f18-live
Domain f18-live started

$ virsh -c qemu:///system destroy f18-live
Domain f18-live destroyed

event SHUTDOWN at 1391212552.026544 for domain f18-live: (null)
events received: 1

[1]+  Done                    virsh -c qemu:///system qemu-monitor-event --event SHUTDOWN
$

* tools/virsh-domain.c (cmdQemuMonitorEvent): New command.
* tools/virsh.pod (qemu-monitor-event): Document it.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoqemu: new API for tracking arbitrary monitor events
Eric Blake [Thu, 19 Dec 2013 14:06:35 +0000 (07:06 -0700)]
qemu: new API for tracking arbitrary monitor events

Several times in the past, qemu has implemented a new event,
but libvirt has not yet caught up to reporting that event to
the user applications.  While it is possible to track libvirt
logs to see that an unknown event was received and ignored,
it would be nicer to copy what 'virsh qemu-monitor-command'
does, and expose this information to the end developer as
one of our unsupported qemu-specific commands.

If you find yourself needing to use this API for more than
just development purposes, please ask on the libvirt list
for a supported counterpart event to be added in libvirt.so.

While the supported virConnectDomainEventRegisterAny() API
takes an id which determines the signature of the callback,
this version takes a string filter and always uses the same
signature.  Furthermore, I chose to expose this as a new API
instead of trying to add a new eventID at the top level, in
part because the generic option lacks event name filtering,
and in part because the normal domain event namespace should
not be polluted by a qemu-only event.  I also added a flags
argument; unused for now, but we might decide to use it to
allow a user to request event names by glob or regex instead
of literal match.

This API intentionally requires full write access (while
normal event registration is allowed on read-only clients);
this is in part due to the fact that it should only be used
by debugging situations, and in part because the design of
per-event filtering in later patches ended up allowing for
duplicate registrations that could potentially be abused to
exhaust server memory - requiring write privileges means
that such abuse will not serve as a denial of service attack
against users with higher privileges.

* include/libvirt/libvirt-qemu.h
(virConnectDomainQemuMonitorEventCallback)
(virConnectDomainQemuMonitorEventRegister)
(virConnectDomainQemuMonitorEventDeregister): New prototypes.
* src/libvirt-qemu.c (virConnectDomainQemuMonitorEventRegister)
(virConnectDomainQemuMonitorEventDeregister): New functions.
* src/libvirt_qemu.syms (LIBVIRT_QEMU_1.2.1): Export them.
* src/driver.h (virDrvConnectDomainQemuMonitorEventRegister)
(virDrvConnectDomainQemuMonitorEventDeregister): New callbacks.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoFix indentation in iscsi storage backend
Ján Tomko [Thu, 20 Mar 2014 12:23:42 +0000 (13:23 +0100)]
Fix indentation in iscsi storage backend

11 years agoIgnore missing files on pool refresh
Ján Tomko [Thu, 20 Mar 2014 15:35:00 +0000 (16:35 +0100)]
Ignore missing files on pool refresh

If we cannot stat/open a file on pool refresh, returning -1 aborts
the refresh and the pool is undefined.

Only treat missing files as fatal unless VolOpenCheckMode is called
with the VIR_STORAGE_VOL_OPEN_ERROR flag. If this flag is missing
(when it's called from virStorageBackendProbeTarget in
virStorageBackendFileSystemRefresh), only emit a warning and return
-2 to let the caller skip over the file.

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

11 years agoIgnore char devices in storage pools by default
Ján Tomko [Thu, 20 Mar 2014 15:42:52 +0000 (16:42 +0100)]
Ignore char devices in storage pools by default

Without this, using /dev/mapper as a directory pool
fails in virStorageBackendUpdateVolTargetInfoFD:
cannot seek to end of file '/dev/mapper/control': Illegal seek

Skip over character devices by default.

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

11 years agoAdd test for virISCSIScanTargets
Ján Tomko [Wed, 19 Mar 2014 13:02:09 +0000 (14:02 +0100)]
Add test for virISCSIScanTargets

11 years agoAdd test for virISCSIGetSession
Ján Tomko [Fri, 21 Feb 2014 09:59:10 +0000 (10:59 +0100)]
Add test for virISCSIGetSession

Parse iscsiadm output with and without the recently introduced
flashnode info. [1]

This should check that commits like 57e17a7 (fixing [2]) do
not break iscsiadm output parsing.

[1] https://github.com/mikechristie/open-iscsi/commit/181af9a
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1067173

11 years agoMove functions using iscsiadm to viriscsi.c
Ján Tomko [Wed, 19 Mar 2014 15:03:11 +0000 (16:03 +0100)]
Move functions using iscsiadm to viriscsi.c

Remove the 'StorageBackend' from names of the functions and fix
indentation.

11 years agoRemove storage pool from the arguments of a few functions
Ján Tomko [Wed, 19 Mar 2014 14:54:08 +0000 (15:54 +0100)]
Remove storage pool from the arguments of a few functions

virStorageBackendISCSISession only needs the path of the source
device and virStorageBackendISCSIRescanLUNs doesn't need the pool
at all.

This will allow the functions to be moved to src/util.

11 years agoDon't create iscsiadm command line in ISCSIPool{Start,Stop}
Ján Tomko [Wed, 19 Mar 2014 14:52:51 +0000 (15:52 +0100)]
Don't create iscsiadm command line in ISCSIPool{Start,Stop}

Create ISCSIConnection{Login,Logout} wrappers for that.

11 years agoSwitch virCommandRunRegex to use virStringSplit
Ján Tomko [Wed, 19 Mar 2014 12:16:13 +0000 (13:16 +0100)]
Switch virCommandRunRegex to use virStringSplit

Instead of running the command asynchronously and reading the output
via fgets, let virCommand collect the output and split it with
virStringSplit.

11 years agoMove virStorageBackendRun to vircommand
Ján Tomko [Tue, 18 Mar 2014 14:35:01 +0000 (15:35 +0100)]
Move virStorageBackendRun to vircommand

The only storage-specific parameter is the pool object, which
is only used for passing to the callback function.

11 years agoSort includes in storage_backend_iscsi.c
Ján Tomko [Tue, 18 Mar 2014 15:20:01 +0000 (16:20 +0100)]
Sort includes in storage_backend_iscsi.c

11 years agoRequire K&R styled curly braces around function bodies
Martin Kletzander [Fri, 20 Sep 2013 15:56:38 +0000 (17:56 +0200)]
Require K&R styled curly braces around function bodies

Although not explicitly requested, we are using K&R (or Kernel)
indentation for curly braces around functions in HACKING file and most
of the code.  Using grep -P, this patch add the syntax-check rule for
it (while skipping all the false positives with foreach constructs).

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
11 years agoUse K&R style for curly braces in remaining files
Martin Kletzander [Tue, 18 Mar 2014 08:19:33 +0000 (09:19 +0100)]
Use K&R style for curly braces in remaining files

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
11 years agoUse K&R style for curly braces in src/vbox/
Martin Kletzander [Tue, 18 Mar 2014 08:18:32 +0000 (09:18 +0100)]
Use K&R style for curly braces in src/vbox/

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
11 years agoUse K&R style for curly braces in src/network/bridge_driver.c
Martin Kletzander [Tue, 18 Mar 2014 08:18:16 +0000 (09:18 +0100)]
Use K&R style for curly braces in src/network/bridge_driver.c

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
11 years agoUse K&R style for curly braces in src/lxc/lxc_driver.c
Martin Kletzander [Tue, 18 Mar 2014 08:18:09 +0000 (09:18 +0100)]
Use K&R style for curly braces in src/lxc/lxc_driver.c

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
11 years agoUse K&R style for curly braces in src/uml/
Martin Kletzander [Tue, 18 Mar 2014 08:17:39 +0000 (09:17 +0100)]
Use K&R style for curly braces in src/uml/

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
11 years agoUse K&R style for curly braces in src/test/test_driver.c
Martin Kletzander [Tue, 18 Mar 2014 08:17:30 +0000 (09:17 +0100)]
Use K&R style for curly braces in src/test/test_driver.c

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
11 years agoUse K&R style for curly braces in src/nwfilter/
Martin Kletzander [Tue, 18 Mar 2014 08:16:54 +0000 (09:16 +0100)]
Use K&R style for curly braces in src/nwfilter/

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
11 years agoUse K&R style for curly braces in src/openvz/
Martin Kletzander [Tue, 18 Mar 2014 08:16:47 +0000 (09:16 +0100)]
Use K&R style for curly braces in src/openvz/

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>