]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/log
people/liuw/libxenctrl-split/libvirt.git
9 years agoTest for the new watchdog model diag288
Boris Fiuczynski [Wed, 24 Jun 2015 09:28:44 +0000 (11:28 +0200)]
Test for the new watchdog model diag288

Adding a test for the new watchdog model diag288.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
9 years agoSupport for the new watchdog model diag288
Boris Fiuczynski [Wed, 24 Jun 2015 09:28:43 +0000 (11:28 +0200)]
Support for the new watchdog model diag288

This patch provides support for the new watchdog model "diag288".

Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Reviewed-by: Daniel Hansel <daniel.hansel@linux.vnet.ibm.com>
Reviewed-by: Stefan Zimmermann <stzi@linux.vnet.ibm.com>
Reviewed-by: Tony Krowiak <akrowiak@linux.vnet.ibm.com>
9 years agoTest for the new watchdog action inject-nmi
Boris Fiuczynski [Wed, 24 Jun 2015 09:28:42 +0000 (11:28 +0200)]
Test for the new watchdog action inject-nmi

Adding a test for the new watchdog action "inject-nmi".

Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
9 years agoSupport for a new watchdog action inject-nmi
Boris Fiuczynski [Wed, 24 Jun 2015 09:28:41 +0000 (11:28 +0200)]
Support for a new watchdog action inject-nmi

This patch provides support for a new watchdog action "inject-nmi" which
allows to define an inject of a non-maskable interrupt into a guest.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Reviewed-by: Daniel Hansel <daniel.hansel@linux.vnet.ibm.com>
Reviewed-by: Stefan Zimmermann <stzi@linux.vnet.ibm.com>
Reviewed-by: Tony Krowiak <akrowiak@linux.vnet.ibm.com>
9 years agoscsi: Force error for SCSI pools on virStorageBackendSCSIFindLUs failure
John Ferlan [Tue, 23 Jun 2015 18:40:31 +0000 (14:40 -0400)]
scsi: Force error for SCSI pools on virStorageBackendSCSIFindLUs failure

Related to :

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

Rather than ignore the return status from virStorageBackendSCSIFindLUs,
cause a failure to start the pool if a -1 is returned. Issue was noted
during testing of the bz for iscsi that 'scsi' and 'fc' pools don't fail.

9 years agovircapstest: Properly report error for failed tests
Michal Privoznik [Tue, 23 Jun 2015 11:05:01 +0000 (13:05 +0200)]
vircapstest: Properly report error for failed tests

There are two macros used in the test: CAPSCOMP and CAPS_EXPECT_ERR.
Both run a test case and if a failure occurred, they set the @ret
variable to a value of -1 to indicate an error. Well, that's what they
should do. Due to a typo, they set the variable to a positive one
effectively masking any failed test.

Then, we have couple of tests failing. Fix them too.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agoconf: Adjust invalid secrettype setting during parse
John Ferlan [Mon, 15 Jun 2015 14:40:27 +0000 (10:40 -0400)]
conf: Adjust invalid secrettype setting during parse

Commit id '1feaccf0' attempted to handle an empty secrettype value; however,
it made a mistake by processing the secretType as if it was the original
secrettype string.  The 'secretType' is actually whether 'usage' or 'uuid'
was used.

Thus adjust part of the change to make the same check for def->src->type !=
VIR_STORAGE_TYPE_VOLUME before setting auth_secret_usage from the
secrettype field.

Luckily the aforementioned commits misdeed would be overwritten by the
call to virStorageTranslateDiskSourcePool

9 years agoconf: improve the way we format blkiotune and cputune
Luyao Huang [Tue, 23 Jun 2015 13:24:25 +0000 (21:24 +0800)]
conf: improve the way we format blkiotune and cputune

Just refactor existing code to use a child buf instead of
check all element before format <blkiotune> and <cputune>.
This will avoid the more and more bigger element check during
we introduce new elements in <blkiotune> and <cputune> in the
future.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agodocs: Fix trivial copy-paste error
Martin Kletzander [Wed, 24 Jun 2015 08:16:56 +0000 (10:16 +0200)]
docs: Fix trivial copy-paste error

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
9 years agoImprove some errors for openconsole/channel
Luyao Huang [Mon, 15 Jun 2015 13:58:36 +0000 (21:58 +0800)]
Improve some errors for openconsole/channel

Functions like virDomainOpenConsole() and virDomainOpenChannel() accept
NULL as a dev_name parameter.  Try using alias for the error message if
dev_name is not specified.

Before:
  error: internal error: character device <null> is not using a PTY

After:
  error: internal error: character device serial0 is not using a PTY

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agoconf: Enforce scheduler name when parsing XML
Peter Krempa [Tue, 23 Jun 2015 12:25:20 +0000 (14:25 +0200)]
conf: Enforce scheduler name when parsing XML

We require the scheduler name attribute in the schemas but the code
would actually be fine when it was omitted. Make it mandatory.

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

9 years agodocs: Properly mark acl.html dependencies
Michal Privoznik [Mon, 22 Jun 2015 15:17:38 +0000 (17:17 +0200)]
docs: Properly mark acl.html dependencies

The acl.html file includes aclperms.htmlinc which is generated.
However, acl.html is generated too from acl.html.tmp. And in fact,
this is the place where the aclperms file is needed. Fix the
dependency in Makefile.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agostorage: Force setting of disk format type
John Ferlan [Mon, 8 Jun 2015 12:16:58 +0000 (08:16 -0400)]
storage: Force setting of disk format type

Commit id '832a9256' adjusted the code to recognize when the default
type of "unknown" was provided as the format type and to use "dos" if
found. Since the pool is built with "dos" and it could cause some
confusion when formatting the XML after building by seeing "unknown"
in the output, let's just adjust the pool's setting to "dos" so that
subsequent formats will see the value.

9 years agodocs: Adjust Disk storage rng
John Ferlan [Mon, 8 Jun 2015 12:15:17 +0000 (08:15 -0400)]
docs: Adjust Disk storage rng

Currently the grammar uses "none" for a "valid" Disk Storage Pool
format type; however, virStoragePoolFormatDisk uses "unknown" so
virt-xml-validate will fail to validate when "unknown" is found

9 years agoadmin: Fix mingw build by reordering includes
Martin Kletzander [Tue, 23 Jun 2015 11:22:15 +0000 (13:22 +0200)]
admin: Fix mingw build by reordering includes

By trying to lead the way of clean includes, I sorted the lines
alphabetically and that is a problem for mingw builds with gnulib.
As 'configmake.h' defines DATADIR and 'datatypes.h' transitively
includes 'winsock.h' that uses 'DATADIR' as a name for a struct,
it's enough to reorder those.

Even though this might be worked around in gnulib later on, this
fixes the build for now.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
9 years agodocs: Correct typos in scsi hostdev and address elements
Eric Farman [Wed, 17 Jun 2015 03:29:55 +0000 (23:29 -0400)]
docs: Correct typos in scsi hostdev and address elements

The type='scsi' parameter of an address element is ignored
if placed within a hostdev section, and rejected by the XML
schema used by virt-xml-validate. Remove it from the doc,
and correct a typo in the remaining address arguments.

Signed-off-by: Eric Farman <farman@linux.vnet.ibm.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.vnet.ibm.com>
Reviewed-by: Stefan Zimmermann <stzi@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
9 years agodocs: Fix XML schema handling of LUN address in hostdev tag
Eric Farman [Wed, 17 Jun 2015 03:29:54 +0000 (23:29 -0400)]
docs: Fix XML schema handling of LUN address in hostdev tag

Defining a domain with a SCSI disk attached via a hostdev
tag and a source address unit value longer than two digits
causes an error when editing the domain with virsh edit,
even if no changes are made to the domain definition.
The error suggests invalid XML, somewhere:

  # virsh edit lmb_guest
  error: XML document failed to validate against schema:
  Unable to validate doc against /usr/local/share/libvirt/schemas/domain.rng
  Extra element devices in interleave
  Element domain failed to validate content

The virt-xml-validate tool fails with a similar error:

  # virt-xml-validate lmb_guest.xml
  Relax-NG validity error : Extra element devices in interleave
  lmb_guest.xml:17: element devices: Relax-NG validity error :
  Element domain failed to validate content
  lmb_guest.xml fails to validate

The hostdev tag requires a source address to be specified,
which includes bus, target, and unit address attributes.
According to the SCSI Architecture Model spec (section
4.9 of SAM-2), a LUN address is 64 bits and thus could be
up to 20 decimal digits long.  Unfortunately, the XML
schema limits this string to just two digits.  Similarly,
the target field can be up to 32 bits in length, which
would be 10 decimal digits.

  # lsscsi -xx
  [0:0:19:0x4022401100000000]  disk    IBM      2107900          3.44 /dev/sda
  # lsscsi
  [0:0:19:1074872354]disk    IBM      2107900          3.44  /dev/sda
  # cat lmb_guest.xml
  <domain type='kvm'>
    <name>lmb_guest</name>
    <memory unit='MiB'>1024</memory>
  ...trimmed...
    <devices>
      <controller type='scsi' model='virtio-scsi' index='0'/>
      <hostdev mode='subsystem' type='scsi'>
        <source>
          <adapter name='scsi_host0'/>
          <address bus='0' target='19' unit='1074872354'/>
        </source>
      </hostdev>
  ...trimmed...

Since the reference unit and target fields are used in
several places in the XML schema, create a separate one
specific for SCSI Logical Units that will permit the
greater length.  This permits both the validation utility
and the virsh edit command to succeed when a hostdev
tag is included.

Signed-off-by: Eric Farman <farman@linux.vnet.ibm.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.vnet.ibm.com>
Reviewed-by: Stefan Zimmermann <stzi@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
9 years agoConvert SCSI logical unit from unsigned int to unsigned long long
Eric Farman [Wed, 17 Jun 2015 03:29:53 +0000 (23:29 -0400)]
Convert SCSI logical unit from unsigned int to unsigned long long

The SCSI Architecture Model defines a logical unit address
as 64-bits in length, so change the field accordingly so
that the entire value could be stored.

Signed-off-by: Eric Farman <farman@linux.vnet.ibm.com>
9 years agoPrint SCSI address attributes bus, target, unit as unsigned integer
Eric Farman [Wed, 17 Jun 2015 03:29:52 +0000 (23:29 -0400)]
Print SCSI address attributes bus, target, unit as unsigned integer

The address elements are all unsigned integers, so we should
use the appropriate print directive when printing it.

Signed-off-by: Eric Farman <farman@linux.vnet.ibm.com>
9 years agoRead SCSI address attributes bus, target, unit as positive integer
Eric Farman [Wed, 17 Jun 2015 03:29:51 +0000 (23:29 -0400)]
Read SCSI address attributes bus, target, unit as positive integer

The SCSI address element attributes bus, target, and unit are expected
to be positive values, so make sure no one provides a negative value since
the value is stored as an unsigned.

Signed-off-by: Eric Farman <farman@linux.vnet.ibm.com>
9 years agoqemu: simplify json parsing
Eric Blake [Sat, 20 Jun 2015 19:40:21 +0000 (13:40 -0600)]
qemu: simplify json parsing

Rather than grabbing an arbitrary JSON value and then checking
if it has the right type, we might as well request the correct
type to begin with.

* src/qemu/qemu_monitor_json.c (qemuMonitorJSONIOProcessEvent)
(qemuMonitorJSONCommandWithFd, qemuMonitorJSONHandleGraphics)
(qemuMonitorJSONGetStatus, qemuMonitorJSONExtractCPUInfo)
(qemuMonitorJSONGetVirtType, qemuMonitorJSONGetBalloonInfo)
(qemuMonitorJSONGetMemoryStats)
(qemuMonitorJSONDevGetBlockExtent)
(qemuMonitorJSONGetOneBlockStatsInfo)
(qemuMonitorJSONGetAllBlockStatsInfo)
(qemuMonitorJSONBlockStatsUpdateCapacityOne)
(qemuMonitorJSONBlockStatsUpdateCapacity)
(qemuMonitorJSONGetBlockExtent)
(qemuMonitorJSONGetMigrationStatusReply)
(qemuMonitorJSONGetDumpGuestMemoryCapability)
(qemuMonitorJSONAddFd, qemuMonitorJSONQueryRxFilterParse)
(qemuMonitorJSONExtractChardevInfo)
(qemuMonitorJSONDiskNameLookupOne)
(qemuMonitorJSONDiskNameLookup)
(qemuMonitorJSONGetAllBlockJobInfo)
(qemuMonitorJSONBlockIoThrottleInfo, qemuMonitorJSONGetVersion)
(qemuMonitorJSONGetMachines, qemuMonitorJSONGetCPUDefinitions)
(qemuMonitorJSONGetCommands, qemuMonitorJSONGetEvents)
(qemuMonitorJSONGetKVMState, qemuMonitorJSONGetObjectTypes)
(qemuMonitorJSONGetObjectListPaths)
(qemuMonitorJSONGetObjectProps, qemuMonitorJSONGetTargetArch)
(qemuMonitorJSONGetMigrationCapabilities)
(qemuMonitorJSONGetStringArray, qemuMonitorJSONAttachCharDev)
(qemuMonitorJSONGetCPUx86Data, qemuMonitorJSONGetIOThreads)
(qemuMonitorJSONGetMemoryDeviceInfo): Use shorter idioms.

Signed-off-by: Eric Blake <eblake@redhat.com>
9 years agojson: make it easier to type-check when getting from object
Eric Blake [Fri, 19 Jun 2015 23:13:03 +0000 (17:13 -0600)]
json: make it easier to type-check when getting from object

While working in qemu_monitor_json, I repeatedly found myself
getting a value then checking if it was an object.  Add some
wrappers to make this task easier.

* src/util/virjson.c (virJSONValueObjectGetByType)
(virJSONValueObjectGetObject, virJSONValueObjectGetArray): New
functions.
(virJSONValueObjectGetString, virJSONValueObjectGetNumberInt)
(virJSONValueObjectGetNumberUint)
(virJSONValueObjectGetNumberLong)
(virJSONValueObjectGetNumberUlong)
(virJSONValueObjectGetNumberDouble)
(virJSONValueObjectGetBoolean): Simplify.
(virJSONValueIsNull): Change return type.
* src/util/virjson.h: Reflect changes.
* src/libvirt_private.syms (virjson.h): Export them.
* tests/jsontest.c (testJSONLookup): New test.

Signed-off-by: Eric Blake <eblake@redhat.com>
9 years agojson: fully parse input string
Eric Blake [Fri, 19 Jun 2015 23:28:22 +0000 (17:28 -0600)]
json: fully parse input string

I was adding a JSON test, and was shocked to find out our parser
treated the input string of "1" as invalid JSON.  It turns out
that YAJL specifically documents that it buffers input, and that
if the last input read could be a prefix to a longer token, then
you have to explicitly tell the parser that the buffer has ended
before that token will be processed.

It doesn't help that yajl 2 renamed the function from what it was
in yajl 1.

* src/util/virjson.c (virJSONValueFromString): Complete parse, in
case buffer ends in possible token prefix.
* tests/jsontest.c (mymain): Expose the problem.

Signed-off-by: Eric Blake <eblake@redhat.com>
9 years agotest: Switch to reference counting with testDomObjFromDomain
Peter Krempa [Tue, 16 Jun 2015 12:05:18 +0000 (14:05 +0200)]
test: Switch to reference counting with testDomObjFromDomain

Retrieve domain objects with reference and release them with
virDomainObjEndAPI.

9 years agotest: Reuse virDomainObjGetOneDef in testDomainGetVcpusFlags
Peter Krempa [Tue, 16 Jun 2015 08:10:59 +0000 (10:10 +0200)]
test: Reuse virDomainObjGetOneDef in testDomainGetVcpusFlags

The test driver copies the domain definition correctly so we can reuse
the helper.

9 years agovirsh: blockcopy: Report error if the copy job fails
Peter Krempa [Fri, 19 Jun 2015 13:43:02 +0000 (15:43 +0200)]
virsh: blockcopy: Report error if the copy job fails

When the block job would fail while watching it using the "--wait"
option for blockcopy, virsh would rather unhelpfully report:

$ virsh blockcopy vm hdc /tmp/raw.img --granularity 4096 --verbose --wait

Now in mirroring phase

Add a special case when the block job vanishes while waiting for it to
finish to improve the message:

$ virsh blockcopy vm hdc /tmp/raw.img --granularity 8192 --verbose --wait
error: Block Copy unexpectedly failed

9 years agovirQEMUCapsComputeCmdFlags: Indent correctly
Michal Privoznik [Mon, 22 Jun 2015 08:54:56 +0000 (10:54 +0200)]
virQEMUCapsComputeCmdFlags: Indent correctly

There's a small formatting problem in the function. One line is
not correctly indented. Fix this.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agoqemu: caps: Fix syntax-check failure in version based capabilities
Peter Krempa [Mon, 22 Jun 2015 08:48:30 +0000 (10:48 +0200)]
qemu: caps: Fix syntax-check failure in version based capabilities

A single-line 'if' body should not be encased in curly braces. Our
syntax-check enforces it. Introduced in 7f3515b4bb677d0ead1887547efc844

9 years agoIntroduce QEMU_CAPS_ARM_VIRT_PCI
Pavel Fedin [Thu, 11 Jun 2015 06:40:53 +0000 (09:40 +0300)]
Introduce QEMU_CAPS_ARM_VIRT_PCI

This capability specifies that "virt" machine on ARM has PCI controller. Enabled when version is at least 2.3.0.

Signed-off-by: Pavel Fedin <p.fedin@samsung.com>
9 years agolibxl: avoid freeing an uninitialised bitmap
Ian Campbell [Fri, 19 Jun 2015 16:33:30 +0000 (17:33 +0100)]
libxl: avoid freeing an uninitialised bitmap

If vm->def->cputune.nvcpupin is 0 in libxlDomainSetVcpuAffinities (as
seems to be the case on arm) then the VIR_FREE after cleanup: would be
operating on an uninitialised pointer in map.map.

Fix this by using libxl_bitmap_init and libxl_bitmap_dispose in the
appropriate places (like VIR_FREE, libxl_bitmap_dispose is also
idempotent, so there is no double free on exit from the loop).

libxl_bitmap_dispose is slightly preferable since it also sets
map.size back to 0, avoiding a potential source of confusion.

This fixes the crashes we've been seeing in the Xen automated tests on
ARM.

I had a glance at the handful of other users of libxl_bitmap and none
of them looked to have a similar issue.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
9 years agoupdate sheepdog client] update sheepdog client path
Vasiliy Tolstov [Thu, 18 Jun 2015 13:20:42 +0000 (16:20 +0300)]
update sheepdog client] update sheepdog client path

Nnever sheepdog versions have dog client binary
while old have collie. Check them both.

Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
9 years agoqemu: cancel drive mirrors when p2p connection breaks
Jiri Denemark [Mon, 1 Jun 2015 12:41:50 +0000 (14:41 +0200)]
qemu: cancel drive mirrors when p2p connection breaks

When a connection to the destination host during a p2p migration drops,
we know we will have to cancel the migration; it doesn't make sense to
waste resources by trying to finish the migration. We already do so
after sending "migrate" command to QEMU and we should do it while
waiting for drive mirrors to become ready too.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoqemu: Refactor qemuMigrationWaitForCompletion
Jiri Denemark [Thu, 28 May 2015 09:58:11 +0000 (11:58 +0200)]
qemu: Refactor qemuMigrationWaitForCompletion

Checking status of all part of migration and aborting it when something
failed is a complex thing which makes the waiting loop hard to read.
This patch moves all the checks into a separate function similarly to
what was done for drive mirror loops.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoqemu: Don't pass redundant job name around
Jiri Denemark [Thu, 28 May 2015 09:17:17 +0000 (11:17 +0200)]
qemu: Don't pass redundant job name around

Instead of passing current job name to several functions which already
know what the current job is we can generate the name where we actually
need to use it.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoqemu: Refactor qemuMigrationUpdateJobStatus
Jiri Denemark [Tue, 26 May 2015 12:37:30 +0000 (14:37 +0200)]
qemu: Refactor qemuMigrationUpdateJobStatus

Once we start waiting for migration events instead of polling
query-migrate, priv->job.current will not be regularly updated anymore
because we will get the current status directly from the events. Thus
virDomainGetJob{Info,Stats} will have to query QEMU, but they can't just
blindly update priv->job.current structure. This patch introduces
qemuMigrationFetchJobStatus which just fills in a caller supplied
structure and makes qemuMigrationUpdateJobStatus a tiny wrapper around
it.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoqemu: Refactor qemuDomainGetJob{Info,Stats}
Jiri Denemark [Tue, 26 May 2015 11:24:44 +0000 (13:24 +0200)]
qemu: Refactor qemuDomainGetJob{Info,Stats}

Move common parts of qemuDomainGetJobInfo and qemuDomainGetJobStats into
a separate API (qemuDomainGetJobStatsInternal).

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoqemu: Do not poll for spice migration status
Jiri Denemark [Mon, 25 May 2015 14:57:49 +0000 (16:57 +0200)]
qemu: Do not poll for spice migration status

QEMU_CAPS_SEAMLESS_MIGRATION capability says QEMU supports
SPICE_MIGRATE_COMPLETED event. Thus we can just drop all code which
polls query-spice and replace it with waiting for the event.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoqemu_monitor: Wire up SPICE_MIGRATE_COMPLETED event
Jiri Denemark [Thu, 28 May 2015 11:35:06 +0000 (13:35 +0200)]
qemu_monitor: Wire up SPICE_MIGRATE_COMPLETED event

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoqemu: Use domain condition for asyncAbort
Jiri Denemark [Fri, 15 May 2015 13:59:49 +0000 (15:59 +0200)]
qemu: Use domain condition for asyncAbort

To avoid polling for asyncAbort flag changes.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoqemu: Cancel disk mirrors after libvirtd restart
Jiri Denemark [Tue, 19 May 2015 15:28:25 +0000 (17:28 +0200)]
qemu: Cancel disk mirrors after libvirtd restart

When libvirtd is restarted during migration, we properly cancel the
ongoing migration (unless it managed to almost finished before the
restart). But if we were also migrating storage using NBD, we would
completely forget about the running disk mirrors.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoqemu: Refactor qemuMonitorBlockJobInfo
Jiri Denemark [Fri, 22 May 2015 11:33:49 +0000 (13:33 +0200)]
qemu: Refactor qemuMonitorBlockJobInfo

"query-block-jobs" QMP command returns all running block jobs at once,
while qemuMonitorBlockJobInfo would only report one. This is not very
nice in case we need to check several block jobs. This patch refactors
the monitor code to always parse all block jobs and store them in a
hash.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoqemu: Make qemuMigrationCancelDriveMirror usable without async job
Jiri Denemark [Wed, 20 May 2015 08:28:37 +0000 (10:28 +0200)]
qemu: Make qemuMigrationCancelDriveMirror usable without async job

We don't have an async job when reconnecting to existing domains after
libvirtd restart.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoPass domain object to private data formatter/parser
Jiri Denemark [Tue, 19 May 2015 08:14:19 +0000 (10:14 +0200)]
Pass domain object to private data formatter/parser

So that they can format private data (e.g., disk private data) stored
elsewhere in the domain object.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoqemu: Don't mess with disk->mirrorState
Jiri Denemark [Tue, 19 May 2015 06:44:16 +0000 (08:44 +0200)]
qemu: Don't mess with disk->mirrorState

This patch reverts commit 76c61cdca20c106960af033e5d0f5da70177af0f.

VIR_DOMAIN_DISK_MIRROR_STATE_ABORT says we asked for a block job to be
aborted rather than saying it was aborted. Let's just use
VIR_DOMAIN_DISK_MIRROR_STATE_NONE consistently whenever a block job
finishes since no caller depends on VIR_DOMAIN_DISK_MIRROR_STATE_ABORT
(anymore) to check whether a block job failed or it was cancelled.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoqemu: Abort migration early if disk mirror failed
Jiri Denemark [Wed, 10 Jun 2015 09:00:00 +0000 (11:00 +0200)]
qemu: Abort migration early if disk mirror failed

Abort migration as soon as we detect that some of the disk mirrors
failed. There's no sense in trying to finish memory migration first.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoqemu: Cancel storage migration in parallel
Jiri Denemark [Tue, 9 Jun 2015 21:50:36 +0000 (23:50 +0200)]
qemu: Cancel storage migration in parallel

Instead of cancelling disk mirrors sequentially, let's just call
block-job-cancel for all migrating disks and then wait until all
disappear.

In case we cancel disk mirrors at the end of successful migration we
also need to check all block jobs completed successfully. Otherwise we
have to abort the migration.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoqemu: Use domain condition for synchronous block jobs
Jiri Denemark [Thu, 14 May 2015 12:28:12 +0000 (14:28 +0200)]
qemu: Use domain condition for synchronous block jobs

By switching block jobs to use domain conditions, we can drop some
pretty complicated code in NBD storage migration.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoqemu: Properly report failed migration
Jiri Denemark [Wed, 13 May 2015 16:08:50 +0000 (18:08 +0200)]
qemu: Properly report failed migration

Because we are polling we may detect some errors after we asked QEMU for
migration status even though they occurred before. If this happens and
QEMU reports migration completed successfully, we would happily report
the migration succeeded even though we should have cancelled it because
of the other error.

In practise it is not a big issue now but it will become a much bigger
issue once the check for storage migration status is moved inside the
loop in qemuMigrationWaitForCompletion.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoqemu: Introduce qemuBlockJobUpdate
Jiri Denemark [Mon, 11 May 2015 12:50:48 +0000 (14:50 +0200)]
qemu: Introduce qemuBlockJobUpdate

The wrapper is useful for calling qemuBlockJobEventProcess with the
event details stored in disk's privateData, which is the most likely
usage of qemuBlockJobEventProcess.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoconf: Introduce per-domain condition variable
Jiri Denemark [Tue, 26 May 2015 14:43:58 +0000 (16:43 +0200)]
conf: Introduce per-domain condition variable

Complex jobs, such as migration, need to monitor several events at once,
which is impossible when each of the event uses its own condition
variable. This patch adds a single condition variable to each domain
object. This variable can be used instead of the other event specific
conditions.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agovirNetServerServiceClose: Don't leak sockets
Michal Privoznik [Thu, 18 Jun 2015 12:37:43 +0000 (14:37 +0200)]
virNetServerServiceClose: Don't leak sockets

Well, if a server is being destructed, all underlying services and
their sockets should disappear with it. But due to bug in our
implementation this is not the case. Yes, we are closing the sockets,
but that's not enough. We must also:

1) Unregister them from the event loop
2) Unref the service for each socket

The last step is needed, because each socket callback holds a
reference to the service object. Since in the first step we are
unregistering the callbacks, they no longer need the reference.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agovirNetSocket: Fix @watch corner case
Michal Privoznik [Thu, 18 Jun 2015 12:22:10 +0000 (14:22 +0200)]
virNetSocket: Fix @watch corner case

Although highly unlikely, nobody says that virEventAddHandle()
can't return 0 as a handle to socket callback. It can't happen
with our default implementation since all watches will have value
1 or greater, but users can register their own callback functions
(which can re-use unused watch IDs for instance). If this is the
case, weird things may happen.

Also, there's a little bug I'm fixing too, upon
virNetSocketRemoveIOCallback(), the variable holding callback ID
was not reset. Therefore calling AddIOCallback() once again would
fail. Not that we are doing it right now, but we might.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agovirNetSocketRemoveIOCallback: Be explicit about unref
Michal Privoznik [Thu, 18 Jun 2015 12:15:08 +0000 (14:15 +0200)]
virNetSocketRemoveIOCallback: Be explicit about unref

When going through the code I've notice that
virNetSocketAddIOCallback() increases the reference counter of
@socket. However, its counter part RemoveIOCallback does not. It took
me a while to realize this disproportion. The AddIOCallback registers
our own callback which eventually calls the desired callback and then
unref the @sock. Yeah, a bit complicated but it works. So, lets note
this hard learned fact in a comment in RemoveIOCallback().

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agodaemonSetupNetworking: Don't leak services
Michal Privoznik [Thu, 18 Jun 2015 12:11:21 +0000 (14:11 +0200)]
daemonSetupNetworking: Don't leak services

When setting up the daemon networking, new services are created. These
services then have sockets to listen on. Once created, the service
objects are added to corresponding server object. However, during that
process, server increases reference counter of the service object. So,
at the end of the function, we should decrease it again. This way the
service objects will have only 1 reference, but that's okay since
servers are the only objects having a reference.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agolib: setvcpus: Remove bogus flag check
Peter Krempa [Tue, 16 Jun 2015 16:55:24 +0000 (18:55 +0200)]
lib: setvcpus: Remove bogus flag check

Since VIR_DOMAIN_AFFECT_CURRENT is 0 the flag check does not make sense
as masking @flags with 0 will always equal to false.

9 years agoscsi: Adjust return status from getBlockDevice
John Ferlan [Fri, 12 Jun 2015 11:22:34 +0000 (07:22 -0400)]
scsi: Adjust return status from getBlockDevice

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

Currently it's not possible to determine the difference between a
fatal memory allocation or failure to open/read the directory error
with a perhaps less fatal, I didn't find the "block" device in the
directory (which may be a disk entry without a block device).

In the case of the latter, we shouldn't cause failure to continue
searching in the caller (virStorageBackendSCSIFindLUs), rather we
should allow trying reading the next directory entry.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agovirsh: selective block device migration
Pavel Boldin [Mon, 15 Jun 2015 22:42:11 +0000 (01:42 +0300)]
virsh: selective block device migration

Add `virsh migrate' option `--migrate-disks' that allows CLI user to
explicitly specify block devices to migrate.

Signed-off-by: Pavel Boldin <pboldin@mirantis.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agoqemu: migration: selective block device migration
Pavel Boldin [Mon, 15 Jun 2015 22:42:10 +0000 (01:42 +0300)]
qemu: migration: selective block device migration

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

Implement a `migrate_disks' parameters for the QEMU driver. This multi-
value parameter can be used to explicitly specify what block devices
are to be migrated using the NBD server. Tunnelled migration using NBD
is to be done.

Signed-off-by: Pavel Boldin <pboldin@mirantis.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agoutil: add virTypedParamsAddStringList
Pavel Boldin [Mon, 15 Jun 2015 22:42:09 +0000 (01:42 +0300)]
util: add virTypedParamsAddStringList

The `virTypedParamsAddStringList' function provides interface to add a
NULL-terminated array of string values as a multi-value to the params.

Signed-off-by: Pavel Boldin <pboldin@mirantis.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agoutil: virTypedParams{Filter,GetStringList}
Pavel Boldin [Mon, 15 Jun 2015 22:42:08 +0000 (01:42 +0300)]
util: virTypedParams{Filter,GetStringList}

Add multikey API:

 * virTypedParamsFilter that filters all the parameters with specified name.
 * virTypedParamsGetStringList that returns a list with all the values for
   specified name and string type.

Signed-off-by: Pavel Boldin <pboldin@mirantis.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agoutil: multi-value parameters in virTypedParamsAdd*
Pavel Boldin [Mon, 15 Jun 2015 22:42:07 +0000 (01:42 +0300)]
util: multi-value parameters in virTypedParamsAdd*

Allow multi-value parameters to be build using virTypedParamsAdd*
functions by removing check for duplicates.

Signed-off-by: Pavel Boldin <pboldin@mirantis.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agoutil: multi-value virTypedParameter
Pavel Boldin [Mon, 15 Jun 2015 22:42:06 +0000 (01:42 +0300)]
util: multi-value virTypedParameter

The `virTypedParamsValidate' function now can be instructed to allow
multiple entries for some of the keys. For this flag the type with
the `VIR_TYPED_PARAM_MULTIPLE' flag.

Add unit tests for this new behaviour.

Signed-off-by: Pavel Boldin <pboldin@mirantis.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agoqemuMigrationDriveMirror: Force raw format for NBD
Michal Privoznik [Mon, 15 Jun 2015 22:42:05 +0000 (01:42 +0300)]
qemuMigrationDriveMirror: Force raw format for NBD

When playing with disk migration lately, I've noticed this warning in
domain logs:

WARNING: Image format was not specified for 'nbd://masina:49153/drive-virtio-disk0' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.

So I started digging into qemu source code to see what has triggered
the warning. I'd expect qemu to know formats of guest's disks since we
tell them on command line. This lead me to qmp_drive_mirror() where
the following can be found:

    if (!has_format) {
        format = mode == NEW_IMAGE_MODE_EXISTING ? NULL : bs->drv->format_name;
    }

So, format is automatically initialized from the disk iff mode !=
"existing". Unfortunately, in migration we are tied to use this mode
(NBD doesn't support creating new images). Therefore the only way to
avoid this warning is to pass format. The discussion on the mail-list [1]
resulted in the code that always forces NBD export as "raw" format.

[1] https://www.redhat.com/archives/libvir-list/2015-June/msg00153.html
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Pavel Boldin <pboldin@mirantis.com>
9 years agoqemuMigrationBeginPhase: Fix function header indentation
Michal Privoznik [Mon, 15 Jun 2015 22:42:04 +0000 (01:42 +0300)]
qemuMigrationBeginPhase: Fix function header indentation

This function is returning a string (domain XML). Since d3ce7363
when it was first introduced, it was indented incorrectly:

static char
*qemuMigrationBeginPhase(..)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agovirDomainDiskGetSource: Mark passed disk as 'const'
Michal Privoznik [Mon, 15 Jun 2015 22:42:03 +0000 (01:42 +0300)]
virDomainDiskGetSource: Mark passed disk as 'const'

The disk is not changed anywhere in the function. Mark this fact
in the function header too.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agoqemu: Fix double space in error message in qemuDomainGetVcpusFlags
Peter Krempa [Thu, 18 Jun 2015 13:31:52 +0000 (15:31 +0200)]
qemu: Fix double space in error message in qemuDomainGetVcpusFlags

9 years agoqemu: Jump to correct label in qemuDomainPinIOThread
Peter Krempa [Thu, 18 Jun 2015 13:29:20 +0000 (15:29 +0200)]
qemu: Jump to correct label in qemuDomainPinIOThread

If virDomainObjGetDefs used in qemuDomainPinIOThread would fail the code
would jump to the 'cleanup' label after acquiring the job, thus the VM
would be locked forever.

Introduced in commit cac6d639.

9 years agoconf: Move vcpu info parsing code into a separate function
Peter Krempa [Mon, 8 Jun 2015 14:58:46 +0000 (16:58 +0200)]
conf: Move vcpu info parsing code into a separate function

9 years agoqemu: 'privileged' flag is not really configuration
Peter Krempa [Mon, 15 Jun 2015 18:59:58 +0000 (20:59 +0200)]
qemu: 'privileged' flag is not really configuration

The privileged flag will not change while the configuration might
change. Make the 'privileged' flag member of the driver again and mark
it immutable. Should that ever change add an accessor that will group
reads of the state.

9 years agoqemu: Reuse virDomainObjGetDefs in qemuDomainGetMemoryParameters
Peter Krempa [Mon, 15 Jun 2015 18:48:44 +0000 (20:48 +0200)]
qemu: Reuse virDomainObjGetDefs in qemuDomainGetMemoryParameters

Simplify the code by restructuring control flow and reusing the better
helper.

9 years agoqemu: Refactor qemuDomainGetMemoryParameters
Peter Krempa [Mon, 15 Jun 2015 18:27:17 +0000 (20:27 +0200)]
qemu: Refactor qemuDomainGetMemoryParameters

Replace the for loops with case inside with temp variables and a macro.

9 years agoqemu: Refactor qemuDomainSetNumaParameters
Peter Krempa [Mon, 15 Jun 2015 18:06:30 +0000 (20:06 +0200)]
qemu: Refactor qemuDomainSetNumaParameters

Use virDomainObjGetDefs and sanitize the control flow.

9 years agoqemu: Simplify qemuDomainSetInterfaceParameters by using virDomainObjGetDefs
Peter Krempa [Mon, 15 Jun 2015 17:46:28 +0000 (19:46 +0200)]
qemu: Simplify qemuDomainSetInterfaceParameters by using virDomainObjGetDefs

9 years agoqemu: Simplify qemuDomainGetVcpusFlags by using virDomainObjGetOneDef
Peter Krempa [Mon, 15 Jun 2015 17:10:49 +0000 (19:10 +0200)]
qemu: Simplify qemuDomainGetVcpusFlags by using virDomainObjGetOneDef

virDomainObjGetOneDef is simpler to use than virDomainObjGetDefs

9 years agoqemu: Simplify qemuDomainGetEmulatorPinInfo by using virDomainObjGetOneDef
Peter Krempa [Mon, 15 Jun 2015 17:10:49 +0000 (19:10 +0200)]
qemu: Simplify qemuDomainGetEmulatorPinInfo by using virDomainObjGetOneDef

virDomainObjGetOneDef is simpler to use than virDomainObjGetDefs

9 years agoqemu: Simplify qemuDomainGetVcpuPinInfo by using virDomainObjGetOneDef
Peter Krempa [Mon, 15 Jun 2015 17:10:49 +0000 (19:10 +0200)]
qemu: Simplify qemuDomainGetVcpuPinInfo by using virDomainObjGetOneDef

virDomainObjGetOneDef is simpler to use than virDomainObjGetDefs

9 years agoqemu: Simplify qemuDomainGetNumaParameters by using virDomainObjGetOneDef
Peter Krempa [Mon, 15 Jun 2015 17:10:49 +0000 (19:10 +0200)]
qemu: Simplify qemuDomainGetNumaParameters by using virDomainObjGetOneDef

9 years agoqemu: Simplify qemuDomainGetInterfaceParameters by using virDomainObjGetOneDef
Peter Krempa [Mon, 15 Jun 2015 17:10:49 +0000 (19:10 +0200)]
qemu: Simplify qemuDomainGetInterfaceParameters by using virDomainObjGetOneDef

9 years agoconf: Introduce helper to help getting correct def for getter functions
Peter Krempa [Mon, 15 Jun 2015 17:04:41 +0000 (19:04 +0200)]
conf: Introduce helper to help getting correct def for getter functions

virDomainObjGetOneDef will help to retrieve the correct definition
pointer from @vm in cases where VIR_DOMAIN_AFFECT_LIVE and
VIR_DOMAIN_AFFECT_CONFIG are mutually exclusive. The function simply
returns the correct pointer. This similarly to virDomainObjGetDefs will
greatly simplify the code.

9 years agoconf: Fix virDomainObjGetDefs when getting persistent config on a live vm
Peter Krempa [Fri, 12 Jun 2015 12:37:18 +0000 (14:37 +0200)]
conf: Fix virDomainObjGetDefs when getting persistent config on a live vm

If @flags contains only VIR_DOMAIN_AFFECT_CONFIG and @vm is active, the
function would return the active config rather than the persistent one
that it should return. This happened due to the fact that
virDomainObjGetDefs was checking the updated flags which may not contain
VIR_DOMAIN_AFFECT_LIVE if it is not requested even if @vm is active.

Additionally the function would not take the flags into account when
setting the pointers which was later used to determine whether the code
needs to update the given configuration.

The mistake was caught by the virt-test suite.

9 years agoqemu: implement address for isa-serial
James Cowgill [Tue, 16 Jun 2015 13:07:59 +0000 (14:07 +0100)]
qemu: implement address for isa-serial

I needed to specify the iobase address for certain exotic mips configurations.

Signed-off-by: James Cowgill <james410@cowgill.org.uk>
9 years agoqemu: Add a check for slot and base dimm address conflicts
Luyao Huang [Mon, 15 Jun 2015 12:33:49 +0000 (20:33 +0800)]
qemu: Add a check for slot and base dimm address conflicts

When hotplugging a memory device, there wasn't a check to determine
if there is a conflict with the address space being used by the to
be added memory device and any existing device which is disallowed by qemu.

This patch adds a check to ensure the new device address doesn't
conflict with any existing device.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agodaemon: Add the admin service to the admin server only if it was allocated
Peter Krempa [Thu, 18 Jun 2015 09:40:08 +0000 (11:40 +0200)]
daemon: Add the admin service to the admin server only if it was allocated

If the admin service is disabled it would not be allocated, but the NULL
pointer still would be added to the admin server. Since
virNetServerAddService would dereference it, the daemon would crash.

Move the service registration into the block that allocates it.

9 years agorpc: Actually increase reference count on @srv in virNetDaemonAddServer
Peter Krempa [Thu, 18 Jun 2015 09:37:17 +0000 (11:37 +0200)]
rpc: Actually increase reference count on @srv in virNetDaemonAddServer

VIR_APPEND_ELEMENT would clear @srv to NULL after it successfully
inserted it thus the reference count could not be increased afterwards.

Switch to VIR_APPEND_ELEMENT_COPY. This fixes crash after terminating
the daemon.

9 years agoparallels: Fix false error messages in libvirt log
Mikhail Feoktistov [Wed, 17 Jun 2015 12:35:00 +0000 (15:35 +0300)]
parallels: Fix false error messages in libvirt log

There was many errors in libvirt.log caused by prlsdkDelNet function because
job variable was always initialized as PRL_INVALID_HANDLE
In this patch job variable gets return value of PrlSrv_DeleteVirtualNetwork function()

9 years agoparallels: Fix initialization of buflen variable in each loop iteration
Mikhail Feoktistov [Wed, 17 Jun 2015 12:35:00 +0000 (15:35 +0300)]
parallels: Fix initialization of buflen variable in each loop iteration

We need to initialize buflen every time when we get network adapter's
friendly name because we call PrlVmDev_GetFriendlyName in a loop

9 years agoremove redundant condition
Ján Tomko [Wed, 17 Jun 2015 15:57:56 +0000 (17:57 +0200)]
remove redundant condition

If the address type is SPAPRVIO, it will match the != NONE condition.

9 years agovirSysinfo: Introduce SMBIOS type 2 support
Michal Privoznik [Tue, 12 May 2015 14:47:49 +0000 (16:47 +0200)]
virSysinfo: Introduce SMBIOS type 2 support

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

This type of information defines attributes of a system
baseboard. With one exception: board type is yet not implemented
in qemu so it's not introduced here either.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agoqemu: Report all supported machine types in capabilities
Jiri Denemark [Fri, 12 Jun 2015 12:36:51 +0000 (14:36 +0200)]
qemu: Report all supported machine types in capabilities

Some machine types are only reported as canonical names for other
machine types, which make it a bit harder to find what machine types are
supported by a specific QEMU binary. Ideally, one would just use
/capabilities/guest/arch[@name='...']/machine/text() XPath to get a list
of all supported machine types, but it doesn't work right now.

For example, we report

    <machine canonical='pc-i440fx-2.3' maxCpus='255'>pc</machine>

in guest capabilities, but the corresponding

    <machine maxCpus='255'>pc-i440fx-2.3</machine>

is missing.

This is a result of QMP probing. With "-machine ?" parsing QEMU sends
us two lines:

pc                   Standard PC (i440FX + PIIX, 1996) (alias of pc-i440fx-2.3)
pc-i440fx-2.3        Standard PC (i440FX + PIIX, 1996) (default)

while query-machines QMP command reports both in the same entry:

{"name": "pc-i440fx-2.3", "is-default": true, "cpu-max": 255, "alias": "pc"}

Let's make sure we always report separate <machine/> for both the
canonical name and its alias and using the canonical name as the default
machine type (i.e., inserting it before its alias) in case is-default is
true.

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agotests: Sort EXTRA_DIST in the Makefile
Michal Privoznik [Wed, 17 Jun 2015 16:11:25 +0000 (18:11 +0200)]
tests: Sort EXTRA_DIST in the Makefile

We tend to keep the folders in the EXTRA_DIST sorted alphabetically.
However, we've failed sometimes and the list is not ordered anymore.
Reorder it back.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agodaemon: Don't just include admin RPC
Michal Privoznik [Wed, 17 Jun 2015 13:36:16 +0000 (15:36 +0200)]
daemon: Don't just include admin RPC

So, it's a little paradox that we use the file twice. Firstly to build
libvirt-admin.la (a client side of the Admin API), then once again to
build the server side. Well, the problem is, this does not play nicely
with the distclean since the file is generated. So while it's removed
in the src/ the distclean running in daemon/ will not find the file
and fail. The file is needed because it contains the RPC wrappers. So
let's leave the client code as is and from the daemon/ just link the
client library. The linker will find desired symbols and use them.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agonodedev: update netdev feature bits before each dumpxml
Laine Stump [Tue, 16 Jun 2015 15:57:11 +0000 (11:57 -0400)]
nodedev: update netdev feature bits before each dumpxml

As with several other attributes of devices (link status, sriov VF
list, IOMMU group list), the detdev feature bits aren't automatically
updated in the nodedev driver's cache when they change. In order to
get a properly up-to-date list when getting the XML of a device, we
must reget them in update-caps prior to each dumpxml.

This resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1232880

9 years agolibvirt.spec: Don't expect virt-admin in libvirt-admin yet
Michal Privoznik [Wed, 17 Jun 2015 11:49:35 +0000 (13:49 +0200)]
libvirt.spec: Don't expect virt-admin in libvirt-admin yet

While Martin introduced the binary (and its manpage) in commit
4e7ccf87133 it was pushed by mistake. Therefore it was reverted in
220393bfb043. The problem is, the original commit was not quite right
as the binary was added into the spec file in a different commit:
55e0c840af. So as long as the binary does not exist, we must remove it
from the spec file too.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agotests: Follow virnetserver to virnetdaemon transition
Michal Privoznik [Wed, 17 Jun 2015 11:29:14 +0000 (13:29 +0200)]
tests: Follow virnetserver to virnetdaemon transition

In a4746114582 the virnetserver test was renamed to virnetdaemon.
Moreover, as the test relies on some data stored under
virnetserverdata/ the folder was renamed too. But this was not
reflected in the Makefile. Therefore when building outside of the
repository, the data folder was not distributed and test failed.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agodaemon: Distribute admin_server.h
Michal Privoznik [Wed, 17 Jun 2015 11:25:47 +0000 (13:25 +0200)]
daemon: Distribute admin_server.h

The Admin API consists of a few files on daemon side. Notably
daemon/admin_server.{ch}. While they are both on the repo, only
the .c file is mentioned in Makefile. Therefore, .h is not
distributed and 'make rpm' fails.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agoparallels: substitute parallels with vz spec file and Makefile
Maxim Nestratov [Wed, 10 Jun 2015 07:50:00 +0000 (10:50 +0300)]
parallels: substitute parallels with vz spec file and Makefile

Since we have changed the name of the driver to vz, let's
reference it as vz everywhere.

Signed-off-by: Maxim Nestratov <mnestratov@parallels.com>
9 years agoparallels: rename all parallels files and driver directory to vz
Maxim Nestratov [Wed, 10 Jun 2015 07:50:00 +0000 (10:50 +0300)]
parallels: rename all parallels files and driver directory to vz

This patch moves all src/parallels/parallels* files to vz/vz*
and fixes build accordingly.
No functional changes.

Signed-off-by: Maxim Nestratov <mnestratov@parallels.com>
9 years agoparallels: substitute parallels with vz in strings
Maxim Nestratov [Wed, 10 Jun 2015 07:50:00 +0000 (10:50 +0300)]
parallels: substitute parallels with vz in strings

Here we stop referencing vz driver by different names
in error messages. 'parallels driver', 'Parallels Cloud
Server', 'Parallels driver' all become just 'vz driver'.
No functional changes. Only renaming and a bit of rewording.

Signed-off-by: Maxim Nestratov <mnestratov@parallels.com>
9 years agoparallels: change parallels prefixes to vz
Maxim Nestratov [Wed, 10 Jun 2015 07:50:00 +0000 (10:50 +0300)]
parallels: change parallels prefixes to vz

This patch changes all parallels/vz driver structure and
function prefixes from parallels to vz.
No functional changes.

Signed-off-by: Maxim Nestratov <mnestratov@parallels.com>
9 years agodaemon/Makefile: Add forgotten dependency
Michal Privoznik [Tue, 16 Jun 2015 16:11:17 +0000 (18:11 +0200)]
daemon/Makefile: Add forgotten dependency

In latest patches we added Admin API. However, the Makefile in daemon
was missing one dependency: admin_server.c is including generated file
admin_dispatch.h. However, this dependency was not explicitly marked
in the Makefile therefore the build happened to fail on some
occasions.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>