Commit Graph

18964 Commits

Author SHA1 Message Date
Martin Kletzander
3a0e5b0c20 qemu: Migrate memory on numatune change
We've never set the cpuset.memory_migrate value to anything, keeping it
on default.  However, we allow changing cpuset.mems on live domain.
That setting, however, don't have any consequence on a domain unless
it's going to allocate new memory.

I managed to make 'virsh numatune' move all the memory to any node I
wanted even without disabling libnuma's numa_set_membind(), so this
should be safe to use with it as well.

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

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2015-03-20 13:40:02 +01:00
Martin Kletzander
ba1dfc5b6a cgroup: Add accessors for cpuset.memory_migrate
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2015-03-20 13:40:02 +01:00
Eric Blake
feeaad4fd5 maint: update .mailmap for recent contributions
Deepak Shetty has changed preferred email address since prior
contributions.

Signed-off-by: Eric Blake <eblake@redhat.com>
2015-03-20 06:17:55 -06:00
Jim Fehlig
2adba7d3ab libxl: use xenlight pkgconfig file if present
xen.git commit babeca32 added a pkgconfig file for libxenlight,
allowing libxl apps to determine the location of Xen binaries
such as firmware blobs, device emulator, etc.

This patch adds support for xenlight.pc in the libxl driver, falling
back to the previous configure logic if not found.  It introduces
LIBXL_FIRMWARE_DIR and LIBXL_EXECBIN_DIR to define the firmware and
libexec_bin locations.  If xenlight.pc does not exist, the defines
are set to the current hardcoded paths.  The capabilities'
<emulator> and <loader> elements are updated to use the paths.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
2015-03-19 16:13:26 -06:00
Maxim Nestratov
a4da09d20a parallels: fix libvirt crash if parallelsNetworkOpen fails
If, by any reason, parallelsNetworkOpen fails it dereferences
newly allocated privconn->networks via virObjectUnref, which in
turn deallocates its memory.
Subsequent call of parallelsNetworkClose calls virObjectUnref
that leads to double memory free. To prevent this we should zero
privconn->networks to make all subsequent virObjectUnref be safe.

Signed-off-by: Maxim Nestratov <mnestratov@parallels.com>
2015-03-19 16:28:40 +01:00
Luyao Huang
4f06820938 qemu: do not overwrite the error in qemuDomainObjExitMonitor
https://bugzilla.redhat.com/show_bug.cgi?id=1196934

When qemu exits during startup, libvirt includes the error from
/var/log/libvirt/qemu/vm.log in the error message:

$ virsh start test3
error: Failed to start domain test3
error: internal error: early end of file from monitor: possible problem:
2015-02-27T03:03:16.985494Z qemu-kvm: -numa memdev is not supported by
machine rhel6.5.0

The check for domain liveness added to qemuDomainObjExitMonitor
in commit dc2fd51f sometimes overwrites this error:
$ virsh start test3
error: Failed to start domain test3
error: operation failed: domain is no longer running

Fix the check to only report an error if there is none set.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2015-03-19 10:17:27 +01:00
Jim Fehlig
bd235cd873 libxl: Don't overwrite errors from xenconfig
When converting domXML from native, the libxl driver was overwriting
useful errors from the xenconfig parsing code with a useless, generic
error.  E.g. "internal error: parsing xm config failed" vs
"internal error: config value usbdevice was malformed".  Remove the
redundant (and useless) error reporting in the libxl driver.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
2015-03-18 20:55:33 -06:00
John Ferlan
e06e6f1ee3 qemu: Fix two issues in qemuDomainSetVcpus error handling
Issue #1 - A call to virBitmapNew did not check if the allocation
failed which could lead to a NULL dereference

Issue #2 - When deleting the pin entries from the config file, the
code loops from the number of elements down to the "new" vcpu count;
however, the pin id values are numbered 0..n-1 not 1..n, so the "first"
pin attempt would never work. Luckily the check was for whether the
incoming 'n' (vcpu id) matched the entry in the array from 0..arraysize
rather than a dereference of the 'n' entry
2015-03-18 18:11:22 -04:00
Deepak Shetty
060f4c666e doc: Fix doc for backingStore
I spent quite some time figuring that backingStore info
isn't included in the dom xml, unless guest is up and
running. Hopefully putting that in the doc should help.

Also, several people have complained that libvirt reports
a backing file as raw, even though they expected it to be
qcow2; where the culprit is usually the user forgetting to
create the file with qemu-img create -o backing_fmt=qcow2.

This patch adds that info to the doc.

Signed-off-by: Deepak C Shetty <deepakcs@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
2015-03-18 15:21:46 -06:00
Eric Blake
e2660cb8a6 qemu: track 'cancelling' migration state
In qemu 2.3, the migration status will include 'cancelling' in the
window between when an asynchronous cancel has been requested and
when the migration is actually halted.  Previously, qemu hid this
state and reported 'active'.  Libvirt manages the sequence okay
even when the string is unrecognized (that is, it will report an
unknown state:

Migration: [ 69 %]^Cerror: internal error: unexpected migration status in cancelling.

but the migration is still cancelled), but recognizing the string
makes for a smoother user experience.

* src/qemu/qemu_monitor.h
(QEMU_MONITOR_MIGRATION_STATUS_CANCELLING): Add enum.
* src/qemu/qemu_monitor.c (qemuMonitorMigrationStatus): Map it.
* src/qemu/qemu_migration.c (qemuMigrationUpdateJobStatus): Adjust
clients.
* src/qemu/qemu_monitor_json.c
(qemuMonitorJSONGetMigrationStatusReply): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
2015-03-18 14:59:34 -06:00
Laine Stump
72423df992 util: more verbose error when failing to create macvtap device
Investigation of a problem with creating passthrough macvtap devices
(https://bugzilla.redhat.com/show_bug.cgi?id=1185501) has shown that
this slightly more verbose failure message is useful. In particular,
the mac address can be used to determine the domain. You could also
figure this out by looking at preceding messages in a debug log, but
this gets it in a single place.
2015-03-18 14:49:29 -04:00
Laine Stump
451547a422 util: clean up #includes of virnetdevopenvswitch.h
virnetdevopenvswitch.h declares a few functions that can be called to
add ports to and remove them from OVS bridges, and retrieve the
migration data for a port. It does not contain any data definitions
that are used by domain_conf.h. But for some reason, domain_conf.h
virnetdevopenvswitch.h should be directly #including it. This adds a
few lines to the project, but saves all the files that don't need it
from the extra computing, and makes the dependencies more clear cut.
2015-03-18 14:43:47 -04:00
zhang bo
39ac323063 util: vhost user: support for bootindex
Problem Description:
When we set boot order for a vhost-user network interface, we found the boot index
doesn't work.

Cause of the Problem:
In the function qemuBuildVhostuserCommandLine(), it forcely set the arg bootindex of
function qemuBuildNicDevStr() to 0. Thus, the bootindex parameter got missing.

Solution:
Trans the arg bootindex down.

Signed-off-by: Gao Haifeng <gaohaifeng.gao@huawei.com>
Signed-off-by: Zhang Bo <oscar.zhangbo@huawei.com>
2015-03-18 18:39:09 +01:00
Maxim Nestratov
c630b48006 parallels: don't prevent domain define if VIR_DOMAIN_NET_TYPE_BRIDGE
network adapter is used
2015-03-18 18:23:41 +01:00
Maxim Nestratov
ed043768a3 parallels: switch off offline management feature
which is on by default when a new VM/CT is created.
We should do this because this feature can't be controlled
by libvirt now and it sets up some iptables rules. So it's
better to do this to avoid potential conflict of different
set of rules or to avoid unexpected behavior.

Signed-off-by: Maxim Nestratov <mnestratov@parallels.com>
2015-03-18 18:21:39 +01:00
Maxim Nestratov
5a9b01b36d parallels: make E1000 network adapter model default
and set adapter model specified in xml

Signed-off-by: Maxim Nestratov <mnestratov@parallels.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2015-03-18 18:16:17 +01:00
Maxim Nestratov
46f4a532d5 parallels: set correct network adapter link state
when a new network adapter device is added

Signed-off-by: Maxim Nestratov <mnestratov@parallels.com>
2015-03-18 18:09:15 +01:00
Maxim Nestratov
50e0a1bff8 parallels: better bridge network interface support
In order to support 'bridge' network adapters in parallels
driver we need to plug our veth devices into corresponding
linux bridges.
We are going to do this by reusing our abstraction of
Virtual Networks in terms of PCS. On a domain creation, we
create a new Virtual Network naming it with the same name
as a source bridge for each network  interface.
Having done this, we plug PCS veth interfaces created with names of
target dev into specified bridges using our standard PCS procedures

Signed-off-by: Maxim Nestratov <mnestratov@parallels.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2015-03-18 18:07:23 +01:00
Maxim Nestratov
725bffa782 parallels: fix parallelsLoadNetworks
Don't fail initialization of parallels driver if
parallelsLoadNetwork fails for optional networks.
This can happen when some of them are added manually
and configured incompletely. PCS requires only two networks
created automatically (named Host-Only and Bridged), others
are optional and their incompleteness can be ignored.

Signed-off-by: Maxim Nestratov <mnestratov@parallels.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2015-03-18 18:00:53 +01:00
Maxim Nestratov
20111b6fdf parallels: introduce and use string constants for network types and names
Signed-off-by: Maxim Nestratov <mnestratov@parallels.com>
2015-03-18 17:35:21 +01:00
Jiri Denemark
9c23b325b4 maint: Distribute tests/vircgroupdata
My commit 2dbfa71 added test data for vircgrouptest but forgot to
distribute the new directory.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2015-03-18 12:13:41 +01:00
John Ferlan
0e3c68acd8 network: Resolve Coverity FORWARD_NULL
The following is a long winded way to say this patch is avoiding a
false positive.

Coverity complains that calling networkPlugBandwidth() could eventually
end up with a NULL dereference on iface->bandwidth because in the
networkAllocateActualDevice there's a check of 'iface->bandwidth'
before deciding to try to use the 'portgroup' if it exists or to not
perferm the virNetDevBandwidthCopy if 'bandwidth' is not NULL.

Later in networkPlugBandwidth the 'iface->bandwidth' is sourced from
virDomainNetGetActualBandwidth - which would be either iface->bandwidth
or (preferably) iface->data.network.actual->bandwidth which would have
been filled in from either 'iface->bandwidth' or 'portgroup->bandwidth'
back in networkAllocateActualDevice

There *is* a check in networkCheckBandwidth for the result of the
virDomainNetGetActualBandwidth being NULL and a return 1 based on
that which would cause networkPlugBandwidth to exit properly and thus
never hit the condition that Coverity complains about.

However, since Coverity checks all paths - it somehow believes that
a return of 0 by networkCheckBandwidth in this condition would end
up causing the possible NULL dereference. The "fix" to silence Coverity
is to not have networkCheckBandwidth also call virDomainNetGetActualBandwidth
in order to get the ifaceBand, but rather have it accept it as an argument
which causes Coverity to "see" that it's the exit condition of 1 that won't
have the possible NULL dereference.  Since we're passing that, I added the
passing of iface->mac rather than passing iface as well. This just hopefully
makes sure someone doesn't undo this in the future...
2015-03-18 06:56:24 -04:00
Jiri Denemark
18441ab914 Use PAUSED state for domains that are starting up
When libvirt is starting a domain, it reports the state as SHUTOFF until
it's RUNNING. This is not ideal because domain startup may take a long
time (usually because of some configuration issues, firewalls blocking
access to network disks, etc.) and domain lists provided by libvirt look
awkward. One can see weird shutoff domains with IDs in a list of active
domains or even shutoff transient domains. In any case, it looks more
like a bug in libvirt than a normal state a domain goes through.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2015-03-18 10:08:22 +01:00
Jiri Denemark
2dbfa716e8 tests: Add tests for virCgroupDetectMounts
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2015-03-18 09:53:24 +01:00
Michal Privoznik
3353c7c40a qemuGetDHCPInterfaces: Don't leak @network
The function needs a pointer to the network to get list of DHCP
leases. The pointer is obtained via virNetworkLookupByName() which
requires callers to free the returned network once no longer needed.
Otherwise it's leaked.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2015-03-18 09:30:15 +01:00
Michal Privoznik
0aff8fa829 cmdDomIfAddr: Free @ip_addr_str
The variable holds formatted suffix to each line printed out
(address type, address and prefix). However, the variable is
never freed. At the same time, honour fact, that data held in
the variable is not constant.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2015-03-18 09:13:53 +01:00
Michal Privoznik
100fb08cee qemuAgentGetInterfaces: Don't error out on missing HW address
Now that we allow HW address to be not present on our RPC layer,
don't error out if qemu-ga hasn't provided any.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2015-03-18 09:13:19 +01:00
Michal Privoznik
50780207ef virsh: Adapt to new HW address scenario
Make sure we don't print (null) (which in fact is printf()'s
cleverness anyway, not ours). If no HW address is present, print
"N/A" string just like we do for other fields.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2015-03-18 09:12:52 +01:00
Michal Privoznik
3640245db7 RPC: Allow HW address in remote_domain_interface struct to be NULL
Not all NICs (esp. the virtual ones like TUN) must have a hardware
address. Teach our RPC that it's possible.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2015-03-18 09:12:36 +01:00
Eric Blake
f9ea3d6011 qemu: read backing chain names from qemu
https://bugzilla.redhat.com/show_bug.cgi?id=1199182 documents that
after a series of disk snapshots into existing destination images,
followed by active commits of the top image, it is possible for
qemu 2.2 and earlier to end up tracking a different name for the
image than what it would have had when opening the chain afresh.
That is, when starting with the chain 'a <- b <- c', the name
associated with 'b' is how it was spelled in the metadata of 'c',
but when starting with 'a', taking two snapshots into 'a <- b <- c',
then committing 'c' back into 'b', the name associated with 'b' is
now the name used when taking the first snapshot.

Sadly, older qemu doesn't know how to treat different spellings of
the same filename as identical files (it uses strcmp() instead of
checking for the same inode), which means libvirt's attempt to
commit an image using solely the names learned from qcow2 metadata
fails with a cryptic:

error: internal error: unable to execute QEMU command 'block-commit': Top image file /tmp/images/c/../b/b not found

even though the file exists.  Trying to teach libvirt the rules on
which name qemu will expect is not worth the effort (besides, we'd
have to remember it across libvirtd restarts, and track whether a
file was opened via metadata or via snapshot creation for a given
qemu process); it is easier to just always directly ask qemu what
string it expects to see in the first place.

As a safety valve, we validate that any name returned by qemu
still maps to the same local file as we have tracked it, so that
a compromised qemu cannot accidentally cause us to act on an
incorrect file.

* src/qemu/qemu_monitor.h (qemuMonitorDiskNameLookup): New
prototype.
* src/qemu/qemu_monitor_json.h (qemuMonitorJSONDiskNameLookup):
Likewise.
* src/qemu/qemu_monitor.c (qemuMonitorDiskNameLookup): New function.
* src/qemu/qemu_monitor_json.c (qemuMonitorJSONDiskNameLookup)
(qemuMonitorJSONDiskNameLookupOne): Likewise.
* src/qemu/qemu_driver.c (qemuDomainBlockCommit)
(qemuDomainBlockJobImpl): Use it.

Signed-off-by: Eric Blake <eblake@redhat.com>
2015-03-17 11:57:53 -06:00
Antoni Segura Puimedon
d490f47ba3 network: Add midonet virtual port type support to qemu
Use the utilities introduced in the previous patches so the qemu
driver is able to create tap devices that are bound (and unbound
on domain destroyal) to Midonet virtual ports.

Signed-off-by: Antoni Segura Puimedon <toni+libvirt@midokura.com>
2015-03-17 13:10:17 -04:00
Antoni Segura Puimedon
a9fbe3b157 docs: schema and docs for the midonet virtualport type
Midonet is an opensource virtual networking that over lays the IP
network between hypervisors. Currently, such networks can be made
with the openvswitch virtualport type.

This patch, defines the schema and documentation that will serve
as basis for the follow up patches that will add support to libvirt
for using Midonet virtual ports for its interfaces. The schema
definition requires that the port profile expresses its interfaceid
as part of the port profile. For that reason, this is part of the
patch too.

Signed-off-by: Antoni Segura Puimedon <toni+libvirt@midokura.com>
2015-03-17 13:09:05 -04:00
Antoni Segura Puimedon
e1f6485694 util: functions to support binding/unbinding midonet virtualports
Adds the port type definitions and methods that will be used to bind
interfaces to the Midonet virtual ports.

virtnetdevmidonet.c adds the way to bind and unbind the ports by
calling into the Midonet Host Agent control command line (installed
with the midolman package).

Signed-off-by: Antoni Segura Puimedon <toni+libvirt@midokura.com>
2015-03-17 12:56:37 -04:00
Peter Krempa
7a8f54bf4c conf: disk: Simplify checking if source definition was parsed
Previously we had to check for 3 fields to see if the source was filled.
Repurpose one of the variables as a boolean flag and use it instead of
combining multiple sources.

For the condition that checks that only CDROM/FLOPPY drives can be empty
we can use the virStorageSourceIsEmpty() helper.
2015-03-17 17:11:38 +01:00
Peter Krempa
158340e2fb util: storage: Fix check for empty storage device
If the storage device type is parsed as network our parser still allows
it to omit the <source> element. The empty drive check would not trigger
on such device as it expects that every network storage source is valid.

Use VIR_STORAGE_NET_PROTOCOL_NONE as a marker that the storage source is
empty.
2015-03-17 17:11:38 +01:00
Peter Krempa
d0dc6c0369 qemu: driver: Fix cold-update of removable storage devices
Only selected fields from the disk source were copied when cold updating
source in a CDROM drive. When such drive was backed by a network file
this resulted into corruption of the definition:

    <disk type='network' device='cdrom'>
      <driver name='qemu' type='raw' cache='none'/>
      <source protocol='gluster' name='gluster-vol1(null)'>
        <host name='localhost'/>
      </source>
      <target dev='vdc' bus='virtio'/>
      <readonly/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
    </disk>

Update the whole source instead of cherry-picking elements.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1166024
2015-03-17 17:11:37 +01:00
Peter Krempa
e7974b4f80 qemu: hotplug: Use checker function to check if disk is empty 2015-03-17 17:11:37 +01:00
Peter Krempa
f4b5f53027 virsh: domain: Fix the change-media command
The command did not modify the disk type and thus didn't allow to change
media from a file image to a block backed image or vice versa. In
addition when operating on a network backed removable devices the
command would replace the while <source> subelement with an invalid one.

This patch adds the --block option that allows to specify that the new
image is block backed and assumes that without that option all images
are file backed. Since network backends were always mangled it should
not cause problems.
2015-03-17 17:11:37 +01:00
Peter Krempa
4cbcaffb74 virsh: domain: Add --print-xml flag for command change-media
Allow printing the XML that would be used mostly for debugging purposes.
2015-03-17 17:11:37 +01:00
Peter Krempa
1cc820937a virsh: domain: Don't use vshPrepareDiskXML for creating XML to detach disk
Since cmdDetachDisk() calls into vshPrepareDiskXML() with
type == VSH_PREPARE_DISK_XML_NONE && source == NULL this would result
into skipping all the checks and effectively turn the function into a
XML formatter.

This patch changes the code to use the formatter directly so that the
function can be refactored in a easier way.
2015-03-17 17:11:37 +01:00
Maxim Nestratov
50bdad6678 parallels_sdk.c: minor cleanup
Fix indentation in prlsdkGetNetInf()o, remove unnecessary error
message in prlsdkDomainChangeState(), remove unnecessary job
freeing in prlsdkLoadDomains().

Signed-off-by: Maxim Nestratov <mnestratov@parallels.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2015-03-17 16:50:03 +01:00
Nehal J Wani
2f36e6944e domifaddr: Add virsh support
tools/virsh-domain-monitor.c
   * Introduce new command : domifaddr
     Usage: domifaddr <domain> [interface] [--full] [--source lease|agent]

     Example outputs:
     virsh # domifaddr f20
     Name       MAC address          Protocol     Address
     -------------------------------------------------------------------------------
     lo         00:00:00:00:00:00    ipv4         127.0.0.1/8
     -          -                    ipv6         ::1/128
     vnet0      52:54:00:2e:45:ce    ipv4         10.1.33.188/24
     -          -                    ipv6         2001:db8:0:f101::2/64
     -          -                    ipv6         fe80::5054:ff:fe2e:45ce/64
     vnet1      52:54:00:b1:70:19    ipv4         192.168.105.201/16
     -          -                    ipv4         192.168.201.195/16
     -          -                    ipv6         fe80::5054:ff:feb1:7019/64
     vnet2      52:54:00:36:2a:e5    N/A          N/A
     vnet3      52:54:00:20:70:3d    ipv4         192.168.105.240/16
     -          -                    ipv6         fe80::5054:ff:fe20:703d/64

     virsh # domifaddr f20 eth1 --source lease
     Name       MAC address          Protocol     Address
     -------------------------------------------------------------------------------
     vnet1      52:54:00:b1:70:19    ipv4         192.168.105.201/16
     -          -                    ipv4         192.168.201.195/16
     -          -                    ipv6         fe80::5054:ff:feb1:7019/64

     virsh # domifaddr f20 eth0 --source agent --full
     Name       MAC address          Protocol     Address
     -------------------------------------------------------------------------------
     eth0       52:54:00:2e:45:ce    ipv4         10.1.33.188/24
     eth0       52:54:00:2e:45:ce    ipv6         2001:db8:0:f101::2/64
     eth0       52:54:00:2e:45:ce    ipv6         fe80::5054:ff:fe2e:45ce/64

tools/virsh.pod
   * Document new command

Signed-off-by: Nehal J Wani <nehaljw.kkd1@gmail.com>
2015-03-17 15:15:39 +00:00
Nehal J Wani
0977b8aa07 domifaddr: Implement the API for qemu
By querying the qemu guest agent with the QMP command
"guest-network-get-interfaces" and converting the received JSON
output to structured objects.

Although "ifconfig" is deprecated, IP aliases created by "ifconfig"
are supported by this API. The legacy syntax of an IP alias is:
"<ifname>:<alias-name>". Since we want all aliases to be clubbed
under parent interface, simply stripping ":<alias-name>" suffices.
Note that IP aliases formed by "ip" aren't visible to "ifconfig",
and aliases created by "ip" do not have any specific name. But
we are lucky, as qemu guest agent detects aliases created by both.

src/qemu/qemu_agent.h:
  * Define qemuAgentGetInterfaces

src/qemu/qemu_agent.c:
  * Implement qemuAgentGetInterface

src/qemu/qemu_driver.c:
  * New function qemuGetDHCPInterfaces
  * New function qemuDomainInterfaceAddresses

src/remote_protocol-sructs:
  * Define new structs

tests/qemuagenttest.c:
  * Add new test: testQemuAgentGetInterfaces
    Test cases for IP aliases, 0 or multiple ipv4/ipv6 address(es)

Signed-off-by: Nehal J Wani <nehaljw.kkd1@gmail.com>
2015-03-17 15:15:38 +00:00
Nehal J Wani
71546d1798 domifaddr: Implement the remote protocol
daemon/remote.c
   * Define remoteSerializeDomainInterface, remoteDispatchDomainInterfaceAddresses

src/remote/remote_driver.c
   * Define remoteDomainInterfaceAddresses

src/remote/remote_protocol.x
   * New RPC procedure: REMOTE_PROC_DOMAIN_INTERFACE_ADDRESSES
   * Define structs remote_domain_ip_addr, remote_domain_interface,
     remote_domain_interfaces_addresse_args, remote_domain_interface_addresses_ret
   * Introduce upper bounds (to handle DoS attacks):
     REMOTE_DOMAIN_INTERFACE_MAX = 2048
     REMOTE_DOMAIN_IP_ADDR_MAX = 2048
     Restrictions on the maximum number of aliases per interface were
     removed after kernel v2.0, and theoretically, at present, there
     are no upper limits on number of interfaces per virtual machine
     and on the number of IP addresses per interface.

src/remote_protocol-structs
   * New structs added

Signed-off-by: Nehal J Wani <nehaljw.kkd1@gmail.com>
2015-03-17 15:15:38 +00:00
Nehal J Wani
5b5242a7cb domifaddr: Implement the public APIs
Define helper function virDomainInterfaceFree, which allows
the upper layer application to free the domain interface object
conveniently.

The API is going to provide multiple methods by flags, e.g.
  * Query guest agent
  * Parse DHCP lease file

include/libvirt/libvirt-domain.h
  * Define virDomainInterfaceAddresses, virDomainInterfaceFree
  * Define structs virDomainInterface, virDomainIPAddress

src/driver-hypervisor.h:
  * Define domainInterfaceAddresses

src/libvirt-domain.c:
  * Implement virDomainInterfaceAddresses
  * Implement virDomainInterfaceFree

src/libvirt_public.syms:
  * Export the new symbols

Signed-off-by: Nehal J Wani <nehaljw.kkd1@gmail.com>
2015-03-17 15:15:38 +00:00
Maxim Nestratov
b980c34dec parallels: fix home directory for VMs
Failures of parallelsStorageOpen occured because we incorrectly treated
path to VM' configuration file as a directory. Now initialization of
parallels VM domains home directory is fixed.

Signed-off-by: Maxim Nestratov <mnestratov@parallels.com>
2015-03-17 15:42:49 +01:00
Maxim Nestratov
2765fb72bd parallels: don't forget to unlock domain if unregister fails
Signed-off-by: Maxim Nestratov <mnestratov@parallels.com>
2015-03-17 15:35:05 +01:00
Mikhail Feoktistov
7bf69e0208 parallels: set cpu mode when applying xml configuration
Otherwise exporting existing domain config and defining a new one like this:
virsh -c parallels:///system dumpxml instance01 > my.xml
virsh -c parallels:///system define my.xml
leads to an error because PCS default x64 mode turns to x32.
Thus, we need to set correct cpuMode in prlsdkDoApplyConfig() explicitly.

Signed-off-by: Mikhail Feoktistov <mfeoktistov@parallels.com>
Signed-off-by: Maxim Nestratov <mnestratov@parallels.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2015-03-17 15:34:59 +01:00
Martin Kletzander
ad69e8be4a conf: Use correct type for balloon stats period
We're parsing memballoon status period as unsigned int, but when we're
trying to set it, both we and qemu use signed int.  That means large
values will get wrapped around to negative one resulting in error.
Basically the same problem as commit e3a7b874 was dealing with when
updating live domain.

QEMU changed the accepted value to int64 in commit 1f9296b5, but even
values as INT_MAX don't make sense since the value passed means seconds.
Hence adding capability flag for this change isn't worth it.

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

Signed-off-by: Luyao Huang <lhuang@redhat.com>
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2015-03-17 12:06:14 +01:00
Martin Kletzander
4fca30e0bd qemu: Don't duplicate errors when settings stats period
In order not to leave old error messages set, this patch refactors the
code so the error is reported only when acted upon.  The only such place
already rewrites any error, so cleaning up all the error reporting in
qemuMonitorSetMemoryStatsPeriod() is enough.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2015-03-17 12:03:34 +01:00