Commit Graph

4063 Commits

Author SHA1 Message Date
Peter Krempa
7961713410 qemu: monitor: Fix qemuMonitorGetAllBlockStatsInfo with HMP
Commit f6563bc3 introduced HMP impl of the function (so that a different
uglier function could be removed). Before the HMP code is called there's
a leftover check that the monitor is JSON which inhibits the code from
working.
2015-04-15 13:58:26 +02:00
Peter Krempa
a745d83fe0 qemu: monitor: @running in qemuMonitorGetStatus is always non-NULL
Add the attribute and remove the check.
2015-04-15 13:58:26 +02:00
Peter Krempa
81d14c0252 qemu: monitor: Don't use 'ret' variable where not necessary
Quite a lot places set the 'ret' variable just once right before
returning it's value. Remove such usage.
2015-04-15 13:58:26 +02:00
Peter Krempa
ee591240c2 qemu: monitor: Ensure that qemuMonitorSetLink is called with non-null name 2015-04-15 13:58:26 +02:00
Peter Krempa
0e9fadd66d qemu: monitor: Sanitize control flow in qemuMonitorSetCapabilities 2015-04-15 13:58:26 +02:00
Peter Krempa
119aa5d35a qemu: monitor: Clean up coding style
Fix line spacing between functions, ensure that function return type is
on a separate line and reflow arguments for VIR_DEBUG statements.
2015-04-15 13:58:25 +02:00
John Ferlan
29359e99bf snapshot: Change 'index' to 'idx'
Forthcoming syntax check rule will disallow usage of 'int index', so
change it for snapshot
2015-04-14 11:18:28 -04:00
John Ferlan
f44429a0bc qemu: Adjust the prototype to match the function
Changing the prototype to not have "int *index" since we'll soon be
disallowing index as a name. Curiously the original commit (a4504ac)
for the function used 'int idx' in the function - so they didn't match.
Now they do.
2015-04-14 11:18:28 -04:00
Martin Kletzander
f38bd06bff sparc: Add default PCI root controller
It is there even with -nodefaults and -no-user-config, so count with
that so we can start sparc domains.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2015-04-14 14:49:15 +02:00
Huanle Han
c61ded8a7d qemu: fix index error when clean up vport profile
1. 'last_good_net' indicates the index of last successfully configured
net. so def->nets[last_good_net] should also be clean up if error occurs.

2. if error occurs in 'virNetDevMacVLanVPortProfileRegisterCallback'
(second 'goto err_exit' in loop), we should also do
'virNetDevVPortProfileDisassociate' cleanup for the
'virNetDevVPortProfileAssociate'(first code block in loop). So we should
consider the net is successfully configured after first code block in
loop finishes.

Signed-off-by: Huanle Han <hanxueluo@gmail.com>
2015-04-14 14:49:15 +02:00
Shanzhi Yu
1db6212331 qemu: save domain status after set memory parameters
After set memory parameters for running domain, save the change to live
xml is needed otherwise it will disappear after restart libvirtd.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1211548
Signed-off-by: Shanzhi Yu <shyu@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2015-04-14 13:50:08 +02:00
John Ferlan
d375368790 qemu: Use 'idx' instead of 'index' for variable name
Apparently for Xen-devel 'index' is a global and causes a build failure,
so just use the shortened 'idx' instead to avoid the conflict.

Signed-off-by: John Ferlan <jferlan@redhat.com>
2015-04-14 07:18:32 -04:00
Peter Krempa
634285f9c1 qemu: Refactor qemuDomainBlockJobAbort()
Change few variable names and refactor the code flow. As an additional
bonus the function now fails if the event state is not as expected.
2015-04-14 10:00:56 +02:00
Peter Krempa
8a609afb6f qemu: drivePivot: Fix assumption when 'block-job-complete' fails
QEMU does not abandon the mirror. The job carries on in the synchronised
phase and it might be either pivoted again or cancelled. The commit
hints that the described behavior was happening in a downstream version.

If the command returns false there are two possible options:
1) qemu did not reach the point where it would ask the block job to
pivot
2) pivotting failed in the actual qemu coroutine

If either of those would happen we return failure and reset the
condition that waits for the block job to complete. This makes the API
fail but in case where qemu would actually abandon the mirror the fact
is notified via the event and handled asynchronously.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1202704
2015-04-14 10:00:56 +02:00
Peter Krempa
065a81082d qemu: blockPull: Refactor the rest of qemuDomainBlockJobImpl
Since it now handles only block pull code paths we can refactor it and
remove tons of cruft.
2015-04-14 10:00:56 +02:00
Peter Krempa
cfc0a3d4ce qemu: blockjob: Separate qemuDomainBlockJobAbort from qemuDomainBlockJobImpl
Sacrifice a few lines of code in favor of the code being more readable.
2015-04-14 10:00:56 +02:00
Peter Krempa
1344a74ef2 qemu: blockjob: Split qemuDomainBlockJobSetSpeed from qemuDomainBlockJobImpl
qemuDomainBlockJobImpl become an unmaintainable mess over the years of
adding new stuff to it. This patch starts splitting up individual
functions from it until it can be killed entirely.

In bulk this will add lines of code rather than delete them but it will
be traded for maintainability.
2015-04-14 10:00:56 +02:00
Peter Krempa
7db64d6b0a qemu: monitor: Extract handling of JSON block job error codes
My intention is to split qemuMonitorJSONBlockJob() into simpler separate
functions for every block job type. Since the error handling code is the
same for all block jobs, this patch extracts the code into a separate
function that will later be reused in more places.

With the new helper qemuMonitorJSONErrorIsClass we can save a few
function calls as we can extract the error object once.
2015-04-14 10:00:56 +02:00
Peter Krempa
72613b18ac qemu: monitor: json: Refactor error code class checker
Split out the function that checks the actual error class string into a
separate helper as it will be useful later and refactor
qemuMonitorJSONHasError to return bool type and remove few useless
checks.

Basically virJSONValueObjectHasKey are useless here since the next call
to virJSONValueObjectGet is checking the return value again (which can't
fail at that point). By removing the first check we save a function
call.
2015-04-14 10:00:56 +02:00
Peter Krempa
64985217bc qemu: Fix condition for checking vcpu when pinning vcpus
Previously we checked that the vcpu we are trying to set is in range of
the number of threads presented by qemu. The problem is that if the VM
is offline the count is 0. Since the condition subtracted 1 from the
count the number would overflow and the check would never trigger.

Change the condition for more sensible ones with specific error
messages.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1208434
2015-04-14 09:31:48 +02:00
Peter Krempa
714b38cb23 qemu: Enforce WWN to be unique among VM's disks
Operating systems use the identifier to name the disks. As the name
suggests the ID should be unique.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1208009
2015-04-14 08:44:36 +02:00
John Ferlan
2bcc263338 Rename qemuCheckIothreads to qemuCheckIOThreads
Signed-off-by: John Ferlan <jferlan@redhat.com>
2015-04-13 17:26:37 -04:00
Erik Skultety
b77ce18a28 virBitmap: Place virBitmapIsAllClear check after virBitmapParse calls
This patch adds checks for empty bitmaps right after the calls of
virBitmapParse. These only include spots where set API's are called and
where domain's XML is parsed.
Also, it partially reverts commit 983f5a which added a check for
invalid nodeset "0,^0" into virBitmapParse function. This change broke
the logic, as an empty bitmap should not cause an error.

https://bugzilla.redhat.com/show_bug.cgi?id=1210545
2015-04-13 14:21:02 +02:00
Ján Tomko
74b45e586e Do not require virtio-pci devices when using virtio-mmio
On arm, we probe for virtio-*-pci devices, but use their
virtio-*-device variants.

Set the capabilities based on the -device variants as well,
to make them work with qemus with the PCI devices compiled out.
2015-04-13 12:23:13 +02:00
Michal Privoznik
65a88572ad qemuMigrationPrecreateStorage: Fix debug message
When pre-creating storage for domains, we need to find corresponding
disk in the XML on the destination (domain XML may differ there, e.g.
disk is accessible under different path). For better debugging, I'm
printing all info I received on a disk. But there was a typo when
printing the disk capacity: "%lluu" instead of "%llu".

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2015-04-13 11:40:57 +02:00
Xing Lin
522e81cbb5 qemu_migration.c: sleep first before checking for migration status.
The problem with the previous implementation is,
even when qemuMigrationUpdateJobStatus() detects a migration job
has completed, it will do a sleep for 50 ms (which is unnecessary
and only adds up to the VM pause time).

Signed-off-by: Xing Lin <xinglin@cs.utah.edu>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2015-04-13 09:52:28 +02:00
John Ferlan
b487bb810e qemu: qemuDomainHotplugVcpus - separate out pin adjustment code
Future IOThread setting patches would copy the code anyway, so create
and generalize the adding of pindef for the vcpu and the pinning of the
thread into their own APIs.
2015-04-10 16:02:40 -04:00
Dmitry Guryanov
0d572b6982 conf: add VIR_DOMAIN_VIDEO_TYPE_PARALLELS video type
We support VNC for containers to have the same
interface with VMs. At this moment it just renders
linux text console.

Of course we don't pass any physical devices and
don't emulate virtual devices. Our VNC server
renders text from terminal master and sends
input events from VNC client to terminal.

So add special video type VIR_DOMAIN_VIDEO_TYPE_PARALLELS
for these pseudo-devices.

Signed-off-by: Dmitry Guryanov <dguryanov@parallels.com>
2015-04-10 09:50:29 +02:00
John Ferlan
97a1d94fa0 qemu: qemuDomainHotplugVcpus - separate out the del cgroup and pin
Future IOThread setting patches would copy the code anyway, so create
and generalize a delete cgroup and pindef for the vcpu into its own API.

Signed-off-by: John Ferlan <jferlan@redhat.com>
2015-04-09 19:27:08 -04:00
John Ferlan
0ed8e47a7e qemu: qemuDomainHotplugVcpus - separate out the add cgroup
Future IOThread setting patches would copy the code anyway, so create
and generalize the add the vcpu to a cgroup into its own API.

Signed-off-by: John Ferlan <jferlan@redhat.com>
2015-04-09 19:27:08 -04:00
John Ferlan
0456eda317 cgroup: Use virCgroupNewThread
Replace the virCgroupNew{Vcpu|Emulator|IOThread} calls with the common
virCgroupNewThread API

Signed-off-by: John Ferlan <jferlan@redhat.com>
2015-04-09 19:27:08 -04:00
Peter Krempa
a45ef3a9cd qemu: Avoid shadow of 'sync' symbol
Old compilers whine that 'sync' is being shadowed in the function
introduced in 1eccac1d2d.
2015-04-09 15:36:26 +02:00
Peter Krempa
7c62f239f4 qemu: blockPivot: Don't pause the VM any more since we don't use drive-reopen
Support for drive-reopen was never present in the upstream code so we
don't need to pause the VM when doing the block pivot. Kill all the
code related to this semi-upstream artifact.
2015-04-09 15:04:30 +02:00
Peter Krempa
db37f3cc3a qemu: Clean up old leftovers in qemuMonitorDrivePivot
There are two leftover unused variables. Remove them and clean up the
fallout of the change.
2015-04-09 14:18:48 +02:00
Peter Krempa
3eab2f647a qemu: blockjob: Use the new helpers in qemuDomainGetBlockJobInfo
Refactor the function to use the new helpers.
2015-04-09 14:11:49 +02:00
Peter Krempa
1eccac1d2d qemu: domain: Add helper to check block job support
We need to check that qemu supports block jobs in multiple places. Add a
helper to do the check.
2015-04-09 14:11:42 +02:00
Peter Krempa
88dc7e0c2f qemu: domain: Introduce helper to retrieve domain monitor object
In some cases where the function does not need to access the private
data this helper may be used to retrieve the monitor object.
2015-04-09 14:11:36 +02:00
Luyao Huang
7cd0cf05f7 fix memleak in qemuRestoreCgroupState
131,088 bytes in 16 blocks are definitely lost in loss record 2,174 of 2,176
    at 0x4C29BFD: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
    by 0x4C2BACB: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
    by 0x52A026F: virReallocN (viralloc.c:245)
    by 0x52BFCB5: saferead_lim (virfile.c:1268)
    by 0x52C00EF: virFileReadLimFD (virfile.c:1328)
    by 0x52C019A: virFileReadAll (virfile.c:1351)
    by 0x52A5D4F: virCgroupGetValueStr (vircgroup.c:763)
    by 0x1DDA0DA3: qemuRestoreCgroupState (qemu_cgroup.c:805)
    by 0x1DDA0DA3: qemuConnectCgroup (qemu_cgroup.c:857)
    by 0x1DDB7BA1: qemuProcessReconnect (qemu_process.c:3694)
    by 0x52FD171: virThreadHelper (virthread.c:206)
    by 0x82B8DF4: start_thread (pthread_create.c:308)
    by 0x85C31AC: clone (clone.S:113)

Signed-off-by: Luyao Huang <lhuang@redhat.com>
2015-04-08 11:56:30 +02:00
Michal Privoznik
ea576ee543 qemuProcessHook: Call virNuma*() only when needed
https://bugzilla.redhat.com/show_bug.cgi?id=1198645

Once upon a time, there was a little domain. And the domain was pinned
onto a NUMA node and hasn't fully allocated its memory:

  <memory unit='KiB'>2355200</memory>
  <currentMemory unit='KiB'>1048576</currentMemory>

  <numatune>
    <memory mode='strict' nodeset='0'/>
  </numatune>

Oh little me, said the domain, what will I do with so little memory.
If I only had a few megabytes more. But the old admin noticed the
whimpering, barely audible to untrained human ear. And good admin he
was, he gave the domain yet more memory. But the old NUMA topology
witch forbade to allocate more memory on the node zero. So he
decided to allocate it on a different node:

virsh # numatune little_domain --nodeset 0-1

virsh # setmem little_domain 2355200

The little domain was happy. For a while. Until bad, sharp teeth
shaped creature came. Every process in the system was afraid of him.
The OOM Killer they called him. Oh no, he's after the little domain.
There's no escape.

Do you kids know why? Because when the little domain was born, her
father, Libvirt, called numa_set_membind(). So even if the admin
allowed her to allocate memory from other nodes in the cgroups, the
membind() forbid it.

So what's the lesson? Libvirt should rely on cgroups, whenever
possible and use numa_set_membind() as the last ditch effort.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2015-04-08 11:54:31 +02:00
Michael Chapman
cfcdf5ff01 qemu_driver: check caps after starting block job
Currently we check qemuCaps before starting the block job. But qemuCaps
isn't available on a stopped domain, which means we get a misleading
error message in this case:

  # virsh domstate example
  shut off

  # virsh blockjob example vda
  error: unsupported configuration: block jobs not supported with this QEMU binary

Move the qemuCaps check into the block job so that we are guaranteed the
domain is running.

Signed-off-by: Michael Chapman <mike@very.puzzling.org>
2015-04-08 11:16:19 +02:00
Michael Chapman
72df8314f0 qemu_migrate: use nested job when adding NBD to cookie
qemuMigrationCookieAddNBD is usually called from within an async
MIGRATION_OUT or MIGRATION_IN job, so it needs to start a nested job.

(The one exception is during the Begin phase when change protection
isn't enabled, but qemuDomainObjEnterMonitorAsync will behave the same
as qemuDomainObjEnterMonitor in this case.)

This bug was encountered with a libvirt client that repeatedly queries
the disk mirroring block job info during a migration. If one of these
queries occurs just as the Perform migration cookie is baked, libvirt
crashes.

Relevant logs are as follows:

    6701: warning : qemuDomainObjEnterMonitorInternal:1544 : This thread seems to be the async job owner; entering monitor without asking for a nested job is dangerous
[1] 6701: info : qemuMonitorSend:972 : QEMU_MONITOR_SEND_MSG: mon=0x7fefdc004700 msg={"execute":"query-block","id":"libvirt-629"}
[2] 6699: info : qemuMonitorIOWrite:503 : QEMU_MONITOR_IO_WRITE: mon=0x7fefdc004700 buf={"execute":"query-block","id":"libvirt-629"}
[3] 6704: info : qemuMonitorSend:972 : QEMU_MONITOR_SEND_MSG: mon=0x7fefdc004700 msg={"execute":"query-block-jobs","id":"libvirt-630"}
[4] 6699: info : qemuMonitorJSONIOProcessLine:203 : QEMU_MONITOR_RECV_REPLY: mon=0x7fefdc004700 reply={"return": [...], "id": "libvirt-629"}
    6699: error : qemuMonitorJSONIOProcessLine:211 : internal error: Unexpected JSON reply '{"return": [...], "id": "libvirt-629"}'

At [1] qemuMonitorBlockStatsUpdateCapacity sends its request, then waits
on mon->notify. At [2] the request is written out to the monitor socket.
At [3] qemuMonitorBlockJobInfo sends its request, and also waits on
mon->notify. The reply from the first request is received at [4].
However, qemuMonitorJSONIOProcessLine is not expecting this reply since
the second request hadn't completed sending. The reply is dropped and an
error is returned.

qemuMonitorIO signals mon->notify twice during its error handling,
waking up both of the threads waiting on it. One of them clears mon->msg
as it exits qemuMonitorSend; the other crashes:

  qemuMonitorSend (mon=0x7fefdc004700, msg=<value optimized out>) at qemu/qemu_monitor.c:975
  975         while (!mon->msg->finished) {
  (gdb) print mon->msg
  $1 = (qemuMonitorMessagePtr) 0x0

Signed-off-by: Michael Chapman <mike@very.puzzling.org>
2015-04-08 10:30:17 +02:00
Michael Chapman
e5d729ba42 qemu: fix race between disk mirror fail and cancel
If a VM migration is aborted, a disk mirror may be failed by QEMU before
libvirt has a chance to cancel it. The disk->mirrorState remains at
_ABORT in this case, and this breaks subsequent mirrorings of that disk.

We should instead check the mirrorState directly and transition to _NONE
if it is already aborted. Do the check *after* aborting the block job in
QEMU to avoid a race.

Signed-off-by: Michael Chapman <mike@very.puzzling.org>
2015-04-08 09:45:47 +02:00
Michael Chapman
77ddd0bba2 qemu: fix error propagation in qemuMigrationBegin
If virCloseCallbacksSet fails, qemuMigrationBegin must return NULL to
indicate an error occurred.

Signed-off-by: Michael Chapman <mike@very.puzzling.org>
2015-04-08 09:45:47 +02:00
Michael Chapman
7578cc17f5 qemu: fix crash in qemuProcessAutoDestroy
The destination libvirt daemon in a migration may segfault if the client
disconnects immediately after the migration has begun:

  # virsh -c qemu+tls://remote/system list --all
   Id    Name                           State
  ----------------------------------------------------
  ...

  # timeout --signal KILL 1 \
      virsh migrate example qemu+tls://remote/system \
        --verbose --compressed --live --auto-converge \
        --abort-on-error --unsafe --persistent \
        --undefinesource --copy-storage-all --xml example.xml
  Killed

  # virsh -c qemu+tls://remote/system list --all
  error: failed to connect to the hypervisor
  error: unable to connect to server at 'remote:16514': Connection refused

The crash is in:

   1531 void
   1532 qemuDomainObjEndJob(virQEMUDriverPtr driver, virDomainObjPtr obj)
   1533 {
   1534     qemuDomainObjPrivatePtr priv = obj->privateData;
   1535     qemuDomainJob job = priv->job.active;
   1536
   1537     priv->jobs_queued--;

Backtrace:

  #0  at qemuDomainObjEndJob at qemu/qemu_domain.c:1537
  #1  in qemuDomainRemoveInactive at qemu/qemu_domain.c:2497
  #2  in qemuProcessAutoDestroy at qemu/qemu_process.c:5646
  #3  in virCloseCallbacksRun at util/virclosecallbacks.c:350
  #4  in qemuConnectClose at qemu/qemu_driver.c:1154
  ...

qemuDomainRemoveInactive calls virDomainObjListRemove, which in this
case is holding the last remaining reference to the domain.
qemuDomainRemoveInactive then calls qemuDomainObjEndJob, but the domain
object has been freed and poisoned by then.

This patch bumps the domain's refcount until qemuDomainRemoveInactive
has completed. We also ensure qemuProcessAutoDestroy does not return the
domain to virCloseCallbacksRun to be unlocked in this case. There is
similar logic in bhyveProcessAutoDestroy and lxcProcessAutoDestroy
(which call virDomainObjListRemove directly).

Signed-off-by: Michael Chapman <mike@very.puzzling.org>
2015-04-08 09:45:47 +02:00
Michal Privoznik
225aa80246 virQEMUDriverGetConfig: Fix memleak
==19015== 968 (416 direct, 552 indirect) bytes in 1 blocks are definitely lost in loss record 999 of 1,049
==19015==    at 0x4C2C070: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==19015==    by 0x52ADF14: virAllocVar (viralloc.c:560)
==19015==    by 0x5302FD1: virObjectNew (virobject.c:193)
==19015==    by 0x1DD9401E: virQEMUDriverConfigNew (qemu_conf.c:164)
==19015==    by 0x1DDDF65D: qemuStateInitialize (qemu_driver.c:666)
==19015==    by 0x53E0823: virStateInitialize (libvirt.c:777)
==19015==    by 0x11E067: daemonRunStateInit (libvirtd.c:905)
==19015==    by 0x53201AD: virThreadHelper (virthread.c:206)
==19015==    by 0xA1EE1F2: start_thread (in /lib64/libpthread-2.19.so)
==19015==    by 0xA4EFC8C: clone (in /lib64/libc-2.19.so)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2015-04-07 18:52:27 +02:00
Michal Privoznik
9dbe6f3151 qemuSetupCgroupForVcpu: Fix memleak
==19015== 1,064 (656 direct, 408 indirect) bytes in 2 blocks are definitely lost in loss record 1,002 of 1,049
==19015==    at 0x4C2C070: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==19015==    by 0x52AD74B: virAlloc (viralloc.c:144)
==19015==    by 0x52B47CA: virCgroupNew (vircgroup.c:1057)
==19015==    by 0x52B53E5: virCgroupNewVcpu (vircgroup.c:1451)
==19015==    by 0x1DD85A40: qemuSetupCgroupForVcpu (qemu_cgroup.c:1013)
==19015==    by 0x1DDA66EA: qemuProcessStart (qemu_process.c:4844)
==19015==    by 0x1DDF1807: qemuDomainObjStart (qemu_driver.c:7265)
==19015==    by 0x1DDF1A66: qemuDomainCreateWithFlags (qemu_driver.c:7320)
==19015==    by 0x1DDF1ACD: qemuDomainCreate (qemu_driver.c:7337)
==19015==    by 0x53F87EA: virDomainCreate (libvirt-domain.c:6820)
==19015==    by 0x12690A: remoteDispatchDomainCreate (remote_dispatch.h:3481)
==19015==    by 0x126827: remoteDispatchDomainCreateHelper (remote_dispatch.h:3457)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2015-04-07 18:52:26 +02:00
Ján Tomko
1371ea92f0 Auto add virtio-serial controllers
In virDomainVirtioSerialAddrNext, add another controller
if we've exhausted all ports of the existing controllers.

https://bugzilla.redhat.com/show_bug.cgi?id=1076708
2015-04-02 15:00:13 +02:00
Ján Tomko
89e991a2aa Assign an address when hotplugging a virtio-serial device 2015-04-02 15:00:13 +02:00
Ján Tomko
ee0d97a770 Expand the address set when attaching a virtio-serial controller 2015-04-02 15:00:13 +02:00
Ján Tomko
5903378834 Allocate virtio-serial addresses when starting a domain
Instead of always using controller 0 and incrementing port number,
respect the maximum port numbers of controllers and use all of them.

Ports for virtio consoles are quietly reserved, but not formatted
(neither in XML nor on QEMU command line).

Also rejects duplicate virtio-serial addresses.
https://bugzilla.redhat.com/show_bug.cgi?id=890606
https://bugzilla.redhat.com/show_bug.cgi?id=1076708

Test changes:
* virtio-auto.args
  Filling out the port when just the controller is specified.
  switched from using
    maxport + 1
  to:
    first free port on the controller
* virtio-autoassign.args
  Filling out the address when no <address> is specified.
  Started using all the controllers instead of 0, also discards
  the bus value.
* xml -> xml output of virtio-auto
  The port assignment is no longer done as a part of XML parsing,
  so the unspecified values stay 0.
2015-04-02 15:00:13 +02:00