[libvirt] [PATCH] conf: more useful error message when pci function is out of range
by Laine Stump
If a pci address had a function number out of range, the error message
would be:
Insufficient specification for PCI address
This was due to an unnecessary call to virDevicePCIAddressIsValid()
during parse of the pci address - we will anyway check for validity of
the PCI address later on.
With that extra check removed, the error message is the much more useful:
Invalid PCI address 0000:02:06.8. function must be <= 7
This resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=1004596
---
src/conf/device_conf.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/src/conf/device_conf.c b/src/conf/device_conf.c
index e7b7957..09a7019 100644
--- a/src/conf/device_conf.c
+++ b/src/conf/device_conf.c
@@ -1,7 +1,7 @@
/*
* device_conf.c: device XML handling
*
- * Copyright (C) 2006-2012 Red Hat, Inc.
+ * Copyright (C) 2006-2015 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -115,11 +115,6 @@ virDevicePCIAddressParseXML(xmlNodePtr node,
goto cleanup;
}
- if (!virDevicePCIAddressIsValid(addr)) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Insufficient specification for PCI address"));
- goto cleanup;
- }
ret = 0;
--
2.1.0
9 years, 4 months
[libvirt] [PATCH] nodeinfo: Check for errors when reading core_id
by Andrea Bolognani
---
src/nodeinfo.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/nodeinfo.c b/src/nodeinfo.c
index fb932c8..ba633a1 100644
--- a/src/nodeinfo.c
+++ b/src/nodeinfo.c
@@ -512,7 +512,9 @@ virNodeParseNode(const char *node,
/* logical cpu is equivalent to a core on s390 */
core = cpu;
} else {
- core = virNodeGetCpuValue(node, cpu, "topology/core_id", 0);
+ if ((core = virNodeGetCpuValue(node, cpu,
+ "topology/core_id", 0)) < 0)
+ goto cleanup;
}
if (core > ID_MAX) {
virReportError(VIR_ERR_INTERNAL_ERROR,
--
2.4.3
9 years, 4 months
[libvirt] [PATCH] netdev: fix build on FreeBSD
by Roman Bogorodskiy
Commit ac3ed20 breaks build on FreeBSD with:
CC util/libvirt_util_la-virnetdev.lo
util/virnetdev.c:2967:1: error: unused function 'virNetDevRDMAFeature' [-Werror,-Wunused-function]
virNetDevRDMAFeature(const char *ifname,
^
So hide virNetDevRDMAFeature function under the #ifdef 'SIOCETHTOOL'
and 'HAVE_STRUCT_IFREQ' section.
Pushed under the build breaker rule.
---
src/util/virnetdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index 8981a84..7d91e2c 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -2952,6 +2952,7 @@ int virNetDevGetRxFilter(const char *ifname,
return ret;
}
+#if defined(SIOCETHTOOL) && defined(HAVE_STRUCT_IFREQ)
/**
* virNetDevRDMAFeature
@@ -3014,7 +3015,6 @@ virNetDevRDMAFeature(const char *ifname,
return ret;
}
-#if defined(SIOCETHTOOL) && defined(HAVE_STRUCT_IFREQ)
/**
* virNetDevSendEthtoolIoctl
--
2.3.7
9 years, 4 months
[libvirt] [PATCH 1/2] bhyve: add UTC clock support
by Roman Bogorodskiy
Bhyve as of r279225 (FreeBSD -CURRENT) or r284894 (FreeBSD 10-STABLE)
supports using UTC time offset via the '-u' argument to bhyve(8). By
default it's still using localtime.
Make the bhyve driver use UTC clock if it's requested by specifying
<clock offset='utc'> in domain XML and if the bhyve(8) binary supports
the '-u' flag.
---
src/bhyve/bhyve_capabilities.c | 31 ++++++++++++++++++++++
src/bhyve/bhyve_capabilities.h | 5 ++++
src/bhyve/bhyve_command.c | 21 +++++++++++++++
src/bhyve/bhyve_driver.c | 13 +++++++++
src/bhyve/bhyve_driver.h | 2 ++
src/bhyve/bhyve_utils.h | 1 +
.../bhyvexml2argvdata/bhyvexml2argv-acpiapic.args | 2 +-
tests/bhyvexml2argvdata/bhyvexml2argv-base.args | 2 +-
.../bhyvexml2argv-bhyveload-explicitargs.args | 2 +-
tests/bhyvexml2argvdata/bhyvexml2argv-console.args | 2 +-
.../bhyvexml2argv-custom-loader.args | 2 +-
.../bhyvexml2argv-disk-cdrom-grub.args | 2 +-
.../bhyvexml2argv-disk-cdrom.args | 2 +-
.../bhyvexml2argv-disk-virtio.args | 2 +-
.../bhyvexml2argv-grub-bootorder.args | 2 +-
.../bhyvexml2argv-grub-bootorder2.args | 2 +-
.../bhyvexml2argv-grub-defaults.args | 2 +-
.../bhyvexml2argvdata/bhyvexml2argv-localtime.args | 3 +++
.../bhyvexml2argv-localtime.ldargs | 1 +
.../bhyvexml2argvdata/bhyvexml2argv-localtime.xml | 23 ++++++++++++++++
tests/bhyvexml2argvdata/bhyvexml2argv-macaddr.args | 2 +-
.../bhyvexml2argv-serial-grub-nocons.args | 2 +-
.../bhyvexml2argv-serial-grub.args | 2 +-
tests/bhyvexml2argvdata/bhyvexml2argv-serial.args | 2 +-
tests/bhyvexml2argvtest.c | 2 ++
25 files changed, 117 insertions(+), 15 deletions(-)
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-localtime.args
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-localtime.ldargs
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-localtime.xml
diff --git a/src/bhyve/bhyve_capabilities.c b/src/bhyve/bhyve_capabilities.c
index 3a55879..9b21649 100644
--- a/src/bhyve/bhyve_capabilities.c
+++ b/src/bhyve/bhyve_capabilities.c
@@ -141,3 +141,34 @@ virBhyveProbeGrubCaps(virBhyveGrubCapsFlags *caps)
VIR_FREE(binary);
return ret;
}
+
+int
+virBhyveProbeCaps(virBhyveCapsFlags *caps)
+{
+ char *binary, *help;
+ virCommandPtr cmd = NULL;
+ int ret = 0, exit;
+
+ binary = virFindFileInPath("bhyve");
+ if (binary == NULL)
+ goto out;
+ if (!virFileIsExecutable(binary))
+ goto out;
+
+ cmd = virCommandNew(binary);
+ virCommandAddArg(cmd, "-h");
+ virCommandSetErrorBuffer(cmd, &help);
+ if (virCommandRun(cmd, &exit) < 0) {
+ ret = -1;
+ goto out;
+ }
+
+ if (strstr(help, "-u:") != NULL)
+ *caps |= BHYVE_CAP_RTC_UTC;
+
+ out:
+ VIR_FREE(help);
+ virCommandFree(cmd);
+ VIR_FREE(binary);
+ return ret;
+}
diff --git a/src/bhyve/bhyve_capabilities.h b/src/bhyve/bhyve_capabilities.h
index ccd8eb6..df7218f 100644
--- a/src/bhyve/bhyve_capabilities.h
+++ b/src/bhyve/bhyve_capabilities.h
@@ -31,6 +31,11 @@ typedef enum {
BHYVE_GRUB_CAP_CONSDEV = 1,
} virBhyveGrubCapsFlags;
+typedef enum {
+ BHYVE_CAP_RTC_UTC = 1,
+} virBhyveCapsFlags;
+
int virBhyveProbeGrubCaps(virBhyveGrubCapsFlags *caps);
+int virBhyveProbeCaps(virBhyveCapsFlags *caps);
#endif
diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c
index 5e31ca6..6576029 100644
--- a/src/bhyve/bhyve_command.c
+++ b/src/bhyve/bhyve_command.c
@@ -245,6 +245,27 @@ virBhyveProcessBuildBhyveCmd(virConnectPtr conn,
if (def->features[VIR_DOMAIN_FEATURE_APIC] == VIR_TRISTATE_SWITCH_ON)
virCommandAddArg(cmd, "-I"); /* Present ioapic to the guest */
+ switch (def->clock.offset) {
+ case VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME:
+ /* used by default in bhyve */
+ break;
+ case VIR_DOMAIN_CLOCK_OFFSET_UTC:
+ if ((bhyveDriverGetCaps(conn) & BHYVE_CAP_RTC_UTC) != 0) {
+ virCommandAddArg(cmd, "-u");
+ } else {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("Installed bhyve binary does not support "
+ "UTC clock"));
+ goto error;
+ }
+ break;
+ default:
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("unsupported clock offset '%s'"),
+ virDomainClockOffsetTypeToString(def->clock.offset));
+ goto error;
+ }
+
/* Clarification about -H and -P flags from Peter Grehan:
* -H and -P flags force the guest to exit when it executes IA32 HLT and PAUSE
* instructions respectively.
diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c
index 85b7c8f..7f365b1 100644
--- a/src/bhyve/bhyve_driver.c
+++ b/src/bhyve/bhyve_driver.c
@@ -1181,6 +1181,9 @@ bhyveStateInitialize(bool privileged,
if (!(bhyve_driver->caps = virBhyveCapsBuild()))
goto cleanup;
+ if (virBhyveProbeCaps(&bhyve_driver->bhyvecaps) < 0)
+ goto cleanup;
+
if (virBhyveProbeGrubCaps(&bhyve_driver->grubcaps) < 0)
goto cleanup;
@@ -1240,6 +1243,16 @@ bhyveStateInitialize(bool privileged,
}
unsigned
+bhyveDriverGetCaps(virConnectPtr conn)
+{
+ bhyveConnPtr driver = conn->privateData;
+
+ if (driver != NULL)
+ return driver->bhyvecaps;
+ return 0;
+}
+
+unsigned
bhyveDriverGetGrubCaps(virConnectPtr conn)
{
bhyveConnPtr driver = conn->privateData;
diff --git a/src/bhyve/bhyve_driver.h b/src/bhyve/bhyve_driver.h
index af2424a..221d5a0 100644
--- a/src/bhyve/bhyve_driver.h
+++ b/src/bhyve/bhyve_driver.h
@@ -25,6 +25,8 @@
int bhyveRegister(void);
+unsigned bhyveDriverGetCaps(virConnectPtr conn);
+
unsigned bhyveDriverGetGrubCaps(virConnectPtr conn);
#endif /* __BHYVE_DRIVER_H__ */
diff --git a/src/bhyve/bhyve_utils.h b/src/bhyve/bhyve_utils.h
index bbaa3a3..4bccdcc 100644
--- a/src/bhyve/bhyve_utils.h
+++ b/src/bhyve/bhyve_utils.h
@@ -46,6 +46,7 @@ struct _bhyveConn {
virCloseCallbacksPtr closeCallbacks;
+ unsigned bhyvecaps;
unsigned grubcaps;
};
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-acpiapic.args b/tests/bhyvexml2argvdata/bhyvexml2argv-acpiapic.args
index 79f8e88..6b26964 100644
--- a/tests/bhyvexml2argvdata/bhyvexml2argv-acpiapic.args
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-acpiapic.args
@@ -1,3 +1,3 @@
-/usr/sbin/bhyve -c 1 -m 214 -A -I -H -P -s 0:0,hostbridge \
+/usr/sbin/bhyve -c 1 -m 214 -A -I -u -H -P -s 0:0,hostbridge \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
-s 2:0,ahci-hd,/tmp/freebsd.img bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-base.args b/tests/bhyvexml2argvdata/bhyvexml2argv-base.args
index 4122e62..118735e 100644
--- a/tests/bhyvexml2argvdata/bhyvexml2argv-base.args
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-base.args
@@ -1,3 +1,3 @@
-/usr/sbin/bhyve -c 1 -m 214 -H -P -s 0:0,hostbridge \
+/usr/sbin/bhyve -c 1 -m 214 -u -H -P -s 0:0,hostbridge \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
-s 2:0,ahci-hd,/tmp/freebsd.img bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-explicitargs.args b/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-explicitargs.args
index 4122e62..118735e 100644
--- a/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-explicitargs.args
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-explicitargs.args
@@ -1,3 +1,3 @@
-/usr/sbin/bhyve -c 1 -m 214 -H -P -s 0:0,hostbridge \
+/usr/sbin/bhyve -c 1 -m 214 -u -H -P -s 0:0,hostbridge \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
-s 2:0,ahci-hd,/tmp/freebsd.img bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-console.args b/tests/bhyvexml2argvdata/bhyvexml2argv-console.args
index df50290..3119777 100644
--- a/tests/bhyvexml2argvdata/bhyvexml2argv-console.args
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-console.args
@@ -1,4 +1,4 @@
-/usr/sbin/bhyve -c 1 -m 214 -H -P -s 0:0,hostbridge \
+/usr/sbin/bhyve -c 1 -m 214 -u -H -P -s 0:0,hostbridge \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
-s 2:0,ahci-hd,/tmp/freebsd.img \
-s 1,lpc -l com1,/dev/nmdm0A bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-custom-loader.args b/tests/bhyvexml2argvdata/bhyvexml2argv-custom-loader.args
index 4122e62..118735e 100644
--- a/tests/bhyvexml2argvdata/bhyvexml2argv-custom-loader.args
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-custom-loader.args
@@ -1,3 +1,3 @@
-/usr/sbin/bhyve -c 1 -m 214 -H -P -s 0:0,hostbridge \
+/usr/sbin/bhyve -c 1 -m 214 -u -H -P -s 0:0,hostbridge \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
-s 2:0,ahci-hd,/tmp/freebsd.img bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-disk-cdrom-grub.args b/tests/bhyvexml2argvdata/bhyvexml2argv-disk-cdrom-grub.args
index eb38969..2b1281f 100644
--- a/tests/bhyvexml2argvdata/bhyvexml2argv-disk-cdrom-grub.args
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-disk-cdrom-grub.args
@@ -1,3 +1,3 @@
-/usr/sbin/bhyve -c 1 -m 214 -H -P -s 0:0,hostbridge \
+/usr/sbin/bhyve -c 1 -m 214 -u -H -P -s 0:0,hostbridge \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
-s 2:0,ahci-cd,/tmp/cdrom.iso bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-disk-cdrom.args b/tests/bhyvexml2argvdata/bhyvexml2argv-disk-cdrom.args
index eb38969..2b1281f 100644
--- a/tests/bhyvexml2argvdata/bhyvexml2argv-disk-cdrom.args
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-disk-cdrom.args
@@ -1,3 +1,3 @@
-/usr/sbin/bhyve -c 1 -m 214 -H -P -s 0:0,hostbridge \
+/usr/sbin/bhyve -c 1 -m 214 -u -H -P -s 0:0,hostbridge \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
-s 2:0,ahci-cd,/tmp/cdrom.iso bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-disk-virtio.args b/tests/bhyvexml2argvdata/bhyvexml2argv-disk-virtio.args
index 1638d54..da0577c 100644
--- a/tests/bhyvexml2argvdata/bhyvexml2argv-disk-virtio.args
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-disk-virtio.args
@@ -1,3 +1,3 @@
-/usr/sbin/bhyve -c 1 -m 214 -H -P -s 0:0,hostbridge \
+/usr/sbin/bhyve -c 1 -m 214 -u -H -P -s 0:0,hostbridge \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
-s 2:0,virtio-blk,/tmp/freebsd.img bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder.args b/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder.args
index eaba370..fc0522d 100644
--- a/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder.args
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder.args
@@ -1,4 +1,4 @@
-/usr/sbin/bhyve -c 1 -m 214 -H -P -s 0:0,hostbridge \
+/usr/sbin/bhyve -c 1 -m 214 -u -H -P -s 0:0,hostbridge \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
-s 2:0,ahci-hd,/tmp/freebsd1.img \
-s 2:0,ahci-hd,/tmp/freebsd2.img \
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder2.args b/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder2.args
index eaba370..fc0522d 100644
--- a/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder2.args
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder2.args
@@ -1,4 +1,4 @@
-/usr/sbin/bhyve -c 1 -m 214 -H -P -s 0:0,hostbridge \
+/usr/sbin/bhyve -c 1 -m 214 -u -H -P -s 0:0,hostbridge \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
-s 2:0,ahci-hd,/tmp/freebsd1.img \
-s 2:0,ahci-hd,/tmp/freebsd2.img \
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-grub-defaults.args b/tests/bhyvexml2argvdata/bhyvexml2argv-grub-defaults.args
index 4122e62..118735e 100644
--- a/tests/bhyvexml2argvdata/bhyvexml2argv-grub-defaults.args
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-grub-defaults.args
@@ -1,3 +1,3 @@
-/usr/sbin/bhyve -c 1 -m 214 -H -P -s 0:0,hostbridge \
+/usr/sbin/bhyve -c 1 -m 214 -u -H -P -s 0:0,hostbridge \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
-s 2:0,ahci-hd,/tmp/freebsd.img bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-localtime.args b/tests/bhyvexml2argvdata/bhyvexml2argv-localtime.args
new file mode 100644
index 0000000..4122e62
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-localtime.args
@@ -0,0 +1,3 @@
+/usr/sbin/bhyve -c 1 -m 214 -H -P -s 0:0,hostbridge \
+-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
+-s 2:0,ahci-hd,/tmp/freebsd.img bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-localtime.ldargs b/tests/bhyvexml2argvdata/bhyvexml2argv-localtime.ldargs
new file mode 100644
index 0000000..215d65f
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-localtime.ldargs
@@ -0,0 +1 @@
+/usr/sbin/bhyveload -m 214 -d /tmp/freebsd.img bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-localtime.xml b/tests/bhyvexml2argvdata/bhyvexml2argv-localtime.xml
new file mode 100644
index 0000000..f62c626
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-localtime.xml
@@ -0,0 +1,23 @@
+<domain type='bhyve'>
+ <name>bhyve</name>
+ <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+ <memory>219136</memory>
+ <vcpu>1</vcpu>
+ <os>
+ <type>hvm</type>
+ </os>
+ <clock offset='localtime'/>
+ <devices>
+ <disk type='file'>
+ <driver name='file' type='raw'/>
+ <source file='/tmp/freebsd.img'/>
+ <target dev='hda' bus='sata'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+ </disk>
+ <interface type='bridge'>
+ <model type='virtio'/>
+ <source bridge="virbr0"/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </interface>
+ </devices>
+</domain>
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-macaddr.args b/tests/bhyvexml2argvdata/bhyvexml2argv-macaddr.args
index f914865..77c3a17 100644
--- a/tests/bhyvexml2argvdata/bhyvexml2argv-macaddr.args
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-macaddr.args
@@ -1,3 +1,3 @@
-/usr/sbin/bhyve -c 1 -m 214 -H -P -s 0:0,hostbridge \
+/usr/sbin/bhyve -c 1 -m 214 -u -H -P -s 0:0,hostbridge \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:22:ee:11 \
-s 2:0,ahci-hd,/tmp/freebsd.img bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-serial-grub-nocons.args b/tests/bhyvexml2argvdata/bhyvexml2argv-serial-grub-nocons.args
index df50290..3119777 100644
--- a/tests/bhyvexml2argvdata/bhyvexml2argv-serial-grub-nocons.args
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-serial-grub-nocons.args
@@ -1,4 +1,4 @@
-/usr/sbin/bhyve -c 1 -m 214 -H -P -s 0:0,hostbridge \
+/usr/sbin/bhyve -c 1 -m 214 -u -H -P -s 0:0,hostbridge \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
-s 2:0,ahci-hd,/tmp/freebsd.img \
-s 1,lpc -l com1,/dev/nmdm0A bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-serial-grub.args b/tests/bhyvexml2argvdata/bhyvexml2argv-serial-grub.args
index df50290..3119777 100644
--- a/tests/bhyvexml2argvdata/bhyvexml2argv-serial-grub.args
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-serial-grub.args
@@ -1,4 +1,4 @@
-/usr/sbin/bhyve -c 1 -m 214 -H -P -s 0:0,hostbridge \
+/usr/sbin/bhyve -c 1 -m 214 -u -H -P -s 0:0,hostbridge \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
-s 2:0,ahci-hd,/tmp/freebsd.img \
-s 1,lpc -l com1,/dev/nmdm0A bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-serial.args b/tests/bhyvexml2argvdata/bhyvexml2argv-serial.args
index df50290..3119777 100644
--- a/tests/bhyvexml2argvdata/bhyvexml2argv-serial.args
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-serial.args
@@ -1,4 +1,4 @@
-/usr/sbin/bhyve -c 1 -m 214 -H -P -s 0:0,hostbridge \
+/usr/sbin/bhyve -c 1 -m 214 -u -H -P -s 0:0,hostbridge \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
-s 2:0,ahci-hd,/tmp/freebsd.img \
-s 1,lpc -l com1,/dev/nmdm0A bhyve
diff --git a/tests/bhyvexml2argvtest.c b/tests/bhyvexml2argvtest.c
index fa6f87f..3e57a78 100644
--- a/tests/bhyvexml2argvtest.c
+++ b/tests/bhyvexml2argvtest.c
@@ -118,6 +118,7 @@ mymain(void)
} while (0)
driver.grubcaps = BHYVE_GRUB_CAP_CONSDEV;
+ driver.bhyvecaps = BHYVE_CAP_RTC_UTC;
DO_TEST("base");
DO_TEST("acpiapic");
@@ -133,6 +134,7 @@ mymain(void)
DO_TEST("custom-loader");
DO_TEST("disk-cdrom-grub");
DO_TEST("serial-grub");
+ DO_TEST("localtime");
driver.grubcaps = 0;
--
2.3.7
9 years, 4 months
Re: [libvirt] [PATCH V3 2/3] virtio-blk: fail get_features when both scsi and 1.0 were set
by Daniel P. Berrange
On Wed, Jul 22, 2015 at 01:40:25PM +0200, Paolo Bonzini wrote:
>
>
> On 22/07/2015 12:19, Michael S. Tsirkin wrote:
> > > > SCSI passthrough was no longer supported in virtio 1.0, so this patch
> > > > fail the get_features() when both 1.0 and scsi is set. And also only
> > > > advertise VIRTIO_BLK_F_SCSI for legacy virtio-blk device.
> > >
> > > Why is SCSI passthrough support not available in virtio 1.0 ? This
> > > will cause a regression for any users of that as & when QEMU changes
> > > to use virtio 1.0 by default. Can we not fix this regression instead.
> >
> > If we wanted to, we might be able to fix this but not for 2.4: we'd have
> > to extend the spec and guest drivers, in some way TBD.
> >
> > Paolo would be best placed to answer whether this feature is desirable
> > in the future, I think the argument made when the spec was written was that
> > the feature is not widely used, and virtio scsi is available as
> > a replacement for people who need it.
>
> No, the feature is not desirable in the future. There is no reason
> really not to use virtio-scsi passthrough instead, since virtio-scsi has
> been out for about 3 years now and is stable.
>
> In addition, the implementation would either not be compatible with
> virtio 0.9, or would be different from everything else in the spec
> because it requires a particular framing for the buffers.
IIUC, the SCSI passthrough feature for virtio-blk is enabled by
setting the 'scsi=on' property on the virtio-blk device, which is
exposed by libvirt with XML:
<disk type='block' device='lun'>
<driver name='qemu' type='raw'/>
<source dev='/dev/sda'/>
<target dev='vda' bus='virtio'/>
</disk>
(For use with virtio-scsi you'd just change the <target> element)
So if the guest is using virtio-1.0, then this will now fail to boot, or
cause an error from monitor hotplug. This is not too bad, but I'm just
wondering if there's anything else we ought to think about doing in libvirt
in this situation. Normally we'd try to detect unsupported things upfront
so we can report VIR_ERR_CONFIG_UNSUPPORTED, instead of the generic error
code VIR_ERR_INTERNAL_ERROR, but perhaps this is sufficiently niche to
not worry about it and its fine to just delegate error reporting to QEMU ?
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
9 years, 4 months
[libvirt] [PATCH glib] README: formally document intended platform support targets
by Daniel P. Berrange
Give users an indication of what distro platforms the project
intends to be buildable on. This policy will be used to decide
when it is appropriate to increase the minimum required versions
of external dependancies.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
README | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++------------
1 file changed, 53 insertions(+), 12 deletions(-)
diff --git a/README b/README
index 3108e3c..3547089 100644
--- a/README
+++ b/README
@@ -26,18 +26,59 @@ The latest official releases can be found at:
NB: at this time, libvirt-glib is *NOT* considered API/ABI stable. Future
releases may still include API/ABI incompatible changes.
-Dependencies
-============
-
-- Required:
- - glib-2.0
- - gobject-2.0
- - libxml-2.0
- - libvirt
-
-- Optional:
- - gobject-introspection
- - Vala (build-time only)
+Dependencies / supported platforms
+==================================
+
+The libvirt-glib projects attempts to be moderately conservative
+about updating the minimum required versions of external package
+dependencies, to strike a balance between enabling use of new
+features while minimizing inconvenience for downstream developers
+on distro platforms with specific shipped version.
+
+There are commonly two classes of Linux distro - short lifetime
+(Fedora, Ubuntu non-LTS, etc) and extended lifetime (RHEL, CentOS,
+Debian, Ubuntu LTS). Based on this classification, the libvirt-glib
+project will generally aim to ensure build support for
+
+ - Most recent 2 releases of short lifetime distros
+ - Most recent major release of extended lifetime distros,
+ with most recent 2 minor updates
+
+The project will consider RHEL, Fedora, Ubuntu LTS, Ubuntu, OpenSUSE
+and SUSE (SLES/SLED) distros to be a representative subset of distros
+when determining min required versions of external deps, as other distros
+of similar release vintage will typically have similar versions. In the
+case of Debian, the project may at times choose to require use of an
+update from the backports repository.
+
+As an example, as of July 1st 2015 this policy would imply that the
+following distros are officially targetted as buildable platforms:
+
+ - RHEL: 7.1, 7.2
+ - Fedora: 21, 22
+ - Ubuntu LTS: 14.04 (Trusty)
+ - Ubuntu: 14.10 (Utopic), 15.04 (Vivid)
+ - Suse: 12.0
+ - OpenSUSE: 13.1, 13.2
+ - Debian: 8.0 (Jessie)
+
+At any time, it may be possible to build on versions of distros
+that are older than those implied by this policy, but the project
+will not guarantee this remains the case in future releases. The
+min required package versions of external dependancies may be
+raised in future releases based on this distro build target policy.
+
+The packages required to build libvirt-glib are
+
+ - glib-2.0
+ - gobject-2.0
+ - libxml-2.0
+ - libvirt
+
+Functionality is optionally enhanced by the following packages:
+
+ - gobject-introspection
+ - Vala (build-time only)
Patches sumissions
==================
--
2.4.3
9 years, 4 months
[libvirt] [PATCH glib] configure.ac: update min required versions
by Daniel P. Berrange
Based on the distro target policy we have the following
min versions in various distros
libvirt glib2 gobject-introspection
RHEL 7.0: 1.1.1 2.36.3 1.36.0
Fedora 21: 1.2.9 2.42.1 1.42.0
Ubuntu 14.10: 1.2.8 2.42.0 1.41.0
Ubuntu LTS 14.04: 1.2.2 2.40.0 1.40.0
Suse 12.0: 1.2.5 2.38.2 1.38.0
OpenSUSE 13.1: 1.1.2 2.38.2 1.38.0
Debian 8: 1.2.9 2.42.0 1.42.0
Which means we can reasonably depend on
libvirt >= 1.1.1
glib2 >= 2.36.3
gobject-introspection >= 1.36.0
This allows us to remove the conditional building of unit
tests
---
configure.ac | 15 ++++-----------
tests/Makefile.am | 2 --
2 files changed, 4 insertions(+), 13 deletions(-)
diff --git a/configure.ac b/configure.ac
index d9b4665..b473d2a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,14 +9,11 @@ AC_CANONICAL_HOST
AM_SILENT_RULES([yes])
-LIBVIRT_REQUIRED=0.10.2
+LIBVIRT_REQUIRED=1.1.1
AC_SUBST([LIBVIRT_REQUIRED]) dnl used in the .spec file
-GLIB2_REQUIRED=2.36.0
+GLIB2_REQUIRED=2.36.3
AC_SUBST([GLIB2_REQUIRED]) dnl used in the .spec file
-GLIB2_TEST_REQUIRED=2.38.0
-GOBJECT2_REQUIRED=2.10.0
-GIO_REQUIRED=2.10.0
-GOBJECT_INTROSPECTION_REQUIRED=0.10.8
+GOBJECT_INTROSPECTION_REQUIRED=1.36.0
LIBXML2_REQUIRED=2.0.0
LIBVIRT_GLIB_MAJOR_VERSION=`echo $VERSION | awk -F. '{print $1}'`
@@ -102,16 +99,12 @@ AC_CHECK_LIB([virt],
[virNetworkGetDHCPLeases],
[AC_DEFINE([HAVE_VIR_NETWORK_GET_DHCP_LEASES], 1, [Have virNetworkGetDHCPLeases?])])
enable_tests=no
-PKG_CHECK_MODULES(GLIB2, glib-2.0 >= $GLIB2_TEST_REQUIRED,
- [enable_tests=yes],
- [PKG_CHECK_MODULES(GLIB2, glib-2.0 >= $GLIB2_REQUIRED)])
+PKG_CHECK_MODULES(GLIB2, glib-2.0 >= $GLIB2_REQUIRED)
PKG_CHECK_MODULES(GTHREAD2, gthread-2.0 >= $GLIB2_REQUIRED)
PKG_CHECK_MODULES(GOBJECT2, gobject-2.0 >= $GLIB2_REQUIRED)
PKG_CHECK_MODULES(GIO2, gio-2.0 >= $GLIB2_REQUIRED)
PKG_CHECK_MODULES(LIBXML2, libxml-2.0 >= $LIBXML2_REQUIRED)
-AM_CONDITIONAL([ENABLE_TESTS], [test "$enable_tests" = "yes"])
-
LIBVIRT_GLIB_GETTEXT
dnl Should be in m4/virt-gettext.m4 but intltoolize is too
dnl dumb to find it there
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 3f4ef6c..396092a 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,4 +1,3 @@
-if ENABLE_TESTS
include $(top_srcdir)/build-aux/glib-tap.mk
@@ -22,4 +21,3 @@ test_programs = test-gconfig test-events
EXTRA_DIST += \
xml \
$(NULL)
-endif
--
2.4.3
9 years, 4 months
[libvirt] [libvirt-glib] examples: Don't leak mainloop in conn-test.c
by Christophe Fergeau
The program exits right after this, so it's no big deal, but this gives
us a clean valgrind --leak-check=full output.
---
examples/conn-test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/examples/conn-test.c b/examples/conn-test.c
index adc6434..ac5880a 100644
--- a/examples/conn-test.c
+++ b/examples/conn-test.c
@@ -90,7 +90,7 @@ int main(int argc, char **argv)
gvir_connection_open_async(conn, NULL, do_connection_open, loop);
g_main_loop_run(loop);
-
+ g_main_loop_unref(loop);
return 0;
}
--
2.4.3
9 years, 4 months