[libvirt] Missing libxl_device_nic settings
by Kim Larry
Hi,
I was trying to pass ip address to scripts/vif-bridge by putting <ip address=""/> in guest config xml file, however, I found that libxlMakeNic(which located in libxl/libxl_conf.c:956) doesn't set x_nic->ip. So I patched myself but I'm not so sure about VIR_DOMAIN_NET_TYPE_ETHERNET. It seems like vif-route, correct?
Here is my patch:
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 0555b91..0effc59 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -1047,10 +1047,18 @@ libxlMakeNic(virDomainDefPtr def,
if (VIR_STRDUP(x_nic->bridge,
virDomainNetGetActualBridgeName(l_nic)) < 0)
return -1;
- /* fallthrough */
+ if (VIR_STRDUP(x_nic->script, l_nic->script) < 0)
+ return -1;
+ if (VIR_STRDUP(x_nic->ip, l_nic->data.bridge.ipaddr) < 0)
+ return -1;
+ break;
case VIR_DOMAIN_NET_TYPE_ETHERNET:
if (VIR_STRDUP(x_nic->script, l_nic->script) < 0)
return -1;
+ if (VIR_STRDUP(x_nic->ip, l_nic->data.ethernet.ipaddr) < 0)
+ return -1;
+ if (VIR_STRDUP(x_nic->gatewaydev, l_nic->data.ethernet.dev) < 0)
+ return -1;
break;
case VIR_DOMAIN_NET_TYPE_NETWORK:
{
Regards,
Jihoon
9 years, 10 months
[libvirt] libvirt domXML -> libxl_domain_config conversion testing
by Jim Fehlig
Hi All,
I've been attempting to revive the libvirt domXML -> libxl_domain_config
tests originally started by Daniel all the way back in May!
https://www.redhat.com/archives/libvir-list/2014-May/msg01102.html
In a reply to patch5 of the series, Ian Campbell noted that the doc
produced by libxl_domain_config_to_json() may change as new config is
added, defaults changed, etc. Some suggestions for coping with this
included
1. json template files per libxl version
2. a new API in libvirt's json toolbox to compare json docs (with ability
to control the comparison, e.g. ignore certain content)
3. make use of new functionality in Xen 4.5 such as
libxl_domain_config_from_json() and libxl_domain_config_compare()
Option 1 is simple-minded.
Option 2 is an improvement, but a growing list of content must be
ignored as additions/changes are made to the libxl_domain_config
object. (Example of ignored content in this discussion -
https://www.redhat.com/archives/libvir-list/2014-September/msg00627.html).
In some cases, we might actually want to test some of the new content
instead of ignoring it.
Option 3 is promising, but doesn't help with Xen versions 4.2-4.4.
Also, 4.5 is missing libxl_domain_config_compare().
After a bit of hacking on a combination of 2 and 3, I'm reconsidering 1
:-). At least for Xen 4.2-4.5. It's a simple solution that doesn't
prevent testing new content in the libxl_domain_config object. Going
forward, I could work on libxl_domain_config_compare() for
xen-unstable/4.6, and then use option 3 to stop the template bloom.
Any thoughts on this approach? Smarter options?
Regards,
Jim
9 years, 10 months
[libvirt] [PATCH] aarch64: Support versioned machine types.
by Richard W.M. Jones
From: "Richard W.M. Jones" <rjones(a)redhat.com>
For distros that want to add versioned machine types, they will add
(downstream) machine types like "virt-foo-1.2.3". Detect these as
MMIO too.
Signed-off-by: Richard W.M. Jones <rjones(a)redhat.com>
---
src/qemu/qemu_command.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 434ac7c..3c75de5 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1158,7 +1158,8 @@ qemuDomainAssignARMVirtioMMIOAddresses(virDomainDefPtr def,
if (((def->os.arch == VIR_ARCH_ARMV7L) ||
(def->os.arch == VIR_ARCH_AARCH64)) &&
(STRPREFIX(def->os.machine, "vexpress-") ||
- STREQ(def->os.machine, "virt")) &&
+ STREQ(def->os.machine, "virt") ||
+ STRPREFIX(def->os.machine, "virt-")) &&
virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_MMIO)) {
qemuDomainPrimeVirtioDeviceAddresses(
def, VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_MMIO);
--
1.8.3.1
9 years, 10 months
[libvirt] [PATCH] Use correct location for qcow1 encryption header
by Ján Tomko
After the 8-byte size header, there are two one-byte headers
and two bytes of padding before the crypt_header field.
Our QCOW1_HDR_CRYPT constant did not skip the padding.
http://git.qemu.org/?p=qemu.git;a=blob;f=block/qcow.c;h=ece22697#l41
https://bugzilla.redhat.com/show_bug.cgi?id=1185165
---
src/util/virstoragefile.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index 7a4f9a0..8568ebb 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -161,7 +161,7 @@ qedGetBackingStore(char **, int *, const char *, size_t);
#define QCOWX_HDR_BACKING_FILE_SIZE (QCOWX_HDR_BACKING_FILE_OFFSET+8)
#define QCOWX_HDR_IMAGE_SIZE (QCOWX_HDR_BACKING_FILE_SIZE+4+4)
-#define QCOW1_HDR_CRYPT (QCOWX_HDR_IMAGE_SIZE+8+1+1)
+#define QCOW1_HDR_CRYPT (QCOWX_HDR_IMAGE_SIZE+8+1+1+2)
#define QCOW2_HDR_CRYPT (QCOWX_HDR_IMAGE_SIZE+8)
#define QCOW1_HDR_TOTAL_SIZE (QCOW1_HDR_CRYPT+4+8)
--
2.0.4
9 years, 10 months
[libvirt] [PATCH v2 0/4] qemu: fix PCI bridge auto-add to extend default bus
by Erik Skultety
Erik Skultety (4):
qemu: reorder PCI slot assignment functions
qemu: move PCI slot assignment for PIIX3, Q35 into a separate function
qemu: Fix auto-adding PCI bridge when all slots are reserved
qemu: Add check for PCI bridge placement if there are too many PCI
devices
src/qemu/qemu_command.c | 265 ++++++++++++++++++++++++++++--------------------
1 file changed, 154 insertions(+), 111 deletions(-)
--
1.9.3
9 years, 10 months
[libvirt] [PATCH 0/5] Const correctnes/random fixes
by Peter Krempa
Few fixes/tweaks that have accumulated in my memory hotplug branch. They should
be trivial enough and semantically inert.
Peter Krempa (5):
conf: Fix comment mentioning actual type of @multi member of
virDevicePCIAddress
qemu: command: Honor const-correctnes in qemuBuildNumaArgStr
util: json: Make argument of virJSONValueArraySize const
schemas: Move definition of 'hexuint' to basictypes
util: bitmap: Tolerate NULL bitmaps in virBitmapEqual
docs/schemas/basictypes.rng | 6 ++++++
docs/schemas/nodedev.rng | 6 ------
src/conf/device_conf.h | 2 +-
src/qemu/qemu_command.c | 2 +-
src/util/virbitmap.c | 6 ++++++
src/util/virbitmap.h | 3 +--
src/util/virjson.c | 2 +-
src/util/virjson.h | 2 +-
8 files changed, 17 insertions(+), 12 deletions(-)
--
2.2.1
9 years, 10 months
[libvirt] [PATCH 0/5] Revert and fix PCI bridge auto-add to extend default bus
by Erik Skultety
Erik Skultety (5):
qemu: Remove dead code in qemuDomainAssignPCIAddresses revert patch
conf: virDomainDefMaybeAddController tweak return code
qemu: Fix auto-adding PCI bridge when all slots are reserved
qemu: move PCI slot assignment for PIIX3, Q35 into a separate function
qemu: reorder PCI slot assignment functions
src/conf/domain_conf.c | 2 +-
src/qemu/qemu_command.c | 264 ++++++++++++++++++++++++++++--------------------
2 files changed, 154 insertions(+), 112 deletions(-)
--
1.9.3
9 years, 10 months
[libvirt] [PATCH 0/3] Update example apparmor profile
by Mike Latimer
The apparmor profile example for libvirtd is rather outdated. The changes in
this patch series are intended to bring this sample up to date with the latest
working configuration. This series addresses issues applicable to general
libvirt, Xen and libvirt-TCK operations - each in their own patch.
Mike Latimer (3):
Fix apparmor issues for Xen
Grant access to helpers
Fix apparmor issues for tck
examples/apparmor/usr.sbin.libvirtd | 6 ++++++
1 file changed, 6 insertions(+)
--
1.8.4.5
9 years, 10 months
[libvirt] [PATCH] Fix build with older gcc
by Ján Tomko
My commit af1c98e4 broke the build on RHEL-6:
vircgrouptest.c: In function 'testCgroupGetPercpuStats':
vircgrouptest.c:566: error: nested extern declaration of
'_gl_verify_function2' [-Wnested-externs]
The only thing that needs checking is that the array size
is at least EXPECTED_NCPUS, to prevent access beyond the array.
We can ensure the minimum size also by specifying the array
size upfront.
---
tests/vircgrouptest.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Pushed as a build fix.
diff --git a/tests/vircgrouptest.c b/tests/vircgrouptest.c
index b65ea3f..a455a81 100644
--- a/tests/vircgrouptest.c
+++ b/tests/vircgrouptest.c
@@ -541,7 +541,7 @@ static int testCgroupGetPercpuStats(const void *args ATTRIBUTE_UNUSED)
virTypedParameterPtr params = NULL;
# define EXPECTED_NCPUS 160
- unsigned long long expected[] = {
+ unsigned long long expected[EXPECTED_NCPUS] = {
0, 0, 0, 0, 0, 0, 0, 0,
7059492996, 0, 0, 0, 0, 0, 0, 0,
4180532496, 0, 0, 0, 0, 0, 0, 0,
@@ -563,7 +563,6 @@ static int testCgroupGetPercpuStats(const void *args ATTRIBUTE_UNUSED)
5683512916, 0, 0, 0, 0, 0, 0, 0,
635751356, 0, 0, 0, 0, 0, 0, 0,
};
- verify(ARRAY_CARDINALITY(expected) == EXPECTED_NCPUS);
if (VIR_ALLOC_N(params, EXPECTED_NCPUS) < 0)
goto cleanup;
--
2.0.4
9 years, 10 months