]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/log
people/liuw/libxenctrl-split/libvirt.git
9 years agovirsh-domain: use correct base for virStrToLong_ui
Pavel Hrdina [Wed, 21 Oct 2015 10:43:29 +0000 (12:43 +0200)]
virsh-domain: use correct base for virStrToLong_ui

While parsing device addresses we should use correct base and don't
count on auto-detect.  For example, PCI address uses hex numbers, but
each number starting with 0 will be auto-detected as octal number and
that's wrong.  Another wrong use-case is for PCI address if for example
bus is 10, than it's incorrectly parsed as decimal number.

PCI and CCW addresses have all values as hex numbers, IDE and SCSI
addresses are in decimal numbers.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
9 years agolibvirt-domain: fix the error reporting when use the localhost as target uri
Luyao Huang [Tue, 27 Oct 2015 08:54:01 +0000 (16:54 +0800)]
libvirt-domain: fix the error reporting when use the localhost as target uri

Remove the extra %s in error message when call virReportInvalidArg().

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agolibvirt-domain: fix no error report when p2p migrate fail
Luyao Huang [Tue, 27 Oct 2015 08:54:00 +0000 (16:54 +0800)]
libvirt-domain: fix no error report when p2p migrate fail

After commit a26669d7, we only jump to error when
virDomainMigrateUnmanagedParams return a value less than -1.
this will make the migrate result always be success even we
meet some problem.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agoqemu: fix migration flags undefinesource cannot work
Luyao Huang [Tue, 27 Oct 2015 08:53:59 +0000 (16:53 +0800)]
qemu: fix migration flags undefinesource cannot work

In commit f41be296, we moved vm->persistent check into
qemuDomainRemoveInactive, but we didn't change the vm->persistent
before call qemuDomainRemoveInactive in some place before and just
call it to remove the inactive vm.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agoconf: Add serial target type to ABI stability check
Luyao Huang [Wed, 21 Oct 2015 07:14:03 +0000 (15:14 +0800)]
conf: Add serial target type to ABI stability check

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

There is no ABI check for serial target type attribute, just
add it.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agolock_daemon: Switch to wrapper locking functions
Michal Privoznik [Wed, 7 Oct 2015 11:36:43 +0000 (13:36 +0200)]
lock_daemon: Switch to wrapper locking functions

Lets use wrapper functions virLockDaemonLock and
virLockDaemonUnlock instead of virMutexLock and virMutexUnlock.
This has no functional impact, but it's easier to read (at least
for me).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agoqemu: hostdev: Introduce qemuHostdevUpdateActiveDomainDevices()
Andrea Bolognani [Mon, 26 Oct 2015 11:09:33 +0000 (12:09 +0100)]
qemu: hostdev: Introduce qemuHostdevUpdateActiveDomainDevices()

This calls the PCI-, USB- and SCSI-specific functions just
like qemuHostdev{Prepare,ReAttach}DomainDevices() already do,
and was the missing piece for the qemuHostdev API to nicely
mirror the virHostdev API.

Update qemuProcessReconnect() to use the new function.

9 years agoqemu: hostdev: Unify naming for qemuHostdevUpdateActive*Devices()
Andrea Bolognani [Tue, 20 Oct 2015 12:26:30 +0000 (14:26 +0200)]
qemu: hostdev: Unify naming for qemuHostdevUpdateActive*Devices()

Adopt the same names used for virHostdevUpdateActive*Devices() for
consistency's sake and to make it easier to jump between the two.

No functional changes.

9 years agoqemu: hostdev: Unify naming for qemuHostdevReAttach*Devices()
Andrea Bolognani [Tue, 20 Oct 2015 12:12:48 +0000 (14:12 +0200)]
qemu: hostdev: Unify naming for qemuHostdevReAttach*Devices()

Adopt the same names used for virHostdevReAttach*Devices() for
consistency's sake and to make it easier to jump between the two.

No functional changes.

9 years agoqemu: hostdev: Unify naming for qemuHostdevPrepare*Devices()
Andrea Bolognani [Tue, 20 Oct 2015 12:10:16 +0000 (14:10 +0200)]
qemu: hostdev: Unify naming for qemuHostdevPrepare*Devices()

Adopt the same names used for virHostdevPrepare*Devices() for
consistency's sake and to make it easier to jump between the two.

No functional changes.

9 years agohostdev: Rename virHostdevUpdateDomainActiveDevices()
Andrea Bolognani [Mon, 26 Oct 2015 10:59:41 +0000 (11:59 +0100)]
hostdev: Rename virHostdevUpdateDomainActiveDevices()

The new name, virHostdevUpdateActiveDomainDevices(), follows the
same naming conventions used by the rest of the module.

No functional changes.

9 years agotests: Remove unused nodeinfo test data
Andrea Bolognani [Wed, 7 Oct 2015 12:04:53 +0000 (14:04 +0200)]
tests: Remove unused nodeinfo test data

A bunch of files that we don't currently parse, and are very
unlikely to ever start parsing, made their way into the nodeinfo
test data. Get rid of them.

9 years agovirsh: Display an error when passing count <= 0 to setvcpus
Luyao Huang [Thu, 22 Oct 2015 03:27:35 +0000 (11:27 +0800)]
virsh: Display an error when passing count <= 0 to setvcpus

The number of vCPUs for a guest must be between 1 and the
maximum value configured in the domain XML. This commit
introduces checks to make sure that passing count <= 0
results in an error.

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

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agoconf: Fix error message to use correct parameter
John Ferlan [Tue, 20 Oct 2015 17:16:16 +0000 (13:16 -0400)]
conf: Fix error message to use correct parameter

Fix a cut-n-paste error from commit id '35eecdde' where the previous
check for max_sectors seems to have been copied, but the error message
parameter not updated to be ioeventfd

9 years agoutil: Produce friendlier error message to user
Luyao Huang [Wed, 21 Oct 2015 04:13:41 +0000 (12:13 +0800)]
util: Produce friendlier error message to user

Commit id '1c24cfe9' added error messages for virNumaSetPagePoolSize;
however, virNumaGetHugePageInfo also uses virNumaGetHugePageInfoPath
in order to build the path, but it never checked upon return if
the built path exists which could lead to an error message as follows:

$ virsh freepages 0 1
error: Failed to open file
    '/sys/devices/system/node/node0/hugepages/hugepages-1kB/free_hugepages':
    No such file or directory

Rather than add the same message for the other two callers, adjust
the virNumaGetHugePageInfoPath in order not only build the path, but
also check if the built path exists.  If the path does not exist,
then generate the error message and return failure.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agoutil: Adjust error paths for virNumaSetPagePoolSize
Luyao Huang [Wed, 21 Oct 2015 04:13:40 +0000 (12:13 +0800)]
util: Adjust error paths for virNumaSetPagePoolSize

Commit id '1c24cfe9' added new checks and error messaes for failure
scenarios. Let's adjust those error messages to after the call to
virNumaGetHugePageInfoPath in order to provide a more specific error
message depending on node and page_size

After this patch:
 # virsh allocpages --pagesize 2047 --pagecount 1 --cellno 0
 error: operation failed: page size 2047 is not available on node 0

 # virsh allocpages --pagesize 2047 --pagecount 1
 error: operation failed: page size 2047 is not available

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agoutil: split the virNumaGetHugePageInfoPath into separate function
Luyao Huang [Wed, 21 Oct 2015 04:13:39 +0000 (12:13 +0800)]
util: split the virNumaGetHugePageInfoPath into separate function

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

Refactor helper virNumaGetHugePageInfoPath to handle returning a directory
path when passed a page_size of 0 and suffix == NULL into a new helper
virNumaGetHugePageInfoDir which will only be called when a directory
path is expected to be returned. This solves the issue where the helper
was called with page_size == 0 expecting a file path in return, but
instead got a directory path and failed in virFileReadAll with:

    error : virFileReadAll:1358 : Failed to read file
                '/sys/devices/system/node/node0/hugepages/': Is a directory

Since virNumaGetPages API expects to return a directory by passing
page_size == 0 and suffix == NULL, it will now call the new helper.
Callers to virNumaGetHugePageInfoPath expect to return a file path
which could then be used in the call to virFileReadAll.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agoAvoid using !STREQ and !STRNEQ
Ishmanpreet Kaur Khera [Tue, 20 Oct 2015 16:15:12 +0000 (21:45 +0530)]
Avoid using !STREQ and !STRNEQ

We have macros for both positive and negative string matching.
Therefore there is no need to use !STREQ or !STRNEQ. At the same
time as we are dropping this, new syntax-check rule is
introduced to make sure we won't introduce it again.

Signed-off-by: Ishmanpreet Kaur Khera <khera.ishman@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agoNEWS: Fix XSLT stylesheet
Andrea Bolognani [Tue, 13 Oct 2015 07:44:13 +0000 (09:44 +0200)]
NEWS: Fix XSLT stylesheet

This has been broken for a looong time - in fact, we've been
shipping a mostly-empty NEWS file for at least the past two years.

Including the html namespace and using it for matching elements,
like hacking1.xsl and hacking2.xsl were already doing, makes the
NEWS file useful again.

Add a note explaining that the release list has been split up
by year as well.

9 years agoNEWS: Split releases by year
Andrea Bolognani [Thu, 15 Oct 2015 09:19:28 +0000 (11:19 +0200)]
NEWS: Split releases by year

Update cfg.mk to ignore the split files during
syntax-check (thanks Martin).

9 years agovz: implement some domain API calls
Maxim Nestratov [Mon, 19 Oct 2015 19:02:00 +0000 (22:02 +0300)]
vz: implement some domain API calls

The following functions are implemented:

vzDomainIsUpdated, vzDomainGetVcpusFlags and vzDomainGetMaxVcpus.

Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
9 years agovz: implement API calls of nodeGetxxx family
Maxim Nestratov [Mon, 19 Oct 2015 19:02:00 +0000 (22:02 +0300)]
vz: implement API calls of nodeGetxxx family

The following functions were implemented:

 vzNodeGetCPUStats, vzNodeGetMemoryStats,
 vzNodeGetCellsFreeMemory and vzNodeGetFreeMemory.

Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
9 years agovz: implement connectGetMaxVcpus API calls
Maxim Nestratov [Mon, 19 Oct 2015 19:02:00 +0000 (22:02 +0300)]
vz: implement connectGetMaxVcpus API calls

Because we have no limitation for maximal number of vcpus in containers
we report as maximum 1028 just for the sake of common sence.

Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
9 years agosecurity_dac: Introduce remember/recall APIs
Michal Privoznik [Wed, 7 Oct 2015 09:38:23 +0000 (11:38 +0200)]
security_dac: Introduce remember/recall APIs

Even though the APIs are not implemented yet, they create a
skeleton that can be filled in later.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agosecurity_dac: Limit usage of virSecurityDACSetOwnershipInternal
Michal Privoznik [Wed, 7 Oct 2015 09:08:55 +0000 (11:08 +0200)]
security_dac: Limit usage of virSecurityDACSetOwnershipInternal

This function should really be called only when we want to change
ownership of a file (or disk source). Lets switch to calling a
wrapper function which will eventually record the current owner
of the file and call virSecurityDACSetOwnershipInternal
subsequently.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agovirSecurityDACRestoreSecurityFileLabel: Pass virSecurityDACDataPtr
Michal Privoznik [Wed, 7 Oct 2015 08:57:18 +0000 (10:57 +0200)]
virSecurityDACRestoreSecurityFileLabel: Pass virSecurityDACDataPtr

This is pure code adjustment. The structure is going to be needed
later as it will hold a reference that will be used to talk to
virtlockd. However, so far this is no functional change just code
preparation.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agovirSecurityDACSetOwnership: Pass virSecurityDACDataPtr
Michal Privoznik [Wed, 7 Oct 2015 08:51:04 +0000 (10:51 +0200)]
virSecurityDACSetOwnership: Pass virSecurityDACDataPtr

This is pure code adjustment. The structure is going to be needed
later as it will hold a reference that will be used to talk to
virtlockd. However, so far this is no functional change just code
preparation.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agovirSecurityDACSetOwnershipInternal: Don't chown so often
Michal Privoznik [Wed, 7 Oct 2015 08:39:17 +0000 (10:39 +0200)]
virSecurityDACSetOwnershipInternal: Don't chown so often

It's better if we stat() file that we are about to chown() at
first and check if there's something we need to change. Not that
it would make much difference, but for the upcoming patches we
need to be doing stat() anyway. Moreover, if we do things this
way, we can drop @chown_errno variable which will become
redundant.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agosecurity_dac: Fix TODO marks
Michal Privoznik [Wed, 7 Oct 2015 09:16:08 +0000 (11:16 +0200)]
security_dac: Fix TODO marks

Correctly mark the places where we need to remember and recall
file ownership. We don't want to mislead any potential developer.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agovirtlockd: Don't SIGSEGV on SIGUSR1
Michal Privoznik [Mon, 12 Oct 2015 07:58:05 +0000 (09:58 +0200)]
virtlockd: Don't SIGSEGV on SIGUSR1

So we have this mechanism that on SIGUSR1 the virtlockd dumps its
internal state into a JSON file, reexec itself and the reloads
the internal state back. However, there's a bug in our
implementation:

  (gdb) signal SIGUSR1
  Continuing with signal SIGUSR1.
  [Thread 0x7fd094f7b700 (LWP 10602) exited]
  process 10600 is executing new program: /home/zippy/work/libvirt/libvirt.git/src/virtlockd
  warning: Could not load shared library symbols for linux-vdso.so.1.
  Do you need "set solib-search-path" or "set sysroot"?
  [Thread debugging using libthread_db enabled]
  Using host libthread_db library "/lib64/libthread_db.so.1".
  [New Thread 0x7fb28bc3c700 (LWP 14501)]

  Program received signal SIGSEGV, Segmentation fault.
  0x00007fb29133d530 in virExpandN (ptrptr=0x70, size=8, countptr=0x68, add=1, report=true, domcode=7, filename=0x7fb29138aeab "rpc/virnetserver.c", funcname=0x7fb29138b680 <__FUNCTION__.15821> "virNetServerAddProgram", linenr=661) at util/viralloc.c:288
  288         if (*countptr + add < *countptr) {
  (gdb) bt
  #0  0x00007fb29133d530 in virExpandN (ptrptr=0x70, size=8, countptr=0x68, add=1, report=true, domcode=7, filename=0x7fb29138aeab "rpc/virnetserver.c", funcname=0x7fb29138b680 <__FUNCTION__.15821> "virNetServerAddProgram", linenr=661) at util/viralloc.c:288
  #1  0x00007fb29132a267 in virNetServerAddProgram (srv=0x0, prog=0x7fb2915d08b0) at rpc/virnetserver.c:661
  #2  0x00007fb29131f27f in main (argc=1, argv=0x7fff8f771298) at locking/lock_daemon.c:1445

Notice the NULL @srv passed to frame 2? Usually, the @srv
variable is initialized on fresh start. However, in case of
daemon reload, the code path that is responsible for initializing
the value was not triggered and therefore we crashed immediately.
Fix this by always setting the variable.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agoClose the source fd if the destination qemu exits during tunnelled migration
Shivaprasad G Bhat [Thu, 8 Oct 2015 12:29:07 +0000 (17:59 +0530)]
Close the source fd if the destination qemu exits during tunnelled migration

Tunnelled migration can hang if the destination qemu exits despite all the
ABI checks. This happens whenever the destination qemu exits before the
complete transfer is noticed by source qemu. The savevm state checks at
runtime can fail at destination and cause qemu to error out.
The source qemu cant notice it as the EPIPE is not propogated to it.
The qemuMigrationIOFunc() notices the stream being broken from virStreamSend()
and it cleans up the stream alone. The qemuMigrationWaitForCompletion() would
never get to 100% transfer completion.
The qemuMigrationWaitForCompletion() never breaks out as well since
the ssh connection to destination is healthy, and the source qemu also thinks
the migration is ongoing as the Fd to which it transfers, is never
closed or broken. So, the migration will hang forever. Even Ctrl-C on the
virsh migrate wouldn't be honoured. Close the source side FD when there is
an error in the stream. That way, the source qemu updates itself and
qemuMigrationWaitForCompletion() notices the failure.

Close the FD for all kinds of errors to be sure. The error message is not
copied for EPIPE so that the destination error is copied instead later.

Note:
Reproducible with repeated migrations between Power hosts running in different
subcores-per-core modes.

Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
9 years agoconf: Optimize the iothreadid initialization
John Ferlan [Tue, 13 Oct 2015 12:26:27 +0000 (08:26 -0400)]
conf: Optimize the iothreadid initialization

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

The existing algorithm assumed that someone was making small, incremental
changes; however, it is possible to change iothreads from 0 (or relatively
small number) to some really large number and the algorithm would possibly
spin its wheels doing unnecessary searches.

So, optimize the algorithm using a bitmap to find available iothread_id's
starting at 1 that aren't already defined by a "<thread id='#'>" and
filling in the iothreadids array with those iothread_id values.

9 years agoqemu: Fix qemu startup check for QEMU_CAPS_OBJECT_IOTHREAD
John Ferlan [Thu, 15 Oct 2015 16:30:40 +0000 (12:30 -0400)]
qemu: Fix qemu startup check for QEMU_CAPS_OBJECT_IOTHREAD

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

When qemuDomainPinIOThread was added in commit id 'fb562614', a check
for the IOThread capability was not needed since a check for iothreadpids
covered the condition where the support for IOThreads was not present.
The iothreadpids array was only created if qemuProcessDetectIOThreadPIDs
was able to query the monitor for IOThreads. It would only do that if
the QEMU_CAPS_OBJECT_IOTHREAD capability was set.

However, when iothreadids were added in commit id '8d4614a5' and the
check for iothreadpids was replaced by a search through the iothreadids[]
array for the matching iothread_id that left open the possibility that
an iothreadids[] array was defined, but the entries essentially pointed
to elements with only the 'iothread_id' defined leaving the 'thread_id'
value of 0 and eventually the cpumap entry of NULL.

This was because, the original IOThreads commit id '72edaae7' only
checked if IOThreads were defined and if the emulator had the IOThreads
capability, then IOThread objects were added at startup. The "capability
failure" check was only done when a disk was assigned to an IOThread in
qemuCheckIOThreads. This was because the initial implementation had no way
to dynamically add IOThreads, but it was possible to dynamically add a
disk to the domain. So the decision was if the domain supported it, then
add the IOThread objects. Then if a disk with an IOThread defined was
added, it could check the capability and fail to add if not there. This
just meant the 'iothreads' value was essentially ignored.

Eventually commit id 'a27ed6e7' allowed for the dynamic addition and
deletion of IOThread objects. So it was no longer necessary to generate
IOThread objects to dynamically attach a disk to. However, the startup
and disk check code was not modified to reflect this.

This patch will move the capability failure check to when IOThread
objects are being added to the command line. Thus a domain that has
IOThreads defined will not be started if the emulator doesn't support
the capability. This means when qemuCheckIOThreads is called to add
a disk, it's no longer necessary to check the capability. Instead the
code can use the IOThreadFind call to indicate that the IOThread
doesn't exist.

Finally because it could be possible to have a domain running with the
iothreadids[] defined prior to this change if libvirtd is restarted each
having mostly empty elements, qemuProcessDetectIOThreadPIDs will check
if there are niothreadids when the QEMU_CAPS_OBJECT_IOTHREAD capability
check fails and remove the elements and array if it exists.

With these changes in place, it turns out the cputune-numatune test
was failing because the right bit wasn't set in the test. So used the
opportunity to fix that and create a test that would expect to fail
with some sort of iothreads defined and used, but not having the
correct capability.

9 years agoqemu: Check for niothreads == 0 in qemuSetupCgroupForIOThreads
John Ferlan [Thu, 15 Oct 2015 20:05:52 +0000 (16:05 -0400)]
qemu: Check for niothreads == 0 in qemuSetupCgroupForIOThreads

If there are no IOThreads defined, no sense making other checks

9 years agoqemu: Use 'niothreadids' instead of 'iothreads'
John Ferlan [Thu, 15 Oct 2015 14:26:26 +0000 (10:26 -0400)]
qemu: Use 'niothreadids' instead of 'iothreads'

Although theoretically both should be the same value, the niothreadids
should be used in favor of iothreads when performing comparisons. This
leaves the iothreads as a purely numeric value to be saved in the config
file.  The one exception to the rule is virDomainIOThreadIDDefArrayInit
where the iothreadids are being generated from the iothreads count since
iothreadids were added after initial iothreads support.

9 years agovirsh: Use 'format' argument only when specified
Peter Krempa [Fri, 16 Oct 2015 07:01:17 +0000 (09:01 +0200)]
virsh: Use 'format' argument only when specified

The condition checking whether --format was specified was incorrect.
virsh crashed if the following format was used:

 virsh dump VM dump --format '' --memory-only

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

9 years agodocs: event impl. registration before hypervisor connection
Dominik Perpeet [Fri, 25 Sep 2015 08:54:21 +0000 (10:54 +0200)]
docs: event impl. registration before hypervisor connection

Event implementations need to be registered before a connection to the
Hypervisor is opened, otherwise event handling can be impaired (e.g.
delayed messages). This fact is referenced in an e-mail [1], but should
also be noted in the documentation of the registration functions.

[1] https://www.redhat.com/archives/libvirt-users/2014-April/msg00011.html

9 years agoFix conficts with HACKING doc
Wei Jiangang [Thu, 15 Oct 2015 09:12:20 +0000 (17:12 +0800)]
Fix conficts with HACKING doc

Don't compare a bool variable against the literal, "true".

Signed-off-by: Wei Jiangang <weijg.fnst@cn.fujitsu.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agolibvirt-secret: Fix typo
Wei Jiangang [Thu, 15 Oct 2015 09:12:19 +0000 (17:12 +0800)]
libvirt-secret: Fix typo

seclets ==> selects
qualfied ==> qualified

Signed-off-by: Wei Jiangang <weijg.fnst@cn.fujitsu.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoconf: Refactor the iothreadid initialization
John Ferlan [Tue, 13 Oct 2015 12:22:14 +0000 (08:22 -0400)]
conf: Refactor the iothreadid initialization

Create a separate local API that will fill in the iothreadid array
entries that were not defined by <iothread id='#'> entries in the XML.

Signed-off-by: John Ferlan <jferlan@redhat.com>
9 years agoNEWS: Unify date format
Andrea Bolognani [Wed, 14 Oct 2015 07:54:58 +0000 (09:54 +0200)]
NEWS: Unify date format

There were some inconsistencies, eg. the number of digits used for
the day. The month name was also spelled out instead of abbreviated
in some instances.

9 years agoNEWS: Unify section titles
Andrea Bolognani [Wed, 14 Oct 2015 07:46:51 +0000 (09:46 +0200)]
NEWS: Unify section titles

There were some inconsistencies; now the section title is always
one of Bug Fixes, Cleanups, Documentation, Features, Improvements,
Portability, Security.

9 years agoNEWS: Add empty lines
Andrea Bolognani [Tue, 13 Oct 2015 16:59:20 +0000 (18:59 +0200)]
NEWS: Add empty lines

Make sure there is always an empty line between sections.

9 years agoNEWS: Fix indentation
Andrea Bolognani [Tue, 13 Oct 2015 16:26:12 +0000 (18:26 +0200)]
NEWS: Fix indentation

Some of the paragraphs were not properly indented: while this was
not a problem in the HTML version, you could tell the difference
in the plain text version.

9 years agoNEWS: Fix newlines
Andrea Bolognani [Tue, 13 Oct 2015 16:10:03 +0000 (18:10 +0200)]
NEWS: Fix newlines

Some <br/> tags were missing from the end of the corresponding
line, some of there were in the middle of the line instead.

9 years agoNEWS: Fix whitespace
Andrea Bolognani [Tue, 13 Oct 2015 15:50:57 +0000 (17:50 +0200)]
NEWS: Fix whitespace

Mostly missing space between change description and author name or
spurious space before section title.

Reflow the introductory paragraph as well.

9 years agoNEWS: Organize old entries
Andrea Bolognani [Tue, 13 Oct 2015 14:06:52 +0000 (16:06 +0200)]
NEWS: Organize old entries

Sort all items into the standard categories: Features, Bug Fixes,
Improvements, Cleanups, etc.

The sorting is somewhat arbitrary in certain instances.

9 years agoNEWS: Split old entries (2009)
Andrea Bolognani [Wed, 14 Oct 2015 06:54:51 +0000 (08:54 +0200)]
NEWS: Split old entries (2009)

The changes for releases earlier than 0.7.1 were mostly lumped
together as opposed to being tidly organized with one change per
line, like we have done from that point onwards.

As a result, they look awful in the HTML version and don't work
too well in the plain text version either.

Luckily, except for the very first releases, the information is
still very detailed, so it's enough to organize it properly.

9 years agoNEWS: Split old entries (2008)
Andrea Bolognani [Wed, 14 Oct 2015 06:55:17 +0000 (08:55 +0200)]
NEWS: Split old entries (2008)

The changes for releases earlier than 0.7.1 were mostly lumped
together as opposed to being tidly organized with one change per
line, like we have done from that point onwards.

As a result, they look awful in the HTML version and don't work
too well in the plain text version either.

Luckily, except for the very first releases, the information is
still very detailed, so it's enough to organize it properly.

9 years agoNEWS: Split old entries (2006-2007)
Andrea Bolognani [Wed, 14 Oct 2015 06:55:48 +0000 (08:55 +0200)]
NEWS: Split old entries (2006-2007)

The changes for releases earlier than 0.7.1 were mostly lumped
together as opposed to being tidly organized with one change per
line, like we have done from that point onwards.

As a result, they look awful in the HTML version and don't work
too well in the plain text version either.

Luckily, except for the very first releases, the information is
still very detailed, so it's enough to organize it properly.

9 years agoNEWS: Properly escape > in HTML
Andrea Bolognani [Tue, 13 Oct 2015 15:40:03 +0000 (17:40 +0200)]
NEWS: Properly escape > in HTML

9 years agoNEWS: Split off merged sections
Andrea Bolognani [Tue, 13 Oct 2015 16:07:38 +0000 (18:07 +0200)]
NEWS: Split off merged sections

Portability and Bug Fixes for release 0.7.3 were merged together;
same for Features and Security for release 1.1.3. Split them off

9 years agoNEWS: Remove empty sections
Andrea Bolognani [Tue, 13 Oct 2015 15:22:53 +0000 (17:22 +0200)]
NEWS: Remove empty sections

9 years agoNEWS: Include description for release 0.7.3
Andrea Bolognani [Tue, 13 Oct 2015 07:57:47 +0000 (09:57 +0200)]
NEWS: Include description for release 0.7.3

The description for this release, unlike all other descriptions,
was inside a <p> element; however, the XSLT stylesheet contains a
template that drops all <p> elements from the output file, so it
never made it to the generated NEWS file.

Use a <li> element, same as all other releases, instead.

9 years agotests: make redirects happen in correct order
Wei Jiangang [Wed, 14 Oct 2015 10:39:13 +0000 (18:39 +0800)]
tests: make redirects happen in correct order

It should redirect stdout to /dev/null first,
then redirect stderr to whatever stdout currently points at.

Signed-off-by: Wei Jiangang <weijg.fnst@cn.fujitsu.com>
9 years agostorage: Rework error paths for virStorageBackendCreateExecCommand
John Ferlan [Thu, 8 Oct 2015 17:48:14 +0000 (13:48 -0400)]
storage: Rework error paths for virStorageBackendCreateExecCommand

Rework the code in order to use the "ret = -1;" and goto cleanup;
coding style.

Signed-off-by: John Ferlan <jferlan@redhat.com>
9 years agostorage: On error rmdir created directory in virDirCreate[NoFork]
John Ferlan [Thu, 8 Oct 2015 12:50:34 +0000 (08:50 -0400)]
storage: On error rmdir created directory in virDirCreate[NoFork]

After a successful creation of a directory, if some other call results
in returning a failure, let's remove the directory we created to
prevent another round trip or confusion in the caller. In particular, this
function can be called during a storage backend buildVol, so in order
to ensure that caller doesn't need to distinguish between failed create
or some other failure after create, just remove the directory we created.

Signed-off-by: John Ferlan <jferlan@redhat.com>
9 years agostorage: On error unlink created file in virFileOpen{As|Forked}
John Ferlan [Thu, 8 Oct 2015 12:39:51 +0000 (08:39 -0400)]
storage: On error unlink created file in virFileOpen{As|Forked}

After a successful creation of a file, if some other call results
in returning a failure, let's unlink the file we created to prevent
another round trip or confusion in the caller. In particular, this
function can be called during a storage backend buildVol, so in order
to ensure that caller doesn't need to distinguish between failed create
or some other failure after create, just remove the volume we created.

Signed-off-by: John Ferlan <jferlan@redhat.com>
9 years agostorage: Track successful creation of LV for removal
John Ferlan [Thu, 8 Oct 2015 21:26:01 +0000 (17:26 -0400)]
storage: Track successful creation of LV for removal

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

Track when the logical volume was successfully created in order to
properly handle the call to virStorageBackendLogicalDeleteVol. It's
possible that the failure to create was because someone created an
LV in the pool outside of libvirt's knowledge. In this case, we don't
want to delete that LV.  A subsequent or future refresh of the pool
will find the volume and cause an earlier failure

Signed-off-by: John Ferlan <jferlan@redhat.com>
9 years agostorage: Fix a resource leak in storageVolCreateXML
John Ferlan [Thu, 8 Oct 2015 20:24:47 +0000 (16:24 -0400)]
storage: Fix a resource leak in storageVolCreateXML

Commit id '1b5685da' refactored the code to move buildvoldef inside
the buildVol conditional; however, the VIR_FREE of the memory was
left only when 'buildret' failed, thus we're leaking memory.

Signed-off-by: John Ferlan <jferlan@redhat.com>
9 years agostorage: Remove duplicitous refreshVol in Sheepdog buildVol
John Ferlan [Thu, 8 Oct 2015 17:35:01 +0000 (13:35 -0400)]
storage: Remove duplicitous refreshVol in Sheepdog buildVol

As of commit id '155ca616' a 'refreshVol' is called after a buildVol
succeeds in storageVolCreateXML, thus a volStorageBackendSheepdogRefreshVolInfo
call in virStorageBackendSheepdogBuildVol is no longer necessary.

Additionally, the 'conn' parameter becomes unused.

Signed-off-by: John Ferlan <jferlan@redhat.com>
9 years agostorage: Remove duplicitous refreshVol in RBD buildVol
John Ferlan [Thu, 8 Oct 2015 17:28:23 +0000 (13:28 -0400)]
storage: Remove duplicitous refreshVol in RBD buildVol

As of commit id '155ca616' a 'refreshVol' is called after the buildVol
succeeds in storageVolCreateXML, thus the volStorageBackendRBDRefreshVolInfo
call in virStorageBackendRBDBuildVol is no longer necessary.

Signed-off-by: John Ferlan <jferlan@redhat.com>
9 years agobuild: include xdr cflags for libvirt-admin
Eric Blake [Tue, 13 Oct 2015 18:17:12 +0000 (12:17 -0600)]
build: include xdr cflags for libvirt-admin

Without this, building on cygwin fails with:

  CC       libvirt_admin_la-libvirt-admin.lo
libvirt-admin.c:25:21: fatal error: rpc/rpc.h: No such file or directory
 #include <rpc/rpc.h>
                     ^

Reported-by: Yaakov Selkowitz <yselkowi@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
9 years agovirt-host-validate: check for IOMMU support
Daniel P. Berrange [Wed, 7 Oct 2015 16:46:18 +0000 (17:46 +0100)]
virt-host-validate: check for IOMMU support

This looks for existance of DMAR (Intel) and IVRS (AMD)
files under /sys/firmware/acpi/tables/, as a sign that
the platform has IOMMU present & enabled in the BIOS.

If these are present and /sys/kernel/iommu_groups does
not contain any entries this is taken as a sign that
the kernel has not enabled the IOMMU currently.

If no ACPI tables are found we can't distinguish between
disabled in BIOS and not present in the hardware, so we
have to give the user a generic hint.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
9 years agolibvirt-domain: Drop virDomainMigrateCheckNotLocal attribute
Michal Privoznik [Mon, 12 Oct 2015 14:37:15 +0000 (16:37 +0200)]
libvirt-domain: Drop virDomainMigrateCheckNotLocal attribute

Our apibuild.py script does not cope with ATTRIBUTE_NONNULL:

Parse Error: parsing function type, ')' expected
Got token  ('name', 'char')
Last token:  ('name', 'char')
Token queue:  [('op', '*'), ('name', 'dconnuri'), ('sep', ')')]
Line 3297 end:
Makefile:2441: recipe for target '../../docs/apibuild.py.stamp' failed

Let's drop it. Moreover, up until e17ae3ccc2dbc1400 where it was
introduced we did not really care about NULL-ity of dconnuri. And
moreover the ATTRIBUTE_NONNULL merely checks for static calls
over NULL, it won't catch the dynamic ones, where a NULL is
passed by a variable at runtime.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agostorage: Fix incorrect format for <disk> <auth> XML
John Ferlan [Wed, 23 Sep 2015 20:28:30 +0000 (16:28 -0400)]
storage: Fix incorrect format for <disk> <auth> XML

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

After creating a copy of the 'authdef' in a pool -> disk translation,
unconditionally clear the 'authType' in the resulting disk auth def
structure since that's used for a storage pool and not a disk.  This
ensures virStorageAuthDefFormat will properly format the <auth> XML
for a <disk> (e.g. it won't have a <auth type='%s'.../>).

9 years agovirt-host-validate: disable mntent code on Win32
Daniel P. Berrange [Mon, 12 Oct 2015 13:33:04 +0000 (14:33 +0100)]
virt-host-validate: disable mntent code on Win32

Win32 does not have support for mntent.h header, so the
method which uses this must be stubbed out.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
9 years agovirt-host-validate: check for required cgroups
Daniel P. Berrange [Wed, 7 Oct 2015 16:36:37 +0000 (17:36 +0100)]
virt-host-validate: check for required cgroups

Extend the virt-host-validate checks to see if the required
cgroups are compiled into the kernel and that they are
mounted on the system. The cgroups are all optional except
for 3 that LXC mandates

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
9 years agovirt-host-validate: distinguish exists vs accessible for devices
Daniel P. Berrange [Wed, 7 Oct 2015 16:02:31 +0000 (17:02 +0100)]
virt-host-validate: distinguish exists vs accessible for devices

Currently we just check that various devices are accessible.
This leads to inaccurate errors reported for /dev/kvm and
/dev/vhost-net if they exist but an unprivileged user lacks
access. Switch existing checks to look for file existance,
and add a separate check for accessibility of /dev/kvm
since some distros don't grant users access by default.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
9 years agovirt-host-validate.c: check for kernel namespaces
Daniel P. Berrange [Wed, 7 Oct 2015 15:58:39 +0000 (16:58 +0100)]
virt-host-validate.c: check for kernel namespaces

The LXC driver requires the uts, mnt, pid & ipc
namespaces, while net & user namespaces are
optional. Validate all these are present.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
9 years agomigration: check dconnuri in p2p mode
Nikolay Shirokovskiy [Fri, 2 Oct 2015 07:52:52 +0000 (10:52 +0300)]
migration: check dconnuri in p2p mode

Check dconnuri is not null or we will catch nullpointer later.
I hope this makes Coverity happy.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
9 years agomigration: refactor: introduce parameter checking function
Nikolay Shirokovskiy [Fri, 2 Oct 2015 07:52:51 +0000 (10:52 +0300)]
migration: refactor: introduce parameter checking function

virDomainMigrateUnmanagedParams is not a good candidate for this functionality
as it is used by migrate family functions too and its have its own checks that
are superset of extracted and we don't need to check twice.

Actually name of the function is slightly misleading as there is also a check
for consistensy of flags parameter alone. So it could be refactored further and
reused by all migrate functions but for now let it be a matter of a different
patchset.

It is *not* a pure refactoring patch as it introduces offline check for older
versions. Looks like it must be done that way and no one will be broken too.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
9 years agomigration: merge all proto branches into single function
Nikolay Shirokovskiy [Fri, 2 Oct 2015 07:52:50 +0000 (10:52 +0300)]
migration: merge all proto branches into single function

Finally on this step we get what we were aimed for - toURI{1, 2} (and
migration{*} APIs too) now can work thru V3_PARAMS protocol. Execution path
goes thru unchanged virDomainMigrateUnmanaged adapter function which is called
by all target places.

Note that we keep the fact that direct migration never works
thru V3_PARAMS proto. We can't change this aspect without
further investigation.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
9 years agomigration: refactor: refactor parameter compatibility checks
Nikolay Shirokovskiy [Fri, 2 Oct 2015 07:52:49 +0000 (10:52 +0300)]
migration: refactor: refactor parameter compatibility checks

Move virDomainMigrateUnmanagedProto* expected params list check into
function itself and use common virTypedParamsCheck for this purpose.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
9 years agomigration: refactor: extract parameter adaption functions
Nikolay Shirokovskiy [Fri, 2 Oct 2015 07:52:48 +0000 (10:52 +0300)]
migration: refactor: extract parameter adaption functions

Extract parameter adaptation and checking which is protocol dependent into
designated functions. Leave only branching and common checks in
virDomainMigrateUnmanagedParams.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
9 years agomigration: refactor: introduce params version of unmanaged
Nikolay Shirokovskiy [Fri, 2 Oct 2015 07:52:47 +0000 (10:52 +0300)]
migration: refactor: introduce params version of unmanaged

Let's put main functionality into params version of virDomainMigrateUnmanaged
as a preparation step for merging it with virDomainMigratePeer2PeerParams.
virDomainMigrateUnmanaged then does nothing more then just adapting arguments.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
9 years agomigration: refactor: merge direct and p2p into unmanaged
Nikolay Shirokovskiy [Fri, 2 Oct 2015 07:52:46 +0000 (10:52 +0300)]
migration: refactor: merge direct and p2p into unmanaged

p2p plain and direct function are good candidates for code reuse. Their main
function is same - to branch among different versions of migration protocol and
implementation of this function is also same. Also they have other common
functionality in lesser aspects. So let's merge them.

But as they have different signatures we have to get to convention on how to
pass direct migration 'uri' in 'dconnuri' and 'miguri'. Fortunately we alreay
have such convention in parameters passed to toURI2 function, just let's follow
it. 'uri' is passed in miguri and dconnuri is ignored.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
9 years agomigration: refactor: rename uri parameter to miguri
Nikolay Shirokovskiy [Fri, 2 Oct 2015 07:52:45 +0000 (10:52 +0300)]
migration: refactor: rename uri parameter to miguri

We use miguri name for this parameter in other places. So
make naming more consitent.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
9 years agomigration: remove direct migration dependency on version1 of driver
Michal Privoznik [Fri, 2 Oct 2015 07:52:44 +0000 (10:52 +0300)]
migration: remove direct migration dependency on version1 of driver

Direct migration should work if *perform3 is present but *perform
is not. This is situation when driver migration is implemented
after new version of driver function is introduced. We should not
be forced to support old version too as its parameter space is
subspace of newer one.

9 years agomigration: move implementation check to branches in p2p
Nikolay Shirokovskiy [Fri, 2 Oct 2015 07:52:43 +0000 (10:52 +0300)]
migration: move implementation check to branches in p2p

This is more structured code so it will be easier to add branch for _PARAMS
protocol here. It is not a pure refactoring strictly speaking as we remove
scenarios for broken cases when driver defines V3 feature and implements
perform function. So it is additionally a more solid code.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
9 years agomigration: refactor: reuse p2p url check
Nikolay Shirokovskiy [Fri, 2 Oct 2015 07:52:42 +0000 (10:52 +0300)]
migration: refactor: reuse p2p url check

Refactor dconnuri local server URI check to common API.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
9 years agomigration: refactor: get rid of use_params p2p_full
Nikolay Shirokovskiy [Fri, 2 Oct 2015 07:52:41 +0000 (10:52 +0300)]
migration: refactor: get rid of use_params p2p_full

'useParams' parameter usage is an example of control coupling. Most of the work
inside the function is done differently except for the uri check. Lets split
this function into two, one with extensible parameters set and one with hardcoded
parameter set.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
9 years agovirJSONValueArraySize: return ssize_t
Michal Privoznik [Thu, 8 Oct 2015 08:17:42 +0000 (10:17 +0200)]
virJSONValueArraySize: return ssize_t

The internal representation of a JSON array counts the items in
size_t. However, for some reason, when asking for the count it's
reported as int. Firstly, we need the function to return a signed
type as it's returning -1 on an error. But, not every system has
integer the same size as size_t. Therefore, lets return ssize_t.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agosrc: Remove $(builddir) usage
Andrea Bolognani [Fri, 9 Oct 2015 09:20:06 +0000 (11:20 +0200)]
src: Remove $(builddir) usage

Commit 4e8032272f1704f7 used $(builddir) in the header search
path to fix a build issue; however, $(builddir) is not defined
by old autoconf versions such as the one available in CentOS 5,
resulting in the following error:

  cc1: error: /util: No such file or directory
  make[3]: *** [libvirt_driver_la-fdstream.lo] Error 1

Since $(builddir) is defined to always be '.', just use that
value directly instead.

9 years agosrc: Include $(builddir)/util in the header search path
Andrea Bolognani [Thu, 8 Oct 2015 06:35:29 +0000 (08:35 +0200)]
src: Include $(builddir)/util in the header search path

Since a9fe620372144db, we are generating virkeymaps.h at build
time; however, we are not including $(builddir)/util in the
header search path, so when doing a VPATH build the compiler
is unable to locate the file.

make[2]: Entering directory
`/home/jenkins/libvirt/systems/libvirt-fedora-20/build/src'
  GEN      util/virkeymaps.h
  ...
  CC       util/libvirt_util_la-virkeycode.lo
  CC       util/libvirt_util_la-virkeyfile.lo
  CC       util/libvirt_util_la-virlockspace.lo
  CC       util/libvirt_util_la-virlog.lo
../../src/util/virkeycode.c:27:24: fatal error: virkeymaps.h: No such file or directory
 #include "virkeymaps.h"
                        ^
compilation terminated.

9 years agovz: cleanup
Maxim Nestratov [Wed, 7 Oct 2015 10:05:00 +0000 (13:05 +0300)]
vz: cleanup

Remove unused definitions, functions and structure fields.

Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
9 years agostorage: Perform some cleanup of calls
John Ferlan [Mon, 5 Oct 2015 13:53:02 +0000 (09:53 -0400)]
storage: Perform some cleanup of calls

Cleanup calls to virStorageBackendCopyToFD a bit.

Signed-off-by: John Ferlan <jferlan@redhat.com>
9 years agoAUTHORS: Add myself to the list of committers
Andrea Bolognani [Thu, 8 Oct 2015 09:33:39 +0000 (11:33 +0200)]
AUTHORS: Add myself to the list of committers

9 years agoqemu: Resolve Coverity FORWARD_NULL
John Ferlan [Thu, 24 Sep 2015 21:32:59 +0000 (17:32 -0400)]
qemu: Resolve Coverity FORWARD_NULL

Coverity notices that net->ifname is potentially referenced after a
VIR_FREE().  Since the net->ifname will eventually be free'd during
virDomainDefFree when calling virDomainNetDefFree, let's just that
processing take care the free.

Signed-off-by: John Ferlan <jferlan@redhat.com>
9 years agolibxl: Resolve Coverity FORWARD_NULL
John Ferlan [Thu, 24 Sep 2015 18:57:14 +0000 (14:57 -0400)]
libxl: Resolve Coverity FORWARD_NULL

Since the strtok_r call in libxlCapsInitGuests expects a non NULL first
parameter when the third parameter is NULL, we need to check that
the returned 'capabilities' from a libxl_get_version_info call is
not NULL and error out if so since the code expects it.

Signed-off-by: John Ferlan <jferlan@redhat.com>
9 years agovirSecurityManagerNew: Turn array of booleans into flags
Michal Privoznik [Tue, 6 Oct 2015 15:01:48 +0000 (17:01 +0200)]
virSecurityManagerNew: Turn array of booleans into flags

So imagine you want to crate new security manager:

  if (!(mgr = virSecurityManagerNew("selinux", "QEMU", false, true, false, true)));

Hard to parse, right? What about this:

  if (!(mgr = virSecurityManagerNew("selinux", "QEMU",
                                    VIR_SECURITY_MANAGER_DEFAULT_CONFINED |
                                    VIR_SECURITY_MANAGER_PRIVILEGED)));

Now that's better! This is what the commit does.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agotests: eventtest: Fix coverity warning
Cole Robinson [Wed, 7 Oct 2015 14:48:45 +0000 (10:48 -0400)]
tests: eventtest: Fix coverity warning

We can ignore the result of virtTestResult here, because failure is
unconditionally reported by the callers

9 years agoqemu: Fix indentation issue
Andrea Bolognani [Wed, 7 Oct 2015 09:07:11 +0000 (11:07 +0200)]
qemu: Fix indentation issue

Two #define lines introduced by b527aa0 did not respect the
indentation rules, thus breaking syntax-check.

9 years agoqemu: Remove explicit values from virQEMUCapsFlags
Andrea Bolognani [Tue, 6 Oct 2015 14:28:25 +0000 (16:28 +0200)]
qemu: Remove explicit values from virQEMUCapsFlags

This gets rid of the partially enforced alignment and makes it less
likely for a bogus value to be introduced in the enumeration.
Capabilities are divided in five-element groups for better readability.

Use #define for QEMU_CAPS_NET_NAME and QEMU_CAPS_HOST_NET_ADD, both
of which are aliases for QEMU_CAPS_0_10.

9 years agoqemu: migration: Skip few checks while doing offline migration
Peter Krempa [Tue, 6 Oct 2015 15:02:09 +0000 (17:02 +0200)]
qemu: migration: Skip few checks while doing offline migration

qemuMigrationIsAllowed would disallow offline migration if the VM
contained host devices or memory modules. Since during offline migration
we don't transfer any state we can safely migrate VMs with such
configuration.

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

9 years agoqemu: migration: Use migration flags in qemuMigrationIsAllowed
Peter Krempa [Tue, 6 Oct 2015 14:24:48 +0000 (16:24 +0200)]
qemu: migration: Use migration flags in qemuMigrationIsAllowed

Use the migration @flags for checking various migration aspects rather
than picking them out as booleans. Document the new semantics in the
function header.

9 years agoqemu: migration: Drop @def from qemuMigrationIsAllowed
Peter Krempa [Tue, 6 Oct 2015 13:53:02 +0000 (15:53 +0200)]
qemu: migration: Drop @def from qemuMigrationIsAllowed

Now that qemuMigrationIsAllowed is always called with @vm, we can drop
the @def argument and simplify the control flow.

Additionally the comment is invalid so drop it.

9 years agoqemu: migration: Split source and destination migration checks
Peter Krempa [Tue, 6 Oct 2015 13:39:48 +0000 (15:39 +0200)]
qemu: migration: Split source and destination migration checks

Extract the hostdev check from qemuMigrationIsAllowed into a separate
function since that is the only part that needs to be done in the v2
migration protocol prepare phase on the destination. All other checks
were added when the v3 protocol existed so they don't need to be
extracted.

This change will allow to drop the @def argument for
qemuMigrationIsAllowed and further simplify the function.

9 years agospec: Delete .git after applying patches
Cole Robinson [Tue, 6 Oct 2015 19:54:47 +0000 (15:54 -0400)]
spec: Delete .git after applying patches

I'm hitting this little annoyance in fedora's package repo:

$ fedpkg prep
Downloading libvirt-1.2.20.tar.gz
...
+ /usr/bin/gzip -dc /home/crobinso/src/fedora/libvirt/libvirt-1.2.20.tar.gz
$ git clean -xdf
Removing libvirt-1.2.20.tar.gz
Skipping repository libvirt-1.2.20/

We git-ify the libvirt directory as part of applying patches in the spec
file, but 'git clean' will ignore subfolders that appear to be standalone
git repos.

Let's just delete the .git directory after we're done with it.

9 years agovz: remove storage driver as never used
Maxim Nestratov [Tue, 22 Sep 2015 10:33:00 +0000 (13:33 +0300)]
vz: remove storage driver as never used

In fact, it was never used as far as vz has no features supporting it.
That is why there will be no harm to anyone if we just remove this code to
prevent further misunderstanding and efforts to support dead code.

Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>