[libvirt] [PATCH] storage: Don't pass 'iso' format to qemu-img
by Cole Robinson
$ virsh vol-clone /tmp/test.iso new.iso
error: Failed to clone vol from test.iso
error: internal error: Child process (/bin/qemu-img convert -f iso -O iso /tmp/test.iso /tmp/new.iso) unexpected exit status 1: qemu-img: Could not open '/tmp/test.iso': Unknown driver 'iso'
Map iso->raw before sending the format value to qemu-img
https://bugzilla.redhat.com/show_bug.cgi?id=972784
https://bugzilla.redhat.com/show_bug.cgi?id=1419395
---
src/storage/storage_util.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c
index 41253b9..bf6f0b3 100644
--- a/src/storage/storage_util.c
+++ b/src/storage/storage_util.c
@@ -1009,6 +1009,8 @@ storageBackendCreateQemuImgSetInput(virStorageVolDefPtr inputvol,
info->inputFormat = inputvol->target.format;
if (inputvol->type == VIR_STORAGE_VOL_BLOCK)
info->inputFormat = VIR_STORAGE_FILE_RAW;
+ if (info->inputFormat == VIR_STORAGE_FILE_ISO)
+ info->inputFormat = VIR_STORAGE_FILE_RAW;
if (!(info->inputFormatStr =
virStorageFileFormatTypeToString(info->inputFormat))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
@@ -1175,6 +1177,9 @@ virStorageBackendCreateQemuImgCmdFromVol(virConnectPtr conn,
if (vol->type == VIR_STORAGE_VOL_BLOCK)
info.format = VIR_STORAGE_FILE_RAW;
+ if (info.format == VIR_STORAGE_FILE_ISO)
+ info.format = VIR_STORAGE_FILE_RAW;
+
if (!(type = virStorageFileFormatTypeToString(info.format))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unknown storage vol type %d"),
--
2.9.3
7 years, 9 months
[libvirt] [PATCH 0/2] Fix a couple of Coverity found issues from recent patches
by John Ferlan
The virsysinfo changes caused Coverity to "take another look" at the code
and it found some issues. Each is described in the patch commit.
John Ferlan (2):
util: Resource some resource leaks in virsysinfo code
util: Avoid possible NULL dereference in virSysinfoParsePPCProcessor
src/util/virsysinfo.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
--
2.9.3
7 years, 9 months
[libvirt] [PATCH 0/4] Refactor and fix sysinfo data retrieval and the testing of the code
by Peter Krempa
src/util/virsysinfo.c was a big mess of conditionally compiled functions with
the same name for each platform. Also the test was run only for the current
platform. Remove the churn and make all tests run on all platforms since there
is no platform dependency.
Peter Krempa (4):
util: sysinfo: Reduce amount of conditionally compiled code
tests: sysinfo: Export virSysinfoSetup via the private header
tests: sysinfo: Run all sysinfo tests all the time
tests: sysinfo: Add test data for HP moonshot aarch64 box
src/Makefile.am | 2 +-
src/libvirt_private.syms | 7 +
src/util/virsysinfo.c | 172 ++++++++++++-----------
src/util/virsysinfopriv.h | 44 ++++++
tests/sysinfodata/aarch64-moonshotcpuinfo.data | 72 ++++++++++
tests/sysinfodata/aarch64-moonshotsysinfo.expect | 1 +
tests/sysinfotest.c | 115 ++++-----------
7 files changed, 241 insertions(+), 172 deletions(-)
create mode 100644 src/util/virsysinfopriv.h
create mode 100644 tests/sysinfodata/aarch64-moonshotcpuinfo.data
create mode 100644 tests/sysinfodata/aarch64-moonshotsysinfo.expect
--
2.11.0
7 years, 9 months
[libvirt] [PATCH] libvirt: document UNDEFINE_KEEP_NVRAM in UndefineFlags docs
by Cole Robinson
---
src/libvirt-domain.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index 619a9fc..749297f 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -6287,9 +6287,9 @@ virDomainUndefine(virDomainPtr domain)
* whether this flag is present. On hypervisors where snapshots do
* not use libvirt metadata, this flag has no effect.
*
- * If the domain has any nvram specified, then including
- * VIR_DOMAIN_UNDEFINE_NVRAM will also remove that file, and omitting the flag
- * will cause the undefine process to fail.
+ * If the domain has any nvram specified, the undefine process will fail
+ * unless VIR_DOMAIN_UNDEFINE_KEEP_NVRAM is specified, or if
+ * VIR_DOMAIN_UNDEFINE_NVRAM is specified to remove the nvram file.
*
* Returns 0 in case of success, -1 in case of error
*/
--
2.9.3
7 years, 9 months
[libvirt] [PATH V10 00/12] Support cache tune in libvirt
by Eli Qiao
Addressed comment from v9 -> v8
Marcelo:
* Improve default schemata calculate, support allocate from low schemata bits for other APP.
Addressed comment from v9 -> v8
Marcelo:
* New public API to query cache usage
Eli:
* Fix core dump while multiple tasks are added.
Addressed comment from v8 -> v7
Martin:
* Patch subject prefix.
* Move some of cpu related information to virhostcpu.c.
* Fix some memory leak in src/utils/resctrl.c
Martin & Marcelo:
* Don't remove directories which are not maintained by libvirt.
Addressed comment from v7 -> v6
Marcelo:
* Fix flock usage while VM initialization.
Addressed comment from v6 -> v5
Marcelo:
* Support other APPs to operate /sys/fs/resctrl at same time
Libvirt will scan /sys/fs/resctrl again before doing cache allocation.
patch 10 will address this.
Addressed comment from v4 -> v5:
Marcelo:
* Several typos
* Use flock instead of virFileLock
Addressed comment from v3 -> v4:
Daniel & Marcelo:
* Added concurrence support
Addressed comment from v2 -> v3:
Daniel:
* Fixed coding style, passed `make check` and `make syntax-check`
* Variables renaming and move from header file to c file.
* For locking/mutex support, no progress.
There are some discussion from mailing list, but I can not find a better
way to add locking support without performance impact.
I'll explain the process and please help to advice what shoud we do.
VM create:
1) Get the cache left value on each bank of the host. This should be
shared amount all VMs.
2) Calculate the schemata on the bank based on all created resctrl
domain's schemata
3) Calculate the default schemata by scaning all domain's schemata.
4) Flush default schemata to /sys/fs/resctrl/schemata
VM destroy:
1) Remove the resctrl domain of that VM
2) Recalculate default schemata
3) Flush default schemata to /sys/fs/resctrl/schemata
The key point is that all VMs shares /sys/fs/resctrl/schemata, and
when a VM create a resctrl domain, the schemata of that VM depends on
the default schemata and all other exsited schematas. So a global
mutex is reqired.
Before calculate a schemata or update default schemata, libvirt
should gain this global mutex.
I will try to think more about how to support this gracefully in next
patch set.
Marcelo:
* Added vcpu support for cachetune, this will allow user to define which
vcpu using which cache allocation bank.
<cachetune id='0' host_id=0 size='3072' unit='KiB' vcpus='0,1'/>
vcpus is a cpumap, the vcpu pids will be added to tasks file
* Added cdp compatible, user can specify l3 cache even host enable cdp.
See patch 8.
On a cdp enabled host, specify l3code/l3data by
<cachetune id='0' host_id='0' type='l3' size='3072' unit='KiB'/>
This will create a schemata like:
L3data:0=0xff00;...
L3code:0=0xff00;...
* Would you please help to test if the functions work.
Martin:
* Xml test case, I have no time to work on this yet, would you please
show me an example, would like to amend it later.
This series patches are for supportting CAT featues, which also
called cache tune in libvirt.
First to expose cache information which could be tuned in capabilites XML.
Then add new domain xml element support to add cacahe bank which will apply
on this libvirt domain.
This series patches add a util file `resctrl.c/h`, an interface to talk with
linux kernel's system fs.
There are still one TODO left:
1. Expose a new public interface to get free cache information.
2. Expose a new public interface to set cachetune lively.
Some discussion about this feature support can be found from:
https://www.redhat.com/archives/libvir-list/2017-January/msg00644.html
Eli Qiao (12):
Resctrl: Add some utils functions
Resctrl: expose cache information to capabilities
Resctrl: Add new xml element to support cache tune
Resctrl: Add private interfaces to operate cache bank
Qemu: Set cache tune while booting a new domain.
Resctrl: enable l3code/l3data
Resctrl: Make sure l3data/l3code are pairs
Resctrl: Compatible mode for cdp enabled
Resctrl: concurrence support
Resctrl: Scan resctrl before doing cache allocation
Resctrl: Add Public API for nodecachestats
Resctrl: Add nodecachestats
daemon/remote.c | 67 +++
docs/schemas/domaincommon.rng | 46 ++
include/libvirt/libvirt-host.h | 32 ++
include/libvirt/virterror.h | 1 +
po/POTFILES.in | 1 +
src/Makefile.am | 1 +
src/conf/capabilities.c | 56 ++
src/conf/capabilities.h | 23 +
src/conf/domain_conf.c | 182 +++++++
src/conf/domain_conf.h | 19 +
src/driver-hypervisor.h | 7 +
src/libvirt-host.c | 41 ++
src/libvirt_private.syms | 12 +
src/libvirt_public.syms | 1 +
src/nodeinfo.c | 64 +++
src/nodeinfo.h | 1 +
src/qemu/qemu_capabilities.c | 8 +
src/qemu/qemu_driver.c | 18 +
src/qemu/qemu_process.c | 54 ++
src/remote/remote_driver.c | 52 ++
src/remote/remote_protocol.x | 25 +-
src/remote_protocol-structs | 16 +
src/util/virerror.c | 1 +
src/util/virhostcpu.c | 186 ++++++-
src/util/virhostcpu.h | 6 +
src/util/virresctrl.c | 1098 ++++++++++++++++++++++++++++++++++++++++
src/util/virresctrl.h | 96 ++++
tools/virsh-host.c | 49 ++
28 files changed, 2145 insertions(+), 18 deletions(-)
create mode 100644 src/util/virresctrl.c
create mode 100644 src/util/virresctrl.h
--
1.9.1
7 years, 9 months
[libvirt] [PATCH] vz: correct error message
by Mikhail Feoktistov
---
src/vz/vz_sdk.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
index e16bb0c..84e89a5 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -2601,8 +2601,10 @@ prlsdkCheckUnsupportedParams(PRL_HANDLE sdkdom, virDomainDefPtr def)
def->onCrash != VIR_DOMAIN_LIFECYCLE_CRASH_DESTROY) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("on_reboot, on_poweroff and on_crash parameters "
- "are not supported by vz driver"));
+ _("The following parameters must be "
+ "on_reboot = restart, on_poweroff = destroy, "
+ "on_crash = destroy. "
+ "Different actions are not supported by vz driver"));
return -1;
}
--
1.8.3.1
7 years, 9 months
[libvirt] [PATCH] Document preferred naming conventions
by Daniel P. Berrange
This documents the preferred conventions for naming files,
structs, enums, typedefs and functions.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
HACKING | 71 ++++++++++++++++++++++++++++++++++++++++++++
docs/hacking.html.in | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++
docs/hacking2.xsl | 4 +++
3 files changed, 158 insertions(+)
diff --git a/HACKING b/HACKING
index fff003b..16be5cf 100644
--- a/HACKING
+++ b/HACKING
@@ -239,6 +239,77 @@ on the subject, on Richard Jones' guide to working with open source projects
<http://people.redhat.com/rjones/how-to-supply-code-to-open-source-projects/>.
+Naming conventions
+==================
+When reading libvirt code, a number of different naming conventions will be
+evident due to various changes in thinking over the course of the project's
+lifetime. The conventions documented below should be followed when creating
+any entirely new files in libvirt. When working on existing files, while it is
+desirable to apply these conventions, keeping a consistent style with existing
+code in that particular file is generally more important. The overall guiding
+rule is that every file, enum, struct, function, and typedef name must have a
+'vir' or 'VIR' prefix. All local scope variable names are exempt, and global
+variables are exempt, unless exported in a header file.
+
+*File names*
+
+File naming varies depending on the subdirectory. The preferred style is to
+have a 'vir' prefix, followed by a name which matches the name of the
+functions / objects inside the file. For example, a file containing an object
+'virHashtable' is stored in files 'virhashtable.c' and 'virhashtable.h'.
+Sometimes, methods which would otherwise be declared 'static' need to be
+exported for use by a test suite. For this purpose a second header file should
+be added with a suffix of 'priv'. e.g. 'virhashtablepriv.h'. USe of
+underscores in file names is discouraged when using the 'vir' prefix style.
+The 'vir' prefix naming applies to src/util, src/rpc and tests/ directories.
+Most other directories do not follow this convention.
+
+
+
+*Enum type & field names*
+
+All enums should have a 'vir' prefix in their typedef name, and each following
+word should have its first letter in uppercase. The enum name should match the
+typedef name with a leading underscore. The enum member names should be in all
+uppercase, and use an underscore to separate each word. The enum member name
+prefix should match the enum typedef name.
+
+ typedef enum _virSocketType virSocketType;
+ enum _virSocketType {
+ VIR_SOCKET_TYPE_IPV4,
+ VIR_SOCKET_TYPE_IPV6,
+ };
+
+
+*Struct type names*
+
+All structs should have a 'vir' prefix in their typedef name, and each
+following word should have its first letter in uppercase. The struct name
+should be the same as the typedef name with a leading underscore. A second
+typedef should be given for a pointer to the struct with a 'Ptr' suffix.
+
+ typedef struct _virHashTable virHashTable;
+ typedef virHashTable *virHashTablePtr;
+ struct _virHashTable {
+ ...
+ };
+
+
+*Function names*
+
+All functions should have a 'vir' prefix in their name, followed by one or
+more words with first letter of each word capitalized. Underscores should not
+be used in function names. If the function is operating on an object, then the
+function name prefix should match the object typedef name. For example, given
+an object 'virHashTable', all functions should have a name 'virHashTableXXXX'
+e.g. 'virHashTableLookup'. If there is no object associated with the function,
+then its name prefix should match the filename. For example, given a filename
+of 'virfile.h', all functions should have a name 'virFileXXXX' e.g.
+'virFileTouch'.
+
+
+
+
Code indentation
================
Libvirt's C source code generally adheres to some basic code-formatting
diff --git a/docs/hacking.html.in b/docs/hacking.html.in
index b1bb149..028536d 100644
--- a/docs/hacking.html.in
+++ b/docs/hacking.html.in
@@ -314,6 +314,89 @@
Richard Jones' guide to working with open source projects</a>.
</p>
+ <h2><a name="naming">Naming conventions</a></h2>
+
+ <p>
+ When reading libvirt code, a number of different naming conventions will
+ be evident due to various changes in thinking over the course of the
+ project's lifetime. The conventions documented below should be followed
+ when creating any entirely new files in libvirt. When working on existing
+ files, while it is desirable to apply these conventions, keeping a
+ consistent style with existing code in that particular file is generally
+ more important. The overall guiding rule is that every file, enum, struct,
+ function, and typedef name must have a 'vir' or 'VIR' prefix. All local
+ scope variable names are exempt, and global variables are exempt, unless
+ exported in a header file.
+ </p>
+
+ <dl>
+ <dt>File names</dt>
+ <dd>
+ <p>
+ File naming varies depending on the subdirectory. The preferred
+ style is to have a 'vir' prefix, followed by a name which matches
+ the name of the functions / objects inside the file. For example,
+ a file containing an object 'virHashtable' is stored in files
+ 'virhashtable.c' and 'virhashtable.h'. Sometimes, methods which
+ would otherwise be declared 'static' need to be exported for use
+ by a test suite. For this purpose a second header file should be
+ added with a suffix of 'priv'. e.g. 'virhashtablepriv.h'. USe of
+ underscores in file names is discouraged when using the 'vir'
+ prefix style. The 'vir' prefix naming applies to src/util,
+ src/rpc and tests/ directories. Most other directories do not
+ follow this convention.
+ </p>
+ </dd>
+ <dt>Enum type & field names</dt>
+ <dd>
+ <p>
+ All enums should have a 'vir' prefix in their typedef name,
+ and each following word should have its first letter in
+ uppercase. The enum name should match the typedef name with
+ a leading underscore. The enum member names should be in all
+ uppercase, and use an underscore to separate each word. The
+ enum member name prefix should match the enum typedef name.
+ </p>
+ <pre>
+ typedef enum _virSocketType virSocketType;
+ enum _virSocketType {
+ VIR_SOCKET_TYPE_IPV4,
+ VIR_SOCKET_TYPE_IPV6,
+ };</pre>
+ </dd>
+ <dt>Struct type names</dt>
+ <dd>
+ <p>
+ All structs should have a 'vir' prefix in their typedef name,
+ and each following word should have its first letter in
+ uppercase. The struct name should be the same as the typedef
+ name with a leading underscore. A second typedef should be
+ given for a pointer to the struct with a 'Ptr' suffix.
+ </p>
+ <pre>
+ typedef struct _virHashTable virHashTable;
+ typedef virHashTable *virHashTablePtr;
+ struct _virHashTable {
+ ...
+ };</pre>
+ </dd>
+ <dt>Function names</dt>
+ <dd>
+ <p>
+ All functions should have a 'vir' prefix in their name,
+ followed by one or more words with first letter of each
+ word capitalized. Underscores should not be used in function
+ names. If the function is operating on an object, then the
+ function name prefix should match the object typedef name.
+ For example, given an object 'virHashTable', all functions
+ should have a name 'virHashTableXXXX' e.g. 'virHashTableLookup'.
+ If there is no object associated with the function, then its
+ name prefix should match the filename. For example, given a
+ filename of 'virfile.h', all functions should have a name
+ 'virFileXXXX' e.g. 'virFileTouch'.
+ </p>
+ </dd>
+ </dl>
<h2><a name="indent">Code indentation</a></h2>
<p>
diff --git a/docs/hacking2.xsl b/docs/hacking2.xsl
index 3595b7e..7e5ac82 100644
--- a/docs/hacking2.xsl
+++ b/docs/hacking2.xsl
@@ -114,6 +114,10 @@ from docs/hacking.html.in!
<xsl:template match="html:li/html:ul/html:li">-- <xsl:apply-templates/><xsl:value-of select="$newline"/><xsl:value-of select="$newline"/>
</xsl:template>
+<xsl:template match="html:dl/html:dt">*<xsl:apply-templates/>*<xsl:value-of select="$newline"/><xsl:value-of select="$newline"/>
+</xsl:template>
+<xsl:template match="html:dl/html:dd"><xsl:apply-templates/><xsl:value-of select="$newline"/><xsl:value-of select="$newline"/>
+</xsl:template>
<!-- add newline before nested <ul> -->
--
2.9.3
7 years, 9 months
[libvirt] [PATCH] make all struct typedefs comply with proposed coding conventions
by Laine Stump
Proposed formal coding conventions encourage defining typedefs for
vir[Blah] and vir[Blah]Ptr separately from the associated struct named
_vir[Blah]:
typedef struct _virBlah virBlah;
typedef virBlah *virBlahPtr;
struct _virBlah {
...
};
At some point in the past, I had submitted several patches using a
more compact style that I prefer, and they were accepted:
typedef struct _virBlah {
...
} virBlah, *virBlahPtr;
Since these are by far a minority among all struct definitions, this
patch changes all those definitions to reflect the style prefered by
the proposal so that there is 100% consistency.
---
https://www.redhat.com/archives/libvir-list/2017-March/msg00215.html
Now that we're talking about formalizing the format of struct
definitions, since it was me who tried to make this catch on, it
should be me who takes the time to fix them when they don't catch on
:-P
src/conf/device_conf.h | 60 ++++++++++++++++++++++++++++++---------------
src/conf/network_conf.h | 6 +++--
src/conf/node_device_conf.h | 6 +++--
src/util/virnetdev.h | 6 +++--
src/util/virnetdevip.h | 18 +++++++++-----
5 files changed, 64 insertions(+), 32 deletions(-)
diff --git a/src/conf/device_conf.h b/src/conf/device_conf.h
index f435fb5..a20de85 100644
--- a/src/conf/device_conf.h
+++ b/src/conf/device_conf.h
@@ -51,46 +51,58 @@ typedef enum {
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_LAST
} virDomainDeviceAddressType;
-typedef struct _virDomainDeviceDriveAddress {
+typedef struct _virDomainDeviceDriveAddress virDomainDeviceDriveAddress;
+typedef virDomainDeviceDriveAddress *virDomainDeviceDriveAddressPtr;
+struct _virDomainDeviceDriveAddress {
unsigned int controller;
unsigned int bus;
unsigned int target;
unsigned int unit;
-} virDomainDeviceDriveAddress, *virDomainDeviceDriveAddressPtr;
+};
-typedef struct _virDomainDeviceVirtioSerialAddress {
+typedef struct _virDomainDeviceVirtioSerialAddress virDomainDeviceVirtioSerialAddress;
+typedef virDomainDeviceVirtioSerialAddress *virDomainDeviceVirtioSerialAddressPtr;
+struct _virDomainDeviceVirtioSerialAddress {
unsigned int controller;
unsigned int bus;
unsigned int port;
-} virDomainDeviceVirtioSerialAddress, *virDomainDeviceVirtioSerialAddressPtr;
+};
# define VIR_DOMAIN_DEVICE_CCW_MAX_CSSID 254
# define VIR_DOMAIN_DEVICE_CCW_MAX_SSID 3
# define VIR_DOMAIN_DEVICE_CCW_MAX_DEVNO 65535
-typedef struct _virDomainDeviceCCWAddress {
+typedef struct _virDomainDeviceCCWAddress virDomainDeviceCCWAddress;
+typedef virDomainDeviceCCWAddress *virDomainDeviceCCWAddressPtr;
+struct _virDomainDeviceCCWAddress {
unsigned int cssid;
unsigned int ssid;
unsigned int devno;
bool assigned;
-} virDomainDeviceCCWAddress, *virDomainDeviceCCWAddressPtr;
+};
-typedef struct _virDomainDeviceCcidAddress {
+typedef struct _virDomainDeviceCcidAddress virDomainDeviceCcidAddress;
+typedef virDomainDeviceCcidAddress *virDomainDeviceCcidAddressPtr;
+struct _virDomainDeviceCcidAddress {
unsigned int controller;
unsigned int slot;
-} virDomainDeviceCcidAddress, *virDomainDeviceCcidAddressPtr;
+};
# define VIR_DOMAIN_DEVICE_USB_MAX_PORT_DEPTH 4
-typedef struct _virDomainDeviceUSBAddress {
+typedef struct _virDomainDeviceUSBAddress virDomainDeviceUSBAddress;
+typedef virDomainDeviceUSBAddress *virDomainDeviceUSBAddressPtr;
+struct _virDomainDeviceUSBAddress {
unsigned int bus;
unsigned int port[VIR_DOMAIN_DEVICE_USB_MAX_PORT_DEPTH];
-} virDomainDeviceUSBAddress, *virDomainDeviceUSBAddressPtr;
+};
-typedef struct _virDomainDeviceSpaprVioAddress {
+typedef struct _virDomainDeviceSpaprVioAddress virDomainDeviceSpaprVioAddress;
+typedef virDomainDeviceSpaprVioAddress *virDomainDeviceSpaprVioAddressPtr;
+struct _virDomainDeviceSpaprVioAddress {
unsigned long long reg;
bool has_reg;
-} virDomainDeviceSpaprVioAddress, *virDomainDeviceSpaprVioAddressPtr;
+};
typedef enum {
VIR_DOMAIN_CONTROLLER_MASTER_NONE,
@@ -99,21 +111,29 @@ typedef enum {
VIR_DOMAIN_CONTROLLER_MASTER_LAST
} virDomainControllerMaster;
-typedef struct _virDomainDeviceUSBMaster {
+typedef struct _virDomainDeviceUSBMaster virDomainDeviceUSBMaster;
+typedef virDomainDeviceUSBMaster *virDomainDeviceUSBMasterPtr;
+struct _virDomainDeviceUSBMaster {
unsigned int startport;
-} virDomainDeviceUSBMaster, *virDomainDeviceUSBMasterPtr;
+};
-typedef struct _virDomainDeviceISAAddress {
+typedef struct _virDomainDeviceISAAddress virDomainDeviceISAAddress;
+typedef virDomainDeviceISAAddress *virDomainDeviceISAAddressPtr;
+struct _virDomainDeviceISAAddress {
unsigned int iobase;
unsigned int irq;
-} virDomainDeviceISAAddress, *virDomainDeviceISAAddressPtr;
+};
-typedef struct _virDomainDeviceDimmAddress {
+typedef struct _virDomainDeviceDimmAddress virDomainDeviceDimmAddress;
+typedef virDomainDeviceDimmAddress *virDomainDeviceDimmAddressPtr;
+struct _virDomainDeviceDimmAddress {
unsigned int slot;
unsigned long long base;
-} virDomainDeviceDimmAddress, *virDomainDeviceDimmAddressPtr;
+};
-typedef struct _virDomainDeviceInfo {
+typedef struct _virDomainDeviceInfo virDomainDeviceInfo;
+typedef virDomainDeviceInfo *virDomainDeviceInfoPtr;
+struct _virDomainDeviceInfo {
/* If adding to this struct, ensure that
* virDomainDeviceInfoIsSet() is updated
* to consider the new fields
@@ -147,7 +167,7 @@ typedef struct _virDomainDeviceInfo {
* assignment, never saved and never reported.
*/
int pciConnectFlags; /* enum virDomainPCIConnectFlags */
-} virDomainDeviceInfo, *virDomainDeviceInfoPtr;
+};
int virPCIDeviceAddressIsValid(virPCIDeviceAddressPtr addr,
diff --git a/src/conf/network_conf.h b/src/conf/network_conf.h
index 9e4ae71..dec809e 100644
--- a/src/conf/network_conf.h
+++ b/src/conf/network_conf.h
@@ -127,10 +127,12 @@ struct _virNetworkDNSHostDef {
};
-typedef struct _virNetworkDNSForwarder {
+typedef struct _virNetworkDNSForwarder virNetworkDNSForwarder;
+typedef virNetworkDNSForwarder *virNetworkDNSForwarderPtr;
+struct _virNetworkDNSForwarder {
virSocketAddr addr;
char *domain;
-} virNetworkDNSForwarder, *virNetworkDNSForwarderPtr;
+};
typedef struct _virNetworkDNSDef virNetworkDNSDef;
typedef virNetworkDNSDef *virNetworkDNSDefPtr;
diff --git a/src/conf/node_device_conf.h b/src/conf/node_device_conf.h
index 7aed1f4..cf51c69 100644
--- a/src/conf/node_device_conf.h
+++ b/src/conf/node_device_conf.h
@@ -243,7 +243,9 @@ struct _virNodeDevCapDRM {
virNodeDevDRMType type;
};
-typedef struct _virNodeDevCapData {
+typedef struct _virNodeDevCapData virNodeDevCapData;
+typedef virNodeDevCapData *virNodeDevCapDataPtr;
+struct _virNodeDevCapData {
virNodeDevCapType type;
union {
virNodeDevCapSystem system;
@@ -258,7 +260,7 @@ typedef struct _virNodeDevCapData {
virNodeDevCapSCSIGeneric sg;
virNodeDevCapDRM drm;
};
-} virNodeDevCapData, *virNodeDevCapDataPtr;
+};
typedef struct _virNodeDevCapsDef virNodeDevCapsDef;
typedef virNodeDevCapsDef *virNodeDevCapsDefPtr;
diff --git a/src/util/virnetdev.h b/src/util/virnetdev.h
index c3e8ffc..236cf83 100644
--- a/src/util/virnetdev.h
+++ b/src/util/virnetdev.h
@@ -86,10 +86,12 @@ typedef enum {
VIR_ENUM_DECL(virNetDevIfState)
-typedef struct {
+typedef struct _virNetDevIfLink virNetDevIfLink;
+typedef virNetDevIfLink *virNetDevIfLinkPtr;
+struct _virNetDevIfLink {
virNetDevIfState state; /* link state */
unsigned int speed; /* link speed in Mbits per second */
-} virNetDevIfLink, *virNetDevIfLinkPtr;
+};
typedef enum {
VIR_NET_DEV_FEAT_GRXCSUM,
diff --git a/src/util/virnetdevip.h b/src/util/virnetdevip.h
index 8277654..b7abdf9 100644
--- a/src/util/virnetdevip.h
+++ b/src/util/virnetdevip.h
@@ -25,13 +25,17 @@
# include "virsocketaddr.h"
-typedef struct {
+typedef struct _virNetDevIPAddr virNetDevIPAddr;
+typedef virNetDevIPAddr *virNetDevIPAddrPtr;
+struct _virNetDevIPAddr {
virSocketAddr address; /* ipv4 or ipv6 address */
virSocketAddr peer; /* ipv4 or ipv6 address of peer */
unsigned int prefix; /* number of 1 bits in the netmask */
-} virNetDevIPAddr, *virNetDevIPAddrPtr;
+};
-typedef struct {
+typedef struct _virNetDevIPRoute virNetDevIPRoute;
+typedef virNetDevIPRoute *virNetDevIPRoutePtr;
+struct _virNetDevIPRoute {
char *family; /* ipv4 or ipv6 - default is ipv4 */
virSocketAddr address; /* Routed Network IP address */
@@ -46,15 +50,17 @@ typedef struct {
unsigned int metric; /* value for metric (defaults to 1) */
bool has_metric; /* metric= was specified */
virSocketAddr gateway; /* gateway IP address for ip-route */
-} virNetDevIPRoute, *virNetDevIPRoutePtr;
+};
/* A full set of all IP config info for a network device */
-typedef struct {
+typedef struct _virNetDevIPInfo virNetDevIPInfo;
+typedef virNetDevIPInfo *virNetDevIPInfoPtr;
+ struct _virNetDevIPInfo {
size_t nips;
virNetDevIPAddrPtr *ips;
size_t nroutes;
virNetDevIPRoutePtr *routes;
-} virNetDevIPInfo, *virNetDevIPInfoPtr;
+};
/* manipulating/querying the netdev */
int virNetDevIPAddrAdd(const char *ifname,
--
2.9.3
7 years, 9 months
[libvirt] [PATCH] qemu_capabilities: report SATA bus in domain capabilities
by Pavel Hrdina
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/qemu/qemu_capabilities.c | 4 ++++
tests/domaincapsschemadata/qemu_1.7.0.x86_64.xml | 1 +
tests/domaincapsschemadata/qemu_2.6.0-gicv2-virt.aarch64.xml | 1 +
tests/domaincapsschemadata/qemu_2.6.0-gicv3-virt.aarch64.xml | 1 +
tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml | 1 +
tests/domaincapsschemadata/qemu_2.6.0.ppc64le.xml | 1 +
tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml | 1 +
tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml | 1 +
tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml | 1 +
tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml | 1 +
tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml | 1 +
11 files changed, 14 insertions(+)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 359a0d87a1..5a3b4ac503 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -5422,6 +5422,10 @@ virQEMUCapsFillDomainDeviceDiskCaps(virQEMUCapsPtr qemuCaps,
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_USB_STORAGE))
VIR_DOMAIN_CAPS_ENUM_SET(disk->bus, VIR_DOMAIN_DISK_BUS_USB);
+
+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_ICH9_AHCI))
+ VIR_DOMAIN_CAPS_ENUM_SET(disk->bus, VIR_DOMAIN_DISK_BUS_SATA);
+
return 0;
}
diff --git a/tests/domaincapsschemadata/qemu_1.7.0.x86_64.xml b/tests/domaincapsschemadata/qemu_1.7.0.x86_64.xml
index 4aa475c1e7..1eadba393f 100644
--- a/tests/domaincapsschemadata/qemu_1.7.0.x86_64.xml
+++ b/tests/domaincapsschemadata/qemu_1.7.0.x86_64.xml
@@ -64,6 +64,7 @@
<value>scsi</value>
<value>virtio</value>
<value>usb</value>
+ <value>sata</value>
</enum>
</disk>
<graphics supported='yes'>
diff --git a/tests/domaincapsschemadata/qemu_2.6.0-gicv2-virt.aarch64.xml b/tests/domaincapsschemadata/qemu_2.6.0-gicv2-virt.aarch64.xml
index 76aee83ba1..1fa7f6dff8 100644
--- a/tests/domaincapsschemadata/qemu_2.6.0-gicv2-virt.aarch64.xml
+++ b/tests/domaincapsschemadata/qemu_2.6.0-gicv2-virt.aarch64.xml
@@ -68,6 +68,7 @@
<value>scsi</value>
<value>virtio</value>
<value>usb</value>
+ <value>sata</value>
</enum>
</disk>
<graphics supported='yes'>
diff --git a/tests/domaincapsschemadata/qemu_2.6.0-gicv3-virt.aarch64.xml b/tests/domaincapsschemadata/qemu_2.6.0-gicv3-virt.aarch64.xml
index 104c29fabb..d60fc1df98 100644
--- a/tests/domaincapsschemadata/qemu_2.6.0-gicv3-virt.aarch64.xml
+++ b/tests/domaincapsschemadata/qemu_2.6.0-gicv3-virt.aarch64.xml
@@ -68,6 +68,7 @@
<value>scsi</value>
<value>virtio</value>
<value>usb</value>
+ <value>sata</value>
</enum>
</disk>
<graphics supported='yes'>
diff --git a/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml b/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml
index ca511f48d8..fcc6f50e0e 100644
--- a/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml
+++ b/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml
@@ -68,6 +68,7 @@
<value>scsi</value>
<value>virtio</value>
<value>usb</value>
+ <value>sata</value>
</enum>
</disk>
<graphics supported='yes'>
diff --git a/tests/domaincapsschemadata/qemu_2.6.0.ppc64le.xml b/tests/domaincapsschemadata/qemu_2.6.0.ppc64le.xml
index b3d2d2a7e4..755c4f4475 100644
--- a/tests/domaincapsschemadata/qemu_2.6.0.ppc64le.xml
+++ b/tests/domaincapsschemadata/qemu_2.6.0.ppc64le.xml
@@ -41,6 +41,7 @@
<value>scsi</value>
<value>virtio</value>
<value>usb</value>
+ <value>sata</value>
</enum>
</disk>
<graphics supported='yes'>
diff --git a/tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml b/tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml
index a8975e8e53..843bdc2b73 100644
--- a/tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml
+++ b/tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml
@@ -68,6 +68,7 @@
<value>scsi</value>
<value>virtio</value>
<value>usb</value>
+ <value>sata</value>
</enum>
</disk>
<graphics supported='yes'>
diff --git a/tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml b/tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml
index dd9285311c..962cd0557f 100644
--- a/tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml
+++ b/tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml
@@ -69,6 +69,7 @@
<value>scsi</value>
<value>virtio</value>
<value>usb</value>
+ <value>sata</value>
</enum>
</disk>
<graphics supported='yes'>
diff --git a/tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml b/tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml
index 4c5fffcad4..7d5ac063fa 100644
--- a/tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml
+++ b/tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml
@@ -69,6 +69,7 @@
<value>scsi</value>
<value>virtio</value>
<value>usb</value>
+ <value>sata</value>
</enum>
</disk>
<graphics supported='yes'>
diff --git a/tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml b/tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml
index 573eb4bb6e..413f3fa7ce 100644
--- a/tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml
+++ b/tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml
@@ -98,6 +98,7 @@
<value>scsi</value>
<value>virtio</value>
<value>usb</value>
+ <value>sata</value>
</enum>
</disk>
<graphics supported='yes'>
diff --git a/tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml b/tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml
index b361475d7e..a4ab74dcaf 100644
--- a/tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml
+++ b/tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml
@@ -77,6 +77,7 @@
<value>scsi</value>
<value>virtio</value>
<value>usb</value>
+ <value>sata</value>
</enum>
</disk>
<graphics supported='yes'>
--
2.12.0
7 years, 9 months
[libvirt] [PATCH] Add virsystemdpriv.h to UTIL_SOURCES
by Daniel P. Berrange
Ensure virsystemdpriv.h gets included in dist tarballs.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
Pushed to fix RPM builds
src/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index c85927f..62c8743 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -174,7 +174,7 @@ UTIL_SOURCES = \
util/virstoragefile.c util/virstoragefile.h \
util/virstring.h util/virstring.c \
util/virsysinfo.c util/virsysinfo.h \
- util/virsystemd.c util/virsystemd.h \
+ util/virsystemd.c util/virsystemd.h util/virsystemdpriv.h \
util/virthread.c util/virthread.h \
util/virthreadjob.c util/virthreadjob.h \
util/virthreadpool.c util/virthreadpool.h \
--
2.9.3
7 years, 9 months