[libvirt] [PATCHv2] virsh: avoid uninitialized memory usage
by Alex Jia
Detected by valgrind.
* tools/virsh.c (cmdBlockPull): fix uninitialized memory usage.
* How to reproduce?
$ qemu-img create /var/lib/libvirt/images/test 1M
$ cat > /tmp/test.xml <<EOF
<domain type='qemu'>
<name>test</name>
<memory>219200</memory>
<vcpu>1</vcpu>
<os>
<type arch='x86_64'>hvm</type>
<boot dev='hd'/>
</os>
<devices>
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/var/lib/libvirt/images/test'/>
<target dev='vda' bus='virtio'/>
</disk>
<input type='mouse' bus='ps2'/>
<graphics type='spice' autoport='yes' listen='0.0.0.0'/>
</devices>
</domain>
EOF
$ virsh define /tmp/test.xml
$ valgrind -v virsh blockpull test /var/lib/libvirt/images/test --wait
actual result:
==10906== 1 errors in context 1 of 1:
==10906== Syscall param rt_sigaction(act->sa_flags) points to uninitialised byte(s)
==10906== at 0x39CF80F5BE: __libc_sigaction (sigaction.c:67)
==10906== by 0x43016C: cmdBlockPull (virsh.c:7638)
==10906== by 0x4150D4: vshCommandRun (virsh.c:18574)
==10906== by 0x425E73: main (virsh.c:20178)
==10906== Address 0x7fefffae8 is on thread 1's stack
Signed-off-by: Alex Jia <ajia(a)redhat.com>
---
tools/virsh.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c
index 95ed7bc..4e4ca57 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -7634,6 +7634,7 @@ cmdBlockPull(vshControl *ctl, const vshCmd *cmd)
intCaught = 0;
sig_action.sa_sigaction = vshCatchInt;
+ sig_action.sa_flags = 0;
sigemptyset(&sig_action.sa_mask);
sigaction(SIGINT, &sig_action, &old_sig_action);
--
1.7.1
12 years, 7 months
[libvirt] [RFC][PATCH] Revision for message payload encoding error when adding a large mount of virtio disks
by Chen Hanxiao
From: Chen Hanxiao <chenhanxiao(a)cn.fujitsu.com>
When adding a large number of virtio storage devices to
virtual machine by using 'virsh edit' command, there is
a problem:
When we added more than 190 virtio disks by 'virsh edit'
command, we got a feedback as 'error: Unable to encode
message payload'. In virt-mananger, the same defect occurs
with about 180 virtio disks added.
PCI devices are limited by the virtualized system
architecture. Out of the 32 available PCI devices for a
guest, 4 are not removable. This means there are up to
28 free PCI slots available for additional devices per
guest. Each PCI device in a guest can have up to 8 functions.
One slot kept for network interface, we could add at most
216 (27*8) virtio disks.
The length of xml description with multifuction for one virtio
disk is about 290 characters; In virt-manger, an extra tag
'alias name' will come to the xml description, which would add
about 40 more characters.
So for one xml description, 330 characters would be enough.
A brand new virtual machine with one IDE bus disk needs about
1900 characters for xml description.
In src/remote/remote_protocol.x, there is a limitation for XDR
enoding length as REMOTE_STRING_MAX.
According to the analysis above, at least 73180(1900+216*330)
characters are needed for 216 virtio disks. In the view of
variable length in tag 'source file', so I think it would be
better to extend this limitation from 65536 to 80000.
---
src/remote/remote_protocol.x | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x
index 2d57247..2c8dcbb 100644
--- a/src/remote/remote_protocol.x
+++ b/src/remote/remote_protocol.x
@@ -65,7 +65,7 @@
* This is an arbitrary limit designed to stop the decoder from trying
* to allocate unbounded amounts of memory when fed with a bad message.
*/
-const REMOTE_STRING_MAX = 65536;
+const REMOTE_STRING_MAX = 80000;
/* A long string, which may NOT be NULL. */
typedef string remote_nonnull_string<REMOTE_STRING_MAX>;
--
1.7.1
12 years, 7 months
[libvirt] [test-API 00/14] Reorgnize/refactoring round 3
by Osier Yang
The TODO in round 2 is still not done, but let's get these
cleanups reviewed first.
Osier Yang (14):
Change libvirt-test-api to be executable
Remove NEWS and TODO
Destroy utils/check.py and move the functions into utils/utils.py
Move directory dist to src
Move utils/env_parser.py into src
Improve the comments telling what the scripts does for utils/*.py
Improve more comments to tell what the program does
Remove trainling blank lines for utils/*.sh
Use bash as the interpreter explicitly
Substitute 'guesttype' with 'virt_type'
Update AUTHORS
Rename utils/*.py with consistent naming style
Rename src/logxmlparser.py as src/log_generator.py
Rename 'env.cfg' as 'global.cfg'
AUTHORS | 17 +-
TODO | 4 -
cases/consumption_cpu_topology.conf | 2 +-
cases/consumption_domain_nfs_start.conf | 2 +-
cases/consumption_eventhandler.conf | 2 +-
cases/consumption_libvirtd.conf | 2 +-
cases/consumption_ownership_test.conf | 2 +-
cases/domain_linux_net_inst.conf | 4 +-
cases/linux_domain.conf | 10 +-
cases/migration/ssh_persistent_paused_no_dst.conf | 24 +-
.../migration/ssh_persistent_paused_with_dst.conf | 48 ++--
cases/migration/ssh_persistent_running_no_dst.conf | 24 +-
.../migration/ssh_persistent_running_with_dst.conf | 48 ++--
cases/migration/ssh_transient_paused_no_dst.conf | 22 +-
cases/migration/ssh_transient_paused_with_dst.conf | 48 ++--
cases/migration/ssh_transient_running_no_dst.conf | 24 +-
.../migration/ssh_transient_running_with_dst.conf | 48 ++--
cases/migration/tcp_persistent_paused_no_dst.conf | 24 +-
.../migration/tcp_persistent_paused_with_dst.conf | 48 ++--
cases/migration/tcp_persistent_running_no_dst.conf | 24 +-
.../migration/tcp_persistent_running_with_dst.conf | 48 ++--
.../tcp_sasl_persistent_paused_no_dst.conf | 8 +-
.../tcp_sasl_persistent_paused_with_dst.conf | 16 +-
.../tcp_sasl_persistent_running_no_dst.conf | 8 +-
.../tcp_sasl_persistent_running_with_dst.conf | 16 +-
.../tcp_sasl_transient_paused_no_dst.conf | 8 +-
.../tcp_sasl_transient_paused_with_dst.conf | 16 +-
.../tcp_sasl_transient_running_no_dst.conf | 8 +-
.../tcp_sasl_transient_running_with_dst.conf | 16 +-
cases/migration/tcp_transient_paused_no_dst.conf | 22 +-
cases/migration/tcp_transient_paused_with_dst.conf | 48 ++--
cases/migration/tcp_transient_running_no_dst.conf | 24 +-
.../migration/tcp_transient_running_with_dst.conf | 48 ++--
cases/migration/tls_persistent_paused_no_dst.conf | 24 +-
.../migration/tls_persistent_paused_with_dst.conf | 48 ++--
cases/migration/tls_persistent_running_no_dst.conf | 24 +-
.../migration/tls_persistent_running_with_dst.conf | 48 ++--
.../tls_sasl_persistent_paused_no_dst.conf | 8 +-
.../tls_sasl_persistent_paused_with_dst.conf | 16 +-
.../tls_sasl_persistent_running_no_dst.conf | 8 +-
.../tls_sasl_persistent_running_with_dst.conf | 16 +-
.../tls_sasl_transient_paused_no_dst.conf | 8 +-
.../tls_sasl_transient_paused_with_dst.conf | 16 +-
.../tls_sasl_transient_running_no_dst.conf | 8 +-
.../tls_sasl_transient_running_with_dst.conf | 16 +-
cases/migration/tls_transient_paused_no_dst.conf | 22 +-
cases/migration/tls_transient_paused_with_dst.conf | 48 ++--
cases/migration/tls_transient_running_no_dst.conf | 24 +-
.../migration/tls_transient_running_with_dst.conf | 48 ++--
cases/snapshot.conf | 2 +-
cases/windows_domain.conf | 8 +-
.../en-US/Understanding_libvirt-test-API.xml | 4 +-
.../en-US/Writing_a_test_case.xml | 10 +-
env.cfg => global.cfg | 0
libvirt-test-api | 24 +-
repos/domain/attach_disk.py | 6 +-
repos/domain/attach_interface.py | 4 +-
repos/domain/balloon_memory.py | 2 +-
repos/domain/create.py | 6 +-
repos/domain/define.py | 18 +-
repos/domain/detach_disk.py | 6 +-
repos/domain/detach_interface.py | 4 +-
repos/domain/dump.py | 2 +-
repos/domain/install_image.py | 14 +-
repos/domain/install_linux_cdrom.py | 28 +-
repos/domain/install_linux_check.py | 27 +-
repos/domain/install_linux_net.py | 32 +-
repos/domain/install_windows_cdrom.py | 22 +-
repos/domain/migrate.py | 2 +-
repos/domain/update_devflag.py | 8 +-
repos/interface/create.py | 2 +-
repos/interface/define.py | 4 +-
repos/interface/destroy.py | 2 +-
repos/interface/undefine.py | 2 +-
repos/network/create.py | 4 +-
repos/network/define.py | 4 +-
repos/npiv/create_virtual_hba.py | 4 +-
.../multiple_thread_block_on_domain_create.py | 12 +-
repos/snapshot/file_flag.py | 3 +-
repos/snapshot/flag_check.py | 3 +-
repos/snapshot/internal_create.py | 4 +-
repos/storage/activate_pool.py | 2 +-
repos/storage/create_dir_pool.py | 4 +-
repos/storage/create_dir_volume.py | 4 +-
repos/storage/create_fs_pool.py | 8 +-
repos/storage/create_iscsi_pool.py | 4 +-
repos/storage/create_logical_volume.py | 4 +-
repos/storage/create_netfs_pool.py | 8 +-
repos/storage/create_netfs_volume.py | 4 +-
repos/storage/create_partition_volume.py | 4 +-
repos/storage/define_dir_pool.py | 4 +-
repos/storage/define_disk_pool.py | 4 +-
repos/storage/define_iscsi_pool.py | 4 +-
repos/storage/define_logical_pool.py | 4 +-
repos/storage/define_mpath_pool.py | 4 +-
repos/storage/define_netfs_pool.py | 4 +-
repos/storage/define_scsi_pool.py | 4 +-
repos/storage/delete_partition_volume.py | 2 +-
repos/storage/destroy_pool.py | 2 +-
{dist => src/dist}/__init__.py | 0
{dist => src/dist}/redhat/__init__.py | 0
{dist => src/dist}/redhat/env_inspect.py | 5 +-
{utils => src}/env_parser.py | 6 +-
src/exception.py | 9 +-
src/generator.py | 8 +-
src/{logxmlparser.py => log_generator.py} | 9 +-
src/parser.py | 6 +-
src/process.py | 7 +-
utils/check.py | 392 --------------------
utils/dev_num.sh | 5 +-
utils/disk_num.sh | 5 +-
utils/format.py | 6 +-
utils/ipget.sh | 2 +-
utils/log.py | 6 +-
utils/utils.py | 362 ++++++++++++++++++
utils/{xmlbuilder.py => xml_builder.py} | 62 ++--
utils/{xmlgenerator.py => xml_generator.py} | 70 ++--
utils/{XMLParser.py => xml_parser.py} | 13 +-
118 files changed, 1175 insertions(+), 1240 deletions(-)
delete mode 100644 NEWS
delete mode 100644 TODO
rename env.cfg => global.cfg (100%)
mode change 100644 => 100755 libvirt-test-api
rename {dist => src/dist}/__init__.py (100%)
rename {dist => src/dist}/redhat/__init__.py (100%)
rename {dist => src/dist}/redhat/env_inspect.py (97%)
rename {utils => src}/env_parser.py (96%)
rename src/{logxmlparser.py => log_generator.py} (97%)
delete mode 100644 utils/check.py
rename utils/{xmlbuilder.py => xml_builder.py} (88%)
rename utils/{xmlgenerator.py => xml_generator.py} (95%)
rename utils/{XMLParser.py => xml_parser.py} (95%)
Regards,
Osier
--
1.7.7.3
12 years, 7 months
[libvirt] [PATCH] conf: remove redundant ()
by Eric Blake
I almost copied-and-pasted some redundant () into my new code,
and figured a general cleanup prereq patch would be better instead.
* src/conf/domain_conf.c (virDomainLeaseDefParseXML)
(virDomainDiskDefParseXML, virDomainFSDefParseXML)
(virDomainActualNetDefParseXML, virDomainNetDefParseXML)
(virDomainGraphicsDefParseXML, virDomainVideoAccelDefParseXML)
(virDomainVideoDefParseXML, virDomainHostdevFind)
(virDomainControllerInsertPreAlloced, virDomainDefParseXML)
(virDomainObjParseXML, virDomainCpuSetFormat)
(virDomainCpuSetParse, virDomainDiskDefFormat)
(virDomainActualNetDefFormat, virDomainNetDefFormat)
(virDomainTimerDefFormat, virDomainGraphicsListenDefFormat)
(virDomainDefFormatInternal, virDomainNetGetActualHostdev)
(virDomainNetGetActualBandwidth, virDomainGraphicsGetListen):
Reduce extra (), per coding styles.
---
This touches enough lines that I won't claim it to be trivial, but
it should have no semantic impact.
src/conf/domain_conf.c | 210 +++++++++++++++++++++++------------------------
1 files changed, 103 insertions(+), 107 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 8f352ea..0d87970 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -3233,14 +3233,13 @@ virDomainLeaseDefParseXML(xmlNodePtr node)
cur = node->children;
while (cur != NULL) {
if (cur->type == XML_ELEMENT_NODE) {
- if ((key == NULL) &&
- (xmlStrEqual(cur->name, BAD_CAST "key"))) {
+ if (!key && xmlStrEqual(cur->name, BAD_CAST "key")) {
key = (char *)xmlNodeGetContent(cur);
- } else if ((lockspace == NULL) &&
- (xmlStrEqual(cur->name, BAD_CAST "lockspace"))) {
+ } else if (!lockspace &&
+ xmlStrEqual(cur->name, BAD_CAST "lockspace")) {
lockspace = (char *)xmlNodeGetContent(cur);
- } else if ((path == NULL) &&
- (xmlStrEqual(cur->name, BAD_CAST "target"))) {
+ } else if (!path &&
+ xmlStrEqual(cur->name, BAD_CAST "target")) {
path = virXMLPropString(cur, "path");
offset = virXMLPropString(cur, "offset");
}
@@ -3355,8 +3354,8 @@ virDomainDiskDefParseXML(virCapsPtr caps,
cur = node->children;
while (cur != NULL) {
if (cur->type == XML_ELEMENT_NODE) {
- if ((source == NULL && hosts == NULL) &&
- (xmlStrEqual(cur->name, BAD_CAST "source"))) {
+ if (!source && !hosts &&
+ xmlStrEqual(cur->name, BAD_CAST "source")) {
sourceNode = cur;
@@ -3433,8 +3432,8 @@ virDomainDiskDefParseXML(virCapsPtr caps,
those broken apps */
if (source && STREQ(source, ""))
VIR_FREE(source);
- } else if ((target == NULL) &&
- (xmlStrEqual(cur->name, BAD_CAST "target"))) {
+ } else if (!target &&
+ xmlStrEqual(cur->name, BAD_CAST "target")) {
target = virXMLPropString(cur, "dev");
bus = virXMLPropString(cur, "bus");
tray = virXMLPropString(cur, "tray");
@@ -3444,8 +3443,8 @@ virDomainDiskDefParseXML(virCapsPtr caps,
if (target &&
STRPREFIX(target, "ioemu:"))
memmove(target, target+6, strlen(target)-5);
- } else if ((driverName == NULL) &&
- (xmlStrEqual(cur->name, BAD_CAST "driver"))) {
+ } else if (!driverName &&
+ xmlStrEqual(cur->name, BAD_CAST "driver")) {
driverName = virXMLPropString(cur, "name");
driverType = virXMLPropString(cur, "type");
cachetag = virXMLPropString(cur, "cache");
@@ -3579,8 +3578,8 @@ virDomainDiskDefParseXML(virCapsPtr caps,
cur);
if (encryption == NULL)
goto error;
- } else if ((serial == NULL) &&
- (xmlStrEqual(cur->name, BAD_CAST "serial"))) {
+ } else if (!serial &&
+ xmlStrEqual(cur->name, BAD_CAST "serial")) {
serial = (char *)xmlNodeGetContent(cur);
} else if (xmlStrEqual(cur->name, BAD_CAST "boot")) {
/* boot is parsed as part of virDomainDeviceInfoParseXML */
@@ -4099,8 +4098,8 @@ virDomainFSDefParseXML(xmlNodePtr node,
cur = node->children;
while (cur != NULL) {
if (cur->type == XML_ELEMENT_NODE) {
- if ((source == NULL) &&
- (xmlStrEqual(cur->name, BAD_CAST "source"))) {
+ if (!source &&
+ xmlStrEqual(cur->name, BAD_CAST "source")) {
if (def->type == VIR_DOMAIN_FS_TYPE_MOUNT)
source = virXMLPropString(cur, "dir");
@@ -4110,12 +4109,12 @@ virDomainFSDefParseXML(xmlNodePtr node,
source = virXMLPropString(cur, "dev");
else if (def->type == VIR_DOMAIN_FS_TYPE_TEMPLATE)
source = virXMLPropString(cur, "name");
- } else if ((target == NULL) &&
- (xmlStrEqual(cur->name, BAD_CAST "target"))) {
+ } else if (!target &&
+ xmlStrEqual(cur->name, BAD_CAST "target")) {
target = virXMLPropString(cur, "dir");
} else if (xmlStrEqual(cur->name, BAD_CAST "readonly")) {
def->readonly = 1;
- } else if ((fsdriver == NULL) && (xmlStrEqual(cur->name, BAD_CAST "driver"))) {
+ } else if (!fsdriver && xmlStrEqual(cur->name, BAD_CAST "driver")) {
fsdriver = virXMLPropString(cur, "type");
wrpolicy = virXMLPropString(cur, "wrpolicy");
}
@@ -4261,8 +4260,8 @@ virDomainActualNetDefParseXML(xmlNodePtr node,
*/
addrtype = virXPathString("string(./source/address/@type)", ctxt);
/* if not explicitly stated, source/vendor implies usb device */
- if ((!addrtype) && virXPathNode("./source/vendor", ctxt) &&
- ((addrtype = strdup("usb")) == NULL)) {
+ if (!addrtype && virXPathNode("./source/vendor", ctxt) &&
+ (addrtype = strdup("usb")) == NULL) {
virReportOOMError();
goto error;
}
@@ -4361,61 +4360,60 @@ virDomainNetDefParseXML(virCapsPtr caps,
cur = node->children;
while (cur != NULL) {
if (cur->type == XML_ELEMENT_NODE) {
- if ((macaddr == NULL) &&
- (xmlStrEqual(cur->name, BAD_CAST "mac"))) {
+ if (!macaddr && xmlStrEqual(cur->name, BAD_CAST "mac")) {
macaddr = virXMLPropString(cur, "address");
- } else if ((network == NULL) &&
- (def->type == VIR_DOMAIN_NET_TYPE_NETWORK) &&
- (xmlStrEqual(cur->name, BAD_CAST "source"))) {
+ } else if (!network &&
+ def->type == VIR_DOMAIN_NET_TYPE_NETWORK &&
+ xmlStrEqual(cur->name, BAD_CAST "source")) {
network = virXMLPropString(cur, "network");
portgroup = virXMLPropString(cur, "portgroup");
- } else if ((internal == NULL) &&
- (def->type == VIR_DOMAIN_NET_TYPE_INTERNAL) &&
- (xmlStrEqual(cur->name, BAD_CAST "source"))) {
+ } else if (!internal &&
+ def->type == VIR_DOMAIN_NET_TYPE_INTERNAL &&
+ xmlStrEqual(cur->name, BAD_CAST "source")) {
internal = virXMLPropString(cur, "name");
- } else if ((network == NULL) &&
- (def->type == VIR_DOMAIN_NET_TYPE_BRIDGE) &&
- (xmlStrEqual(cur->name, BAD_CAST "source"))) {
+ } else if (!network &&
+ def->type == VIR_DOMAIN_NET_TYPE_BRIDGE &&
+ xmlStrEqual(cur->name, BAD_CAST "source")) {
bridge = virXMLPropString(cur, "bridge");
- } else if ((dev == NULL) &&
+ } else if (!dev &&
(def->type == VIR_DOMAIN_NET_TYPE_ETHERNET ||
def->type == VIR_DOMAIN_NET_TYPE_DIRECT) &&
xmlStrEqual(cur->name, BAD_CAST "source")) {
dev = virXMLPropString(cur, "dev");
mode = virXMLPropString(cur, "mode");
- } else if ((virtPort == NULL) &&
- ((def->type == VIR_DOMAIN_NET_TYPE_DIRECT) ||
- (def->type == VIR_DOMAIN_NET_TYPE_NETWORK) ||
- (def->type == VIR_DOMAIN_NET_TYPE_BRIDGE) ||
- (def->type == VIR_DOMAIN_NET_TYPE_HOSTDEV)) &&
+ } else if (!virtPort &&
+ (def->type == VIR_DOMAIN_NET_TYPE_DIRECT ||
+ def->type == VIR_DOMAIN_NET_TYPE_NETWORK ||
+ def->type == VIR_DOMAIN_NET_TYPE_BRIDGE ||
+ def->type == VIR_DOMAIN_NET_TYPE_HOSTDEV) &&
xmlStrEqual(cur->name, BAD_CAST "virtualport")) {
if (!(virtPort = virNetDevVPortProfileParse(cur)))
goto error;
- } else if ((network == NULL) &&
- ((def->type == VIR_DOMAIN_NET_TYPE_SERVER) ||
- (def->type == VIR_DOMAIN_NET_TYPE_CLIENT) ||
- (def->type == VIR_DOMAIN_NET_TYPE_MCAST)) &&
- (xmlStrEqual(cur->name, BAD_CAST "source"))) {
+ } else if (!network &&
+ (def->type == VIR_DOMAIN_NET_TYPE_SERVER ||
+ def->type == VIR_DOMAIN_NET_TYPE_CLIENT ||
+ def->type == VIR_DOMAIN_NET_TYPE_MCAST) &&
+ xmlStrEqual(cur->name, BAD_CAST "source")) {
address = virXMLPropString(cur, "address");
port = virXMLPropString(cur, "port");
- } else if ((address == NULL) &&
+ } else if (!address &&
(def->type == VIR_DOMAIN_NET_TYPE_ETHERNET ||
def->type == VIR_DOMAIN_NET_TYPE_BRIDGE) &&
- (xmlStrEqual(cur->name, BAD_CAST "ip"))) {
+ xmlStrEqual(cur->name, BAD_CAST "ip")) {
address = virXMLPropString(cur, "address");
- } else if ((ifname == NULL) &&
+ } else if (!ifname &&
xmlStrEqual(cur->name, BAD_CAST "target")) {
ifname = virXMLPropString(cur, "dev");
- if ((ifname != NULL) &&
- ((flags & VIR_DOMAIN_XML_INACTIVE) &&
- (STRPREFIX(ifname, VIR_NET_GENERATED_PREFIX)))) {
+ if (ifname &&
+ (flags & VIR_DOMAIN_XML_INACTIVE) &&
+ STRPREFIX(ifname, VIR_NET_GENERATED_PREFIX)) {
/* An auto-generated target name, blank it out */
VIR_FREE(ifname);
}
- } else if ((linkstate == NULL) &&
+ } else if (!linkstate &&
xmlStrEqual(cur->name, BAD_CAST "link")) {
linkstate = virXMLPropString(cur, "state");
- } else if ((script == NULL) &&
+ } else if (!script &&
xmlStrEqual(cur->name, BAD_CAST "script")) {
script = virXMLPropString(cur, "path");
} else if (xmlStrEqual (cur->name, BAD_CAST "model")) {
@@ -4435,9 +4433,9 @@ virDomainNetDefParseXML(virCapsPtr caps,
devaddr = virXMLPropString(cur, "devaddr");
} else if (xmlStrEqual(cur->name, BAD_CAST "boot")) {
/* boot is parsed as part of virDomainDeviceInfoParseXML */
- } else if ((actual == NULL) &&
+ } else if (!actual &&
(flags & VIR_DOMAIN_XML_INTERNAL_ACTUAL_NET) &&
- (def->type == VIR_DOMAIN_NET_TYPE_NETWORK) &&
+ def->type == VIR_DOMAIN_NET_TYPE_NETWORK &&
xmlStrEqual(cur->name, BAD_CAST "actual")) {
if (virDomainActualNetDefParseXML(cur, ctxt, def,
&actual, flags) < 0) {
@@ -4598,7 +4596,7 @@ virDomainNetDefParseXML(virCapsPtr caps,
def->data.direct.linkdev = dev;
dev = NULL;
- if ((flags & VIR_DOMAIN_XML_INACTIVE))
+ if (flags & VIR_DOMAIN_XML_INACTIVE)
VIR_FREE(ifname);
break;
@@ -4614,7 +4612,7 @@ virDomainNetDefParseXML(virCapsPtr caps,
*/
addrtype = virXPathString("string(./source/address/@type)", ctxt);
/* if not explicitly stated, source/vendor implies usb device */
- if ((!addrtype) && virXPathNode("./source/vendor", ctxt) &&
+ if (!addrtype && virXPathNode("./source/vendor", ctxt) &&
((addrtype = strdup("usb")) == NULL)) {
virReportOOMError();
goto error;
@@ -4660,8 +4658,8 @@ virDomainNetDefParseXML(virCapsPtr caps,
if (def->model && STREQ(def->model, "virtio")) {
if (backend != NULL) {
int name;
- if (((name = virDomainNetBackendTypeFromString(backend)) < 0) ||
- (name == VIR_DOMAIN_NET_BACKEND_TYPE_DEFAULT)) {
+ if ((name = virDomainNetBackendTypeFromString(backend)) < 0 ||
+ name == VIR_DOMAIN_NET_BACKEND_TYPE_DEFAULT) {
virDomainReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown interface <driver name='%s'> "
"has been specified"),
@@ -4672,8 +4670,8 @@ virDomainNetDefParseXML(virCapsPtr caps,
}
if (txmode != NULL) {
int m;
- if (((m = virDomainNetVirtioTxModeTypeFromString(txmode)) < 0) ||
- (m == VIR_DOMAIN_NET_VIRTIO_TX_MODE_DEFAULT)) {
+ if ((m = virDomainNetVirtioTxModeTypeFromString(txmode)) < 0 ||
+ m == VIR_DOMAIN_NET_VIRTIO_TX_MODE_DEFAULT) {
virDomainReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown interface <driver txmode='%s'> "
"has been specified"),
@@ -5772,8 +5770,8 @@ virDomainGraphicsListenDefParseXML(virDomainGraphicsListenDefPtr def,
* type='network' and we're looking at live XML (i.e. *not*
* inactive). It is otherwise ignored. */
if (address && address[0] &&
- ((def->type == VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS) ||
- ((def->type == VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NETWORK) &&
+ (def->type == VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS ||
+ (def->type == VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NETWORK &&
!(flags & VIR_DOMAIN_XML_INACTIVE)))) {
def->address = address;
address = NULL;
@@ -5836,9 +5834,9 @@ virDomainGraphicsDefParseXML(xmlNodePtr node,
goto error;
}
- if ((def->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC) ||
- (def->type == VIR_DOMAIN_GRAPHICS_TYPE_RDP) ||
- (def->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE)) {
+ if (def->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC ||
+ def->type == VIR_DOMAIN_GRAPHICS_TYPE_RDP ||
+ def->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE) {
/* parse the <listen> subelements for graphics types that support it */
nListens = virXPathNodeSet("./listen", ctxt, &listenNodes);
@@ -6548,7 +6546,7 @@ virDomainVideoAccelDefParseXML(const xmlNodePtr node) {
cur = node->children;
while (cur != NULL) {
if (cur->type == XML_ELEMENT_NODE) {
- if ((support3d == NULL) && (support2d == NULL) &&
+ if (!support3d && !support2d &&
xmlStrEqual(cur->name, BAD_CAST "acceleration")) {
support3d = virXMLPropString(cur, "accel3d");
support2d = virXMLPropString(cur, "accel2d");
@@ -6557,7 +6555,7 @@ virDomainVideoAccelDefParseXML(const xmlNodePtr node) {
cur = cur->next;
}
- if ((support3d == NULL) && (support2d == NULL))
+ if (!support3d && !support2d)
return NULL;
if (VIR_ALLOC(def) < 0) {
@@ -6603,7 +6601,7 @@ virDomainVideoDefParseXML(const xmlNodePtr node,
cur = node->children;
while (cur != NULL) {
if (cur->type == XML_ELEMENT_NODE) {
- if ((type == NULL) && (vram == NULL) && (heads == NULL) &&
+ if (!type && !vram && !heads &&
xmlStrEqual(cur->name, BAD_CAST "model")) {
type = virXMLPropString(cur, "type");
vram = virXMLPropString(cur, "vram");
@@ -6990,32 +6988,32 @@ virDomainHostdevFind(virDomainDefPtr def,
virDomainHostdevDefPtr compare = def->hostdevs[i];
virDomainHostdevSubsysPtr c_subsys = &compare->source.subsys;
- if ((compare->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) ||
- (c_subsys->type != m_subsys->type)) {
+ if (compare->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS ||
+ c_subsys->type != m_subsys->type) {
continue;
}
switch (m_subsys->type)
{
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
- if ((c_subsys->u.pci.domain == m_subsys->u.pci.domain) &&
- (c_subsys->u.pci.bus == m_subsys->u.pci.bus) &&
- (c_subsys->u.pci.slot == m_subsys->u.pci.slot) &&
- (c_subsys->u.pci.function == m_subsys->u.pci.function)) {
+ if (c_subsys->u.pci.domain == m_subsys->u.pci.domain &&
+ c_subsys->u.pci.bus == m_subsys->u.pci.bus &&
+ c_subsys->u.pci.slot == m_subsys->u.pci.slot &&
+ c_subsys->u.pci.function == m_subsys->u.pci.function) {
*found = compare;
}
break;
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
if (m_subsys->u.usb.bus && m_subsys->u.usb.device) {
/* specified by bus location on host */
- if ((c_subsys->u.usb.bus == m_subsys->u.usb.bus) &&
- (c_subsys->u.usb.device == m_subsys->u.usb.device)) {
+ if (c_subsys->u.usb.bus == m_subsys->u.usb.bus &&
+ c_subsys->u.usb.device == m_subsys->u.usb.device) {
*found = compare;
}
} else {
/* specified by product & vendor id */
- if ((c_subsys->u.usb.product == m_subsys->u.usb.product) &&
- (c_subsys->u.usb.vendor == m_subsys->u.usb.vendor)) {
+ if (c_subsys->u.usb.product == m_subsys->u.usb.product &&
+ c_subsys->u.usb.vendor == m_subsys->u.usb.vendor) {
*found = compare;
}
}
@@ -7249,8 +7247,8 @@ void virDomainControllerInsertPreAlloced(virDomainDefPtr def,
for (i = (def->ncontrollers - 1) ; i >= 0 ; i--) {
/* If bus matches and current controller is after
* new controller, then new controller should go here */
- if ((def->controllers[i]->type == controller->type) &&
- (def->controllers[i]->idx > controller->idx)) {
+ if (def->controllers[i]->type == controller->type &&
+ def->controllers[i]->idx > controller->idx) {
insertAt = i;
} else if (def->controllers[i]->type == controller->type &&
insertAt == -1) {
@@ -7673,7 +7671,7 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
}
if (!(flags & VIR_DOMAIN_XML_INACTIVE))
- if ((virXPathLong("string(./@id)", ctxt, &id)) < 0)
+ if (virXPathLong("string(./@id)", ctxt, &id) < 0)
id = -1;
def->id = (int)id;
@@ -7988,7 +7986,7 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
cur = nodes[0]->children;
while (cur != NULL) {
if (cur->type == XML_ELEMENT_NODE) {
- if ((xmlStrEqual(cur->name, BAD_CAST "memory"))) {
+ if (xmlStrEqual(cur->name, BAD_CAST "memory")) {
tmp = virXMLPropString(cur, "nodeset");
if (tmp) {
@@ -8397,9 +8395,9 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
def->nets[def->nnets++] = net;
/* <interface type='hostdev'> must also be in the hostdevs array */
- if ((net->type == VIR_DOMAIN_NET_TYPE_HOSTDEV) &&
- (virDomainHostdevInsert(def, &net->data.hostdev.def) < 0)) {
- goto no_memory;
+ if (net->type == VIR_DOMAIN_NET_TYPE_HOSTDEV &&
+ virDomainHostdevInsert(def, &net->data.hostdev.def) < 0) {
+ goto no_memory;
}
}
VIR_FREE(nodes);
@@ -8985,7 +8983,7 @@ static virDomainObjPtr virDomainObjParseXML(virCapsPtr caps,
virDomainObjSetState(obj, state, reason);
- if ((virXPathLong("string(./@pid)", ctxt, &val)) < 0) {
+ if (virXPathLong("string(./@pid)", ctxt, &val) < 0) {
virDomainReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("invalid pid"));
goto error;
@@ -10275,7 +10273,7 @@ virDomainCpuSetFormat(char *cpuset, int maxcpu)
int start, cur;
int first = 1;
- if ((cpuset == NULL) || (maxcpu <= 0) || (maxcpu > 100000))
+ if (!cpuset || maxcpu <= 0 || maxcpu > 100000)
return NULL;
cur = 0;
@@ -10339,8 +10337,7 @@ virDomainCpuSetParse(const char *str, char sep,
int i, start, last;
int neg = 0;
- if ((str == NULL) || (cpuset == NULL) || (maxcpu <= 0) ||
- (maxcpu > 100000))
+ if (!str || !cpuset || maxcpu <= 0 || maxcpu > 100000)
return -1;
cur = str;
@@ -10353,7 +10350,7 @@ virDomainCpuSetParse(const char *str, char sep,
cpuset[i] = 0;
ret = 0;
- while ((*cur != 0) && (*cur != sep)) {
+ while (*cur != 0 && *cur != sep) {
/*
* 3 constructs are allowed:
* - N : a single CPU number
@@ -10371,7 +10368,7 @@ virDomainCpuSetParse(const char *str, char sep,
if (start < 0)
goto parse_error;
virSkipSpaces(&cur);
- if ((*cur == ',') || (*cur == 0) || (*cur == sep)) {
+ if (*cur == ',' || *cur == 0 || *cur == sep) {
if (neg) {
if (cpuset[start] == 1) {
cpuset[start] = 0;
@@ -10403,7 +10400,7 @@ virDomainCpuSetParse(const char *str, char sep,
cur++;
virSkipSpaces(&cur);
neg = 0;
- } else if ((*cur == 0) || (*cur == sep)) {
+ } else if (*cur == 0 || *cur == sep) {
break;
} else
goto parse_error;
@@ -10842,7 +10839,7 @@ virDomainDiskDefFormat(virBufferPtr buf,
def->dst, bus);
if ((def->device == VIR_DOMAIN_DISK_DEVICE_FLOPPY ||
def->device == VIR_DOMAIN_DISK_DEVICE_CDROM) &&
- (def->tray_status != VIR_DOMAIN_DISK_TRAY_CLOSED))
+ def->tray_status != VIR_DOMAIN_DISK_TRAY_CLOSED)
virBufferAsprintf(buf, " tray='%s'/>\n",
virDomainDiskTrayTypeToString(def->tray_status));
else
@@ -11138,7 +11135,7 @@ virDomainActualNetDefFormat(virBufferPtr buf,
}
virBufferAsprintf(buf, " <actual type='%s'", type);
- if ((def->type == VIR_DOMAIN_NET_TYPE_HOSTDEV) &&
+ if (def->type == VIR_DOMAIN_NET_TYPE_HOSTDEV &&
def->data.hostdev.def.managed) {
virBufferAddLit(buf, " managed='yes'");
}
@@ -11223,7 +11220,7 @@ virDomainNetDefFormat(virBufferPtr buf,
}
virBufferAsprintf(buf, " <interface type='%s'", type);
- if ((def->type == VIR_DOMAIN_NET_TYPE_HOSTDEV) &&
+ if (def->type == VIR_DOMAIN_NET_TYPE_HOSTDEV &&
def->data.hostdev.def.managed) {
virBufferAddLit(buf, " managed='yes'");
}
@@ -11879,9 +11876,8 @@ virDomainTimerDefFormat(virBufferPtr buf,
}
}
- if ((def->catchup.threshold == 0)
- && (def->catchup.slew == 0)
- && (def->catchup.limit == 0)) {
+ if (def->catchup.threshold == 0 && def->catchup.slew == 0 &&
+ def->catchup.limit == 0) {
virBufferAddLit(buf, "/>\n");
} else {
virBufferAddLit(buf, ">\n");
@@ -11941,8 +11937,8 @@ virDomainGraphicsListenDefFormat(virBufferPtr buf,
}
if (def->address &&
- ((def->type == VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS) ||
- ((def->type == VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NETWORK) &&
+ (def->type == VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS ||
+ (def->type == VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NETWORK &&
!(flags & VIR_DOMAIN_XML_INACTIVE)))) {
/* address may also be set to show current status when type='network',
* but we don't want to print that if INACTIVE data is requested. */
@@ -12719,8 +12715,8 @@ virDomainDefFormatInternal(virDomainDefPtr def,
* hostdev in a higher-level device (e.g. virDomainNetDef),
* and will have already been formatted there.
*/
- if ((def->hostdevs[n]->parent.type == VIR_DOMAIN_DEVICE_NONE) &&
- (virDomainHostdevDefFormat(buf, def->hostdevs[n], flags) < 0)) {
+ if (def->hostdevs[n]->parent.type == VIR_DOMAIN_DEVICE_NONE &&
+ virDomainHostdevDefFormat(buf, def->hostdevs[n], flags) < 0) {
goto cleanup;
}
}
@@ -14615,8 +14611,8 @@ virDomainNetGetActualHostdev(virDomainNetDefPtr iface)
{
if (iface->type == VIR_DOMAIN_NET_TYPE_HOSTDEV)
return &iface->data.hostdev.def;
- if ((iface->type == VIR_DOMAIN_NET_TYPE_NETWORK) &&
- (iface->data.network.actual->type == VIR_DOMAIN_NET_TYPE_HOSTDEV)) {
+ if (iface->type == VIR_DOMAIN_NET_TYPE_NETWORK &&
+ iface->data.network.actual->type == VIR_DOMAIN_NET_TYPE_HOSTDEV) {
return &iface->data.network.actual->data.hostdev.def;
}
return NULL;
@@ -14653,7 +14649,7 @@ virDomainNetGetActualVirtPortProfile(virDomainNetDefPtr iface)
virNetDevBandwidthPtr
virDomainNetGetActualBandwidth(virDomainNetDefPtr iface)
{
- if ((iface->type == VIR_DOMAIN_NET_TYPE_NETWORK) &&
+ if (iface->type == VIR_DOMAIN_NET_TYPE_NETWORK &&
iface->data.network.actual && iface->data.network.actual->bandwidth) {
return iface->data.network.actual->bandwidth;
}
@@ -14668,9 +14664,9 @@ virDomainNetGetActualBandwidth(virDomainNetDefPtr iface)
static virDomainGraphicsListenDefPtr
virDomainGraphicsGetListen(virDomainGraphicsDefPtr def, size_t ii, bool force0)
{
- if ((def->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC) ||
- (def->type == VIR_DOMAIN_GRAPHICS_TYPE_RDP) ||
- (def->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE)) {
+ if (def->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC ||
+ def->type == VIR_DOMAIN_GRAPHICS_TYPE_RDP ||
+ def->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE) {
if (!def->listens && (ii == 0) && force0) {
if (VIR_ALLOC(def->listens) < 0)
--
1.7.7.6
12 years, 7 months
[libvirt] [PATCHv2 0/3] tighten up integer parsing
by Eric Blake
v1: https://www.redhat.com/archives/libvir-list/2012-April/msg00954.html
changes in v2: fix regression in patch 1, incomplete change in patch 2
Eric Blake (3):
virsh: avoid strtol
conf: tighten up XML integer parsing
build: avoid strtol and strtod
cfg.mk | 14 ++++++++++
src/conf/domain_conf.c | 24 ++++++++++-------
src/conf/storage_conf.c | 7 +++--
src/util/util.c | 14 +++++-----
src/util/virmacaddr.c | 2 +-
src/util/xml.c | 36 +++----------------------
tools/virsh.c | 67 ++++++++++++++---------------------------------
7 files changed, 64 insertions(+), 100 deletions(-)
--
1.7.7.6
12 years, 7 months
[libvirt] [PATCH] Improve on virAtomic implementation
by Stefan Berger
This patch improves on the previously added virAtomicInt operations
by testing for the compiler and if GCC >= 4.1 (not found in docs prior to
that) is used on Linux and has the appropriate processor (that I have
access to) then use the implementation based on the gcc-builtins.
I also did not look at other systems (cygwin, win32) that do not need
access to virAtomic right now.
---
src/util/viratomic.h | 88
+++++++++++++++++++++++++++++++++++++++++----------
1 file changed, 72 insertions(+), 16 deletions(-)
Index: libvirt-acl/src/util/viratomic.h
===================================================================
--- libvirt-acl.orig/src/util/viratomic.h
+++ libvirt-acl/src/util/viratomic.h
@@ -30,6 +30,22 @@
typedef struct _virAtomicInt virAtomicInt;
typedef virAtomicInt *virAtomicIntPtr;
+# define __VIR_ATOMIC_USES_LOCK
+
+# if defined(__GNUC__)
+# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ > 4)
+# if defined(__linux__)
+# if defined(__i386__) || defined(__x86_64__) || \
+ defined(__powerpc64__) || defined(__powerpc__)
+# undef __VIR_ATOMIC_USES_LOCK
+# endif
+# endif
+# endif
+# endif
+
+
+# ifdef __VIR_ATOMIC_USES_LOCK
+
struct _virAtomicInt {
virMutex lock;
int value;
@@ -42,22 +58,6 @@ virAtomicIntInit(virAtomicIntPtr vaip)
return virMutexInit(&vaip->lock);
}
-static inline void
-virAtomicIntSet(virAtomicIntPtr vaip, int value)
-{
- virMutexLock(&vaip->lock);
-
- vaip->value = value;
-
- virMutexUnlock(&vaip->lock);
-}
-
-static inline int
-virAtomicIntRead(virAtomicIntPtr vaip)
-{
- return vaip->value;
-}
-
static inline int
virAtomicIntAdd(virAtomicIntPtr vaip, int add)
{
@@ -88,4 +88,60 @@ virAtomicIntSub(virAtomicIntPtr vaip, in
return ret;
}
+# else /* __VIR_ATOMIC_USES_LOCK */
+
+struct _virAtomicInt {
+ int value;
+};
+
+static inline int
+virAtomicIntInit(virAtomicIntPtr vaip)
+{
+ vaip->value = 0;
+ return 0;
+}
+
+static inline int
+virAtomicIntAdd(virAtomicIntPtr vaip, int add)
+{
+ return __sync_add_and_fetch(&vaip->value, add);
+}
+
+static inline int
+virAtomicIntSub(virAtomicIntPtr vaip, int sub)
+{
+ return __sync_sub_and_fetch(&vaip->value, sub);
+}
+
+# endif /* __VIR_ATOMIC_USES_LOCK */
+
+
+
+/* common operations that need no locking or build on others */
+
+
+static inline void
+virAtomicIntSet(virAtomicIntPtr vaip, int value)
+{
+ vaip->value = value;
+}
+
+static inline int
+virAtomicIntRead(virAtomicIntPtr vaip)
+{
+ return *(volatile int *)&vaip->value;
+}
+
+static inline int
+virAtomicIntInc(virAtomicIntPtr vaip)
+{
+ return virAtomicIntAdd(vaip, 1);
+}
+
+static inline int
+virAtomicIntDec(virAtomicIntPtr vaip)
+{
+ return virAtomicIntSub(vaip, 1);
+}
+
#endif /* __VIR_ATOMIC_H */
12 years, 7 months
[libvirt] [PATCH 0/2 v3 use qemu's dump-guest-meory when vm uses host device
by Wen Congyang
Currently, we use migrate to dump guest's memory. There is one
restriction in migrate command: the device's status should be
stored in qemu because the device's status should be passed to
target machine.
If we passthrough a host device to guest, the device's status
is stored in the real device. So migrate command will fail.
We usually use dump when guest is panicked. So there is no need
to store device's status in the vmcore.
qemu will have a new monitor command dump-guest-memory to dump
guest memory, but it doesn't support async now(it will support
later when the common async API is implemented).
So I use dump-guest-memory only when the guest uses host device
in this patchset.
Note: the patchset for qemu is still queued. Luiz has acked,
but he waits an ACK from Jan and/or Anthony. They are too busy,
and donot reply.
Changes from v2 to v3:
1. qemu supports the fd that is associated with a pipe, socket, or FIFO.
So pass a pipe fd to qemu and O_DIRECT can work now.
Change from v1 to v2:
1. remove the implemention for text mode.
Wen Congyang (2):
qemu: implement qemu's dump-guest-memory
qemu: try to use qemu's dump-guest-meory when vm uses host device
src/qemu/qemu_domain.c | 1 +
src/qemu/qemu_domain.h | 1 +
src/qemu/qemu_driver.c | 39 +++++++++++++++++++++++++++++++++++++--
src/qemu/qemu_monitor.c | 36 ++++++++++++++++++++++++++++++++++++
src/qemu/qemu_monitor.h | 13 +++++++++++++
src/qemu/qemu_monitor_json.c | 42 ++++++++++++++++++++++++++++++++++++++++++
src/qemu/qemu_monitor_json.h | 7 +++++++
7 files changed, 137 insertions(+), 2 deletions(-)
12 years, 7 months
[libvirt] [PATCH V11 0/7] Add DHCP snooping support to nwfilter
by Stefan Berger
This series of patches adds DHCP snooping support to libvirt's
nwfilter subsystem.
DHCP snooping detects DHCP leases obtained by a VM and automatically
adjusts the network traffic filters to reflect the IP addresses
with which a VM may send its traffic, thus for example preventing
IP address spoofing.
Once leases on IP addresses expire or if a VM gives up on a
lease on an IP address, the filters are also adjusted.
All leases are persisted and automatically applied upon a VM's restart.
Leases are associated with the tuple of VM-UUID and interface MAC
address.
The following interface XML activates and uses the DHCP snooping:
<interface type='bridge'>
<source bridge='virbr0'/>
<filterref filter='clean-traffic'>
<parameter name='ip_learning' value='dhcp'/>
</filterref>
</interface>
Once an IP address has been detected on an interface, 'virsh dumpxml <vm>'
would show the IP address lease in the format <IP address>,<lease timeout
in seconds>:
<interface type='bridge'>
<source bridge='virbr0'/>
<filterref filter='clean-traffic'>
<parameter name='ip_learning' value='dhcp'/>
<parameter name='IP_LEASE' value='192.168.122.210,180'/>
</filterref>
</interface>
Regards,
David and Stefan
12 years, 7 months
[libvirt] [PATCH v3 0/9] Add basic driver for Parallels Virtuozzo Server
by Dmitry Guryanov
Parallels Virtuozzo Server is a cloud-ready virtualization
solution that allows users to simultaneously run multiple virtual
machines and containers on the same physical server.
Current name of this product is Parallels Server Bare Metal and
more information about it can be found here -
http://www.parallels.com/products/server/baremetal/sp/.
This driver will work with PVS version 6.0 , beta version
scheduled at 2012 Q2.
Dmitry Guryanov (9):
pvs: add driver skeleton
util: add functions for interating over json object
pvs: add functions to list domains and get info
pvs: implement functions for domain life cycle management
pvs: get info about serial ports
pvs: add support of VNC remote display
pvs: implement virDomainDefineXML operation for existing domains
pvs: add storage driver
pvs: implement VM creation
cfg.mk | 1 +
configure.ac | 23 +
docs/drvpvs.html.in | 28 +
include/libvirt/virterror.h | 1 +
libvirt.spec.in | 7 +
mingw32-libvirt.spec.in | 6 +
po/POTFILES.in | 1 +
src/Makefile.am | 23 +
src/conf/domain_conf.c | 3 +-
src/conf/domain_conf.h | 1 +
src/driver.h | 1 +
src/libvirt.c | 12 +
src/pvs/pvs_driver.c | 1281 +++++++++++++++++++++++++++++++++++++
src/pvs/pvs_driver.h | 75 +++
src/pvs/pvs_storage.c | 1458 +++++++++++++++++++++++++++++++++++++++++++
src/pvs/pvs_utils.c | 143 +++++
src/util/json.c | 30 +
src/util/json.h | 4 +
src/util/virterror.c | 3 +
19 files changed, 3100 insertions(+), 1 deletions(-)
create mode 100644 docs/drvpvs.html.in
create mode 100644 src/pvs/pvs_driver.c
create mode 100644 src/pvs/pvs_driver.h
create mode 100644 src/pvs/pvs_storage.c
create mode 100644 src/pvs/pvs_utils.c
12 years, 7 months