Commit Graph

11718 Commits

Author SHA1 Message Date
Cédric Bosdonnat
ec70f3696f Introduce --without-pm-utils to get rid of pm-is-supported dependency
This uses the dbus api of systemd to check the power management
capabilities of the node.
2014-04-11 15:51:10 -06:00
Wojciech Macek
1ee866cf33 bhyve: fix domain management
When domain is not persistent, it should be forgotten upon destroying.
2014-04-11 20:18:44 +04:00
Eric Blake
86cfa1f603 conf: delete useless backingStoreFormat field
Drop another redundant field from virStorageFileMetadata.

* src/util/virstoragefile.h (_virStorageFileMetadata): Drop
field.
* src/util/virstoragefile.c
(virStorageFileGetMetadataFromFDInternal)
(virStorageFileGetMetadataFromFD)
(virStorageFileGetMetadataRecurse): Adjust callers.
* tests/virstoragetest.c (_testFileData, testStorageChain)
(mymain): Simplify test.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-04-10 16:59:26 -06:00
Eric Blake
a4dfc8d31d conf: return backing information separately from metadata
A couple pieces of virStorageFileMetadata are used only while
collecting information about the chain, and don't need to
live permanently in the struct.  This patch refactors external
callers to collect the information separately, so that the
next patch can remove the fields.

* src/util/virstoragefile.h (virStorageFileGetMetadataFromBuf):
Alter signature.
* src/util/virstoragefile.c (virStorageFileGetMetadataInternal):
Likewise.
(virStorageFileGetMetadataFromFDInternal): Adjust callers.
* src/storage/storage_backend_fs.c (virStorageBackendProbeTarget):
Likewise.
* src/storage/storage_backend_gluster.c
(virStorageBackendGlusterRefreshVol): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-04-10 16:56:16 -06:00
Eric Blake
c919ed7ea5 conf: delete useless backingStoreIsFile field
Finally starting to prune away some of the old fields that have
been made redundant by the new fields, on my way towards directly
reusing virStorageSource.

* src/util/virstoragefile.h (_virStorageFileMetadata): Drop
field.
* src/util/virstoragefile.c (virStorageFileGetMetadataInternal)
(virStorageFileChainLookup): Adjust callers.
* tests/virstoragetest.c (_testFileData, testStorageChain)
(mymain): Simplify test.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-04-10 16:39:43 -06:00
Eric Blake
86f71e0a87 conf: expose probe for non-local storage
Deciding if a user string represents a local file instead of a
network path is an operation worth exposing directly, particularly
since the next patch will be removing a redundant variable that
was caching the information.

* src/util/virstoragefile.h (virStorageIsFile): New declaration.
* src/util/virstoragefile.c (virBackingStoreIsFile): Rename...
(virStorageIsFile): ...export, and allow NULL input.
(virStorageFileGetMetadataInternal)
(virStorageFileGetMetadataRecurse, virStorageFileGetMetadata):
Update callers.
* src/conf/domain_conf.c (virDomainDiskDefForeachPath): Use it.
* src/storage/storage_backend_fs.c (virStorageBackendProbeTarget):
Likewise.
* src/libvirt_private.syms (virstoragefile.h): Export function.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-04-10 16:37:01 -06:00
Eric Blake
7010768c5e conf: provide details on network backing store
So far, my work has been merely preserving the status quo of
backing file analysis.  But this patch starts to tread in the
territory of making the backing chain code more powerful - we
will eventually support network storage containing non-raw
formats.  Here, we expose metadata information about a network
backing store, even if that information is still hardcoded to
a raw format for now.

* src/util/virstoragefile.c (virStorageFileGetMetadataRecurse):
Also populate struct for non-file backing.
(virStorageFileGetMetadata, virStorageFileGetMetadatainternal):
Recognize non-file top image.
(virFindBackingFile): Add comment.
(virStorageFileChainGetBroken): Adjust comment, ensure output
is set.
* tests/virstoragetest.c (mymain): Update test to reflect it.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-04-10 16:34:21 -06:00
Jiri Denemark
7eca4a5b32 cpu: Properly check input parameters
Most of the APIs in CPU driver do not expect to get NULL for input
parameters. Let's mark them with ATTRIBUTE_NONNULL and also check for
some members of virCPUDef when the APIs expect them have some specific
values.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2014-04-10 20:31:32 +02:00
Jiri Denemark
a1b1fcdcfe cpu: Add documentation for CPU driver APIs
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2014-04-10 20:31:32 +02:00
Ján Tomko
5dfcd6fbc6 Fix build on mingw32
My commit 897808e added a parameter to virCgroupGetPercpuStats,
but didn't change the stub for systems where cgroups are not supported.
2014-04-09 16:47:26 +02:00
Ján Tomko
2adf59ebde Clean up virCgroupGetPercpuStats
The iterator is checked for being less than or equal to need_cpus.
The 'n' variable is incremented need_cpus + 1 times.

Simplify the computation of need_cpus and make its value one larger,
to let it be used instead of 'n' and compared without the equal sign
in loop conditions.

Just index the sum_cpu_time array instead of using a helper variable.

Start the loop at start_cpu instead of continuing for all lower values.
2014-04-09 16:24:08 +02:00
Ján Tomko
9fe5267ade Check maximum startcpu value correctly
The cpus are indexed from 0, so a startcpu value equal
to the number of CPUs is invalid.

https://bugzilla.redhat.com/show_bug.cgi?id=1070680
2014-04-09 16:24:08 +02:00
Ján Tomko
dd74ab4e82 Rename id, max_id to need_cpus, total_cpus
total_cpus is the total number of CPUs on the host
need_cpus is the number of CPUs we need to look at

(need_cpus can be larger than ncpus, because we need to look
 at CPUs before the startcpu too, even if we aren't reporting
 their stats)
2014-04-09 16:24:08 +02:00
Ján Tomko
897808e74f Extend virCgroupGetPercpuStats to fill in vcputime too
Currently, virCgroupGetPercpuStats is only used by the LXC driver,
filling out the CPUTIME stats. qemuDomainGetPercpuStats does this
and also filles out VCPUTIME stats.

Extend virCgroupGetPercpuStats to also report VCPUTIME stats if
nvcpupids is non-zero. In the LXC driver, we don't have cpupids.
In the QEMU driver, there is at least one cpupid for a running domain,
so the behavior shouldn't change for QEMU either.

Also rename getSumVcpuPercpuStats to virCgroupGetPercpuVcpuSum.
2014-04-09 16:24:08 +02:00
Ján Tomko
23d2d863b7 Fix return value of virCgroupGetPercpuStats
We need to return the number of successfully populated stats,
not the nparams supplied by the user.
2014-04-09 16:24:08 +02:00
Ján Tomko
3e7e6ad6ee Don't require domain obj in qemuDomainGetPercpuStats
All we need is the virCgroupPtr and number of vcpupids.
This will allow the function to be moved to util/vircgroup.c.
2014-04-09 16:24:08 +02:00
Eric Blake
5976a9ac88 conf: track more fields in backing chain metadata
The current use of virStorageFileMetadata is awkward; to learn
some of the information about a child node, you have to read
fields in the parent node.  This does not lend itself well to
modifying backing chains (whether inserting a new node in the
chain, or consolidating existing nodes); better would be to
learn about a child node directly in that node.  This patch
sets up some new fields which contain redundant information,
although not necessarily in the final desired state for the
new fields (see the next patch for actual tests of what is there
now).  Then later patches will do any refactoring necessary to
get the fields to their desired states, and update clients to
get the information from the new fields, so we can finally
delete the fields that are tracking information about the wrong
node.

More concretely, compare these three example backing chains:

good <- one
missing <- two
gluster://server/vol/img <- three

Pre-patch, querying the chains gives:
{ .backingStore = "/path/to/good",
  .backingStoreRaw = "good",
  .backingStoreIsFile = true,
  .backingStoreFormat = VIR_STORAGE_FILE_RAW,
  .backingMeta = {
    .backingStore = NULL,
    .backingStoreRaw = NULL,
    .backingStoreIsFile = false,
    .backingMeta = NULL,
  }
}
{ .backingStore = NULL,
  .backingStoreRaw = "missing",
  .backingStoreIsFile = false,
  .backingStoreFormat = VIR_STORAGE_FILE_NONE,
  .backingMeta = NULL,
}
{ .backingStore = "gluster://server/vol/img",
  .backingStoreRaw = NULL,
  .backingStoreIsFile = false,
  .backingStoreFormat = VIR_STORAGE_FILE_RAW,
  .backingMeta = NULL,
}

Deciding whether to ignore a missing backing file (as in virsh
vol-dumpxml) or report an error (as in security manager sVirt
labeling) requires reading multiple fields.  Plus, the format
is hard-coded to treat all network protocols as end-of-the-chain,
as if they were raw.  By the end of this patch series, the goal
is to instead represent these three situations as:

{ .path = "one",
  .canonPath = "/path/to/one",
  .type = VIR_STORAGE_TYPE_FILE,
  .format = VIR_STORAGE_FILE_QCOW2,
  .backingStoreRaw = "good",
  .backingMeta = {
    .path = "good",
    .canonPath = "/path/to/good",
    .type = VIR_STORAGE_TYPE_FILE,
    .format = VIR_STORAGE_FILE_RAW,
    .backingStoreRaw = NULL,
    .backingMeta = NULL,
  }
}
{ .path = "two",
  .canonPath = "/path/to/two",
  .type = VIR_STORAGE_TYPE_FILE,
  .format = VIR_STORAGE_FILE_QCOW2,
  .backingStoreRaw = "missing",
  .backingMeta = NULL,
}
{ .path = "three",
  .canonPath = "/path/to/three",
  .type = VIR_STORAGE_TYPE_FILE,
  .format = VIR_STORAGE_FILE_QCOW2,
  .backingStoreRaw = "gluster://server/vol/img",
  .backingMeta = {
    .path = "gluster://server/vol/img",
    .canonPath = "gluster://server/vol/img",
    .type = VIR_STORAGE_TYPE_NETWORK,
    .format = VIR_STORAGE_FILE_RAW,
    .backingStoreRaw = NULL,
    .backingMeta = NULL,
  }
}

or, for the second file, maybe also allowing:
{ .path = "two",
  .canonPath = "/path/to/two",
  .type = VIR_STORAGE_TYPE_FILE,
  .format = VIR_STORAGE_FILE_QCOW2,
  .backingStoreRaw = "missing",
  .backingMeta = {
    .path = "missing",
    .canonPath = NULL,
    .type = VIR_STORAGE_TYPE_NONE,
    .format = VIR_STORAGE_FILE_NONE,
    .backingStoreRaw = NULL,
    .backingMeta = NULL,
  }
}

* src/util/virstoragefile.h (_virStorageFileMetadata): Add
path, canonPath, relDir, type, and format fields.  Reorder
existing fields, and add lots of comments.
* src/util/virstoragefile.c (virStorageFileFreeMetadata): Clean
new fields.
(virStorageFileGetMetadataInternal)
(virStorageFileGetMetadataFromFDInternal): Start populating new
fields.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-04-09 07:01:26 -06:00
Eric Blake
43f85b995b conf: earlier allocation during backing chain crawl
Right now, we are allocating virStorageFileMetadata near the bottom
of the callchain, only after we have identified that we are visiting
a file (and not a network resource).  I'm hoping to eventually
support parsing the backing chain from XML, where the backing chain
crawl then validates what was parsed rather than allocating a fresh
structure.  Likewise, I'm working towards a setup where we have a
backing element even for networks.  Both of these use cases are
easier to code if the allocation is hoisted earlier.

* src/util/virstoragefile.c (virStorageFileGetMetadataInternal)
(virStorageFileGetMetadataFromFDInternal): Change signature.
(virStorageFileGetMetadataFromBuf)
(virStorageFileGetMetadataRecurse, virStorageFileGetMetadata):
Update callers.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-04-09 07:01:26 -06:00
Eric Blake
79f11b35c7 conf: track user vs. canonical name through full chain lookup
The previous patch started a separation of error messages
reported against the user-specified name, vs. tracking the
canonical path that was actually opened.  This patch extends
that notion, by hoisting directory detection up front, passing
the canonical path through the entire call chain, and
simplifying lower-level functions that can now assume that
a canonical path and directory have been supplied.

* src/util/virstoragefile.c
(virStorageFileGetMetadataFromFDInternal)
(virStorageFileGetMetadataInternal): Add parameter, require
directory.
(virFindBackingFile): Require directory.
(virStorageFileGetMetadataFromFD): Pass canonical path.
(virStorageFileGetMetadataFromBuf): Likewise.
(virStorageFileGetMetadata): Determine initial directory.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-04-09 07:01:26 -06:00
Peter Krempa
90dbdff2ac qemu: Unexport qemuBuildNetworkDriveURI()
The function isn't used in any other file. Convert it to static.
2014-04-09 14:48:48 +02:00
Peter Krempa
816f0f93ea qemu: Refactor qemuGetDriveSourceString to take virStorageSourcePtr
Refactor the function to avoid multiple wrappers splitting identical
fields from the now common metadata struct.

The refactor is done by folding in the wrapper used for disk sources
which allows us to lookup secrets via the secret driver. This may allow
using stored secrets for snapshot disk images too in the future.
2014-04-09 14:39:34 +02:00
Peter Krempa
cecd656604 storage: Refactor location of metadata for storage drive access to files
Now that we store all metadata about a storage image in a
virStorageSource struct let's use it also to store information needed by
the storage driver to access and do operations on the files.
2014-04-09 14:34:19 +02:00
Peter Krempa
9689dfaad3 storage: Refactor storage file initialization to use virStorageSourcePtr
Now that storage source metadata is stored in a single struct we don't
need two initialization functions for different structs.
2014-04-09 14:31:12 +02:00
Peter Krempa
93c1f2cd70 conf: Refactor helpers to retrieve actual storage type
Now that the storage source definition is uniform convert the helpers to
retrieve the actual storage type to a single one.
2014-04-09 14:20:40 +02:00
John Ferlan
0c2305b31c storage: Don't update pool available/allocation if buildVol fails
https://bugzilla.redhat.com/show_bug.cgi?id=1024159

If adding a volume to a storage pool fails during the CreateXML or
CreateXMLFrom API's, we don't want to adjust the available and
allocation values for the storage pool during storageVolDelete
since we haven't adjusted the values for the create.

Refactor storageVolDelete() a bit to create a storageVolDeleteInternal()
which will handle the primary deletion activities.  Add a parameter
updateMeta which will signify whether to update the values or not.

Adjust the calls from CreateXML and CreateXMLFrom to directly call the
DeleteInternal with the pool lock held.  This does bypass the call
to virStorageVolDeleteEnsureACL().
2014-04-09 06:57:37 -04:00
Eric Blake
af095bfa0d conf: fix detection of infinite backing loop
While trying to refactor the backing file chain, I noticed that
if you have a self-referential qcow2 file via a relative name:

qemu-img create -f qcow2 loop 10M
qemu-img rebase -u -f qcow2 -F qcow2 -b loop loop

then libvirt was creating a chain 2 deep before realizing it
had hit a loop; furthermore, virStorageFileChainCheckBroken
was not identifying the chain as broken.  With this patch,
the loop is detected when the chain is only 1 deep; still
enough for storage volume XML to display the file, but now
with a proper error report about where the loop was found.

This patch adds a parameter to virStorageFileGetMetadataRecurse,
so that errors at the top of the chain remain unchanged; messages
issued for backing files now use the name provided by the user
instead of the canonical name (for VDSM, which uses relative
symlinks to device mapper block devices, this is actually more
useful).

* src/util/virstoragefile.c (virStorageFileGetMetadataRecurse):
Add parameter, require canonical path up front.  Mark chain
broken on OOM or loop detection.
(virStorageFileGetMetadata): Pass in canonical name.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-04-08 13:28:19 -06:00
Jean-Baptiste Rouault
2fe658ad90 vmware: set the driver version
Since commit 7457cbe8 the vmware driver version isn't set anymore.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-04-08 11:16:33 -06:00
Roman Bogorodskiy
b291cb5e90 bhyve: add domain metadata support
Implement domainSetMetadata and domainGetMetadata driver calls.
2014-04-08 20:40:39 +04:00
Roman Bogorodskiy
986a07c709 bhyve: fix ATTRIBUTE_NONNULL usage
Fix incorrect ATTRIBUTE_NONNULL usage introduced in 17b17565
which caused build failure:

bhyve/bhyve_driver.c:127:48: error: expected ')'
bhyveDriverGetCapabilities(bhyveConnPtr driver ATTRIBUTE_NONNULL)
                                               ^
bhyve/bhyve_driver.c:127:27: note: to match this '('
bhyveDriverGetCapabilities(bhyveConnPtr driver ATTRIBUTE_NONNULL)

Pushed under the build breaker rule.
2014-04-08 20:30:23 +04:00
Richard Weinberger
21ec87f4f1 LXC: Fix return code evaulation in lxcCheckNetNsSupport()
Commit b9dd878f (util: make it easier to grab only regular command exit)
changed the call semantics of virCommandRun() and therefore of virRun()
too. But lxcCheckNetNsSupport() was not updated.
As consequence of this lxcCheckNetNsSupport always failed and broke LXC.

Signed-off-by: Richard Weinberger <richard@nod.at>
2014-04-08 09:19:24 -06:00
Ján Tomko
27fbfc2a17 Fix incorrect values in redirdev ABI check error
My commit c9123fb introduced this copy-and-paste error.
2014-04-08 15:08:20 +02:00
Daniel P. Berrange
3f671e6c52 Use a static initializer for static mutexes
Now that we ditched our custom pthread impl for Win32, we can
use PTHREAD_MUTEX_INITIALIZER for static mutexes. This avoids
the need to use a virOnce one-time global initializer in a
number of places.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2014-04-08 13:46:29 +01:00
Daniel P. Berrange
3cfa19da22 Replace Pci with PCI throughout
Since it is an abbreviation, PCI should always be fully
capitalized or full lower case, never Pci.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2014-04-08 11:15:55 +01:00
Daniel P. Berrange
edfe82c7f9 Replace Usb with USB throughout
Since it is an abbreviation, USB should always be fully
capitalized or full lower case, never Usb.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2014-04-08 11:10:59 +01:00
Daniel P. Berrange
21a2446d92 Replace Scsi with SCSI throughout
Since it is an abbreviation, SCSI should always be fully
capitalized or full lower case, never Scsi.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2014-04-08 11:10:31 +01:00
Wangrui (K)
79bef03a2c virNetDev{Replace,Restore}MacAddress: Fix memory leak
Functions virNetDevRestoreMacAddress() and virNetDevRestoreMacAddress()
allocate memory for variable @path using virAsprintf(), but they
haven't freed that memory before returning out.

Signed-off-by: Zhang bo <oscar.zhangbo@huawei.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2014-04-08 10:51:53 +02:00
Michal Privoznik
23419a62c2 bhyveConnectGetCapabilities: Fix double caps unref
At the beginning of the function we gain a reference to the driver
capabilities. Then, we call format function (*) which if failed, unref
over caps is called. Then, at the end another unref occurs.

* - Moreover, the format was not called over gained caps, but over
privconn->caps directly which is not allowed anymore.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2014-04-08 09:17:01 +02:00
Michal Privoznik
17b17565e6 Simplify bhyveDriverGetCapabilities()
The driver passed as the only argument to the function should never be
NULL so there's no need to check it. After removing it, the whole
function collapses to a single line doing ref over driver
capabilities.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2014-04-08 09:17:01 +02:00
Michal Privoznik
87f24f3434 bhyve_capabilities: Add Semihalf to Copyright
Since b15a2bbd we have the new bhyve_capabilities.[ch] files.
However, the copyright is held by both Roman and Semihalf.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2014-04-08 09:17:00 +02:00
Eric Blake
8733303933 conf: avoid memleak on NULL path
I noticed that the apparmor code could request metadata even
for a cdrom with no media, which would cause a memory leak of
the hash table used to look for loops in the backing chain.
But even before that, we blindly dereferenced the path for
printing a debug statement, so it is just better to enforce
that this is only used on non-NULL names.

* src/util/virstoragefile.c (virStorageFileGetMetadata): Assume
non-NULL path.
* src/util/virstoragefile.h: Annotate this.
* src/security/virt-aa-helper.c (get_files): Fix caller.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-04-07 16:31:45 -06:00
Cédric Bosdonnat
8f4ef7e6b6 lxc conf2xml: don't let current vcpus at 0: define won't like it 2014-04-07 10:52:28 -06:00
Wojciech Macek
627d1439c2 bhyve: connectCompareCPU support
Implement support for connectCompareCPU.
2014-04-07 15:34:53 +02:00
Wojciech Macek
b15a2bbd64 bhyve: create capabilities submodule
- Move all capabilities functions to separate file
- Add initCPU
2014-04-07 15:34:53 +02:00
Wojciech Macek
36cf8174b6 bhyve: support for connectBaselineCPU
Implement bhyveConnectBaselineCPU to support OpenStack/Nova
2014-04-07 15:34:53 +02:00
Laine Stump
7284c499e5 interface: dump inactive xml when interface isn't active
Other drivers in libvirt (e.g. network, qemu) will automatically
return the "inactive" (persistent configuration) XML of an object when
that object is inactive. The netcf backend of the interface driver
would always try to return the live status XML of the interface, even
when it was down. Although netcf does return valid XML in that case,
for bond interfaces it is missing almost all of its content, including
the <bond> subelement itself, leading to this error message from
"virsh iface-dumpxml" of a bond interface that is inactive:

  error: XML error: bond interface misses the bond element

(this is because libvirt's validation of the XML returned by netcf
always requires a <bond> element be present).

This patch modifies the interface driver netcf backend to check if the
interface is inactive, and in that case always return the inactive XML
(which will always have a <bond> element, thus eliminating the error
message, as well as making operation more in line with other drivers.

This fixes the following bug:

  https://bugzilla.redhat.com/show_bug.cgi?id=878394
2014-04-07 16:25:40 +03:00
Eric Blake
09567144d6 hash: add common utility functions
I almost wrote a hash value free function that just called
VIR_FREE, then realized I couldn't be the first person to
do that.  Sure enough, it was worth factoring into a common
helper routine.

* src/util/virhash.h (virHashValueFree): New function.
* src/util/virhash.c (virHashValueFree): Implement it.
* src/util/virobject.h (virObjectFreeHashData): New function.
* src/libvirt_private.syms (virhash.h, virobject.h): Export them.
* src/nwfilter/nwfilter_learnipaddr.c (virNWFilterLearnInit): Use
common function.
* src/qemu/qemu_capabilities.c (virQEMUCapsCacheNew): Likewise.
* src/qemu/qemu_command.c (qemuDomainCCWAddressSetCreate):
Likewise.
* src/qemu/qemu_monitor.c (qemuMonitorGetBlockInfo): Likewise.
* src/qemu/qemu_process.c (qemuProcessWaitForMonitor): Likewise.
* src/util/virclosecallbacks.c (virCloseCallbacksNew): Likewise.
* src/util/virkeyfile.c (virKeyFileParseGroup): Likewise.
* tests/qemumonitorjsontest.c
(testQemuMonitorJSONqemuMonitorJSONGetBlockInfo): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-04-07 06:14:45 -06:00
Antoni S. Puimedon
d9de144385 QoS: make tc filters match all traffic
Up until now the traffic control filters for the vNIC QoS were
matching only ip traffic. For egress traffic that was unnoticed
because the unmatched traffic would just go to the default htb class
and be shaped anyway. For ingress, though, since the policing of the
rate is done by the filter itself.

The problem is solved by changing protocol to all and making anything
match the filter.

Bug-Url: https://bugzilla.redhat.com/1084444
Signed-off-by: Antoni S. Puimedon <asegurap@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2014-04-07 11:35:29 +02:00
Roman Bogorodskiy
6c91134de4 bhyve: add console support through nmdm device
nmdm is a FreeBSD driver which allows to create a pair of tty
devices one of which is passed to the guest and second is used
by the client.

This patch adds new 'nmdm' character device type. Its definition
looks this way:

<serial type='nmdm'>
  <source master='/dev/nmdm0A' slave='/dev/nmdm0B'/>
</serial>

Master is passed to the hypervisior and slave is used for client
connection.

Also implement domainOpenConsole() for bhyve driver based on that.
2014-04-05 19:12:18 +04:00
David Shane Holden
6318a80168 bhyve: domain autostart support
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
2014-04-05 14:44:49 +04:00
Eric Blake
9673418ce5 conf: track when storage type is still undetermined
Right now, virStorageFileMetadata tracks bool backingStoreIsFile
for whether the backing string specified in metadata can be
resolved as a file (covering both block and regular file
resources) or is treated as a network protocol.  But when
merging this struct with virStorageSource, it will be easier
to just actually track which type of resource it is, as well
as have a reserved value for the case where the resource type
is unknown (or had an error during probing).

* src/util/virstoragefile.h (virStorageType): Add a placeholder
value, swap order to match similar public enum.
* src/util/virstoragefile.c (virStorage): Update string mapping.
* src/conf/domain_conf.c (virDomainDiskSourceParse)
(virDomainDiskDefParseXML, virDomainDiskDefFormat)
(virDomainDiskSourceFormat): Adjust clients.
* src/conf/snapshot_conf.c (virDomainSnapshotDiskDefParseXML):
Likewise.
* src/qemu/qemu_driver.c
(qemuDomainSnapshotPrepareDiskExternalBackingInactive)
(qemuDomainSnapshotPrepareDiskExternalOverlayActive)
(qemuDomainSnapshotPrepareDiskExternalOverlayInactive)
(qemuDomainSnapshotPrepareDiskInternal)
(qemuDomainSnapshotCreateSingleDiskActive): Likewise.
* src/qemu/qemu_command.c (qemuGetDriveSourceString): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-04-04 10:58:23 -06:00