[PATCH] lxc: Fix wrong addresses statements for IPv{4, 6} in native network definitions
by Julio Faracco
After LXC version 3, some settings were changed to new names. Same as
network. LXC introduced network indexes and changed IPv{4,6} addresses
fields. Before, users should only pass `lxc.network.ipv4` to define an
IPv4 address. Now, on version 3, users need to pass
`lxc.net.X.ipv4.address` to specify the same thing. Same for IPv6.
Signed-off-by: Julio Faracco <jcfaracco(a)gmail.com>
---
For further details:
https://discuss.linuxcontainers.org/t/lxc-2-1-has-been-released/487
---
---
src/lxc/lxc_native.c | 12 ++++++++----
src/lxc/lxc_native.h | 2 ++
tests/lxcconf2xmldata/lxcconf2xml-ethernet-v3.config | 4 ++--
.../lxcconf2xml-miscnetwork-v3.config | 4 ++--
.../lxcconf2xml-physnetwork-v3.config | 4 ++--
tests/lxcconf2xmldata/lxcconf2xml-simple-v3.config | 4 ++--
6 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/src/lxc/lxc_native.c b/src/lxc/lxc_native.c
index 5462b74b85..ea79c90f83 100644
--- a/src/lxc/lxc_native.c
+++ b/src/lxc/lxc_native.c
@@ -44,10 +44,12 @@ VIR_ENUM_IMPL(virLXCNetworkConfigEntry,
"flags",
"macvlan.mode",
"vlan.id",
- "ipv4",
+ "ipv4", /* Legacy: LXC IPv4 address */
"ipv4.gateway",
- "ipv6",
- "ipv6.gateway"
+ "ipv4.address",
+ "ipv6", /* Legacy: LXC IPv6 address */
+ "ipv6.gateway",
+ "ipv6.address"
);
static virDomainFSDefPtr
@@ -570,7 +572,7 @@ lxcNetworkParseDataIPs(const char *name,
if (VIR_ALLOC(ip) < 0)
return -1;
- if (STREQ(name, "ipv6"))
+ if (STREQ(name, "ipv6") || STREQ(name, "ipv6.address"))
family = AF_INET6;
ipparts = virStringSplit(value->str, "/", 2);
@@ -627,7 +629,9 @@ lxcNetworkParseDataSuffix(const char *entry,
parseData->name = value->str;
break;
case VIR_LXC_NETWORK_CONFIG_IPV4:
+ case VIR_LXC_NETWORK_CONFIG_IPV4_ADDRESS:
case VIR_LXC_NETWORK_CONFIG_IPV6:
+ case VIR_LXC_NETWORK_CONFIG_IPV6_ADDRESS:
if (lxcNetworkParseDataIPs(entry, value, parseData) < 0)
return -1;
break;
diff --git a/src/lxc/lxc_native.h b/src/lxc/lxc_native.h
index f16407f2e6..813272e129 100644
--- a/src/lxc/lxc_native.h
+++ b/src/lxc/lxc_native.h
@@ -35,8 +35,10 @@ typedef enum {
VIR_LXC_NETWORK_CONFIG_VLAN_ID,
VIR_LXC_NETWORK_CONFIG_IPV4,
VIR_LXC_NETWORK_CONFIG_IPV4_GATEWAY,
+ VIR_LXC_NETWORK_CONFIG_IPV4_ADDRESS,
VIR_LXC_NETWORK_CONFIG_IPV6,
VIR_LXC_NETWORK_CONFIG_IPV6_GATEWAY,
+ VIR_LXC_NETWORK_CONFIG_IPV6_ADDRESS,
VIR_LXC_NETWORK_CONFIG_LAST,
} virLXCNetworkConfigEntry;
diff --git a/tests/lxcconf2xmldata/lxcconf2xml-ethernet-v3.config b/tests/lxcconf2xmldata/lxcconf2xml-ethernet-v3.config
index 0a641549f3..f2ca48f1f2 100644
--- a/tests/lxcconf2xmldata/lxcconf2xml-ethernet-v3.config
+++ b/tests/lxcconf2xmldata/lxcconf2xml-ethernet-v3.config
@@ -5,9 +5,9 @@ lxc.net.0.type = veth
lxc.net.0.flags = up
lxc.net.0.hwaddr = 02:00:15:8f:05:c1
lxc.net.0.name = eth0
-lxc.net.0.ipv4 = 192.168.122.2/24
+lxc.net.0.ipv4.address = 192.168.122.2/24
lxc.net.0.ipv4.gateway = 192.168.122.1
-lxc.net.0.ipv6 = 2003:db8:1:0:214:1234:fe0b:3596/64
+lxc.net.0.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3596/64
lxc.net.0.ipv6.gateway = 2003:db8:1:0:214:1234:fe0b:3595
#remove next line if host DNS configuration should not be available to container
diff --git a/tests/lxcconf2xmldata/lxcconf2xml-miscnetwork-v3.config b/tests/lxcconf2xmldata/lxcconf2xml-miscnetwork-v3.config
index 537da64592..6bc22b8e46 100644
--- a/tests/lxcconf2xmldata/lxcconf2xml-miscnetwork-v3.config
+++ b/tests/lxcconf2xmldata/lxcconf2xml-miscnetwork-v3.config
@@ -1,9 +1,9 @@
lxc.net.0.type = phys
lxc.net.0.link = eth0
lxc.net.0.name = eth1
-lxc.net.0.ipv4 = 192.168.122.2/24
+lxc.net.0.ipv4.address = 192.168.122.2/24
lxc.net.0.ipv4.gateway = 192.168.122.1
-lxc.net.0.ipv6 = 2003:db8:1:0:214:1234:fe0b:3596/64
+lxc.net.0.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3596/64
lxc.net.0.ipv6.gateway = 2003:db8:1:0:214:1234:fe0b:3595
lxc.net.1.type = vlan
diff --git a/tests/lxcconf2xmldata/lxcconf2xml-physnetwork-v3.config b/tests/lxcconf2xmldata/lxcconf2xml-physnetwork-v3.config
index 9cf96163b3..649b73c8b8 100644
--- a/tests/lxcconf2xmldata/lxcconf2xml-physnetwork-v3.config
+++ b/tests/lxcconf2xmldata/lxcconf2xml-physnetwork-v3.config
@@ -1,9 +1,9 @@
lxc.net.0.type = phys
lxc.net.0.link = eth0
lxc.net.0.name = eth1
-lxc.net.0.ipv4 = 192.168.122.2/24
+lxc.net.0.ipv4.address = 192.168.122.2/24
lxc.net.0.ipv4.gateway = 192.168.122.1
-lxc.net.0.ipv6 = 2003:db8:1:0:214:1234:fe0b:3596/64
+lxc.net.0.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3596/64
lxc.net.0.ipv6.gateway = 2003:db8:1:0:214:1234:fe0b:3595
lxc.rootfs.path = /var/lib/lxc/migrate_test/rootfs
diff --git a/tests/lxcconf2xmldata/lxcconf2xml-simple-v3.config b/tests/lxcconf2xmldata/lxcconf2xml-simple-v3.config
index b0656571b2..ecd71044f9 100644
--- a/tests/lxcconf2xmldata/lxcconf2xml-simple-v3.config
+++ b/tests/lxcconf2xmldata/lxcconf2xml-simple-v3.config
@@ -6,9 +6,9 @@ lxc.net.0.flags = up
lxc.net.0.link = virbr0
lxc.net.0.hwaddr = 02:00:15:8f:05:c1
lxc.net.0.name = eth0
-lxc.net.0.ipv4 = 192.168.122.2/24
+lxc.net.0.ipv4.address = 192.168.122.2/24
lxc.net.0.ipv4.gateway = 192.168.122.1
-lxc.net.0.ipv6 = 2003:db8:1:0:214:1234:fe0b:3596/64
+lxc.net.0.ipv6.address = 2003:db8:1:0:214:1234:fe0b:3596/64
lxc.net.0.ipv6.gateway = 2003:db8:1:0:214:1234:fe0b:3595
#remove next line if host DNS configuration should not be available to container
--
2.20.1
4 years, 8 months
[libvirt PATCHv3 00/12] add virtiofs support (virtio-fs epopee)
by Ján Tomko
https://bugzilla.redhat.com/show_bug.cgi?id=1694166
v1: https://www.redhat.com/archives/libvir-list/2019-November/msg00005.html
v2: https://www.redhat.com/archives/libvir-list/2020-January/msg00980.html
new in v3:
* renamed qemu.conf option
* removed cache-size since it was not yet merged in upstream QEMU
* use XPath for XML parsing
* separated virtiofsd options under the <binary> element [0]
* the binary path is now autodetected from vhost-user schemas
* log virtiofsd output into a file instead of syslog
[0] naming is hard
Ján Tomko (12):
qemuExtDevicesStart: pass logManager
schema: wrap fsDriver in a choice group
qemu: add QEMU_CAPS_VHOST_USER_FS
docs: add virtiofs kbase
conf: qemu: add virtiofs fsdriver type
conf: add virtiofs-related elements and attributes
qemu: add virtiofsd_debug to qemu.conf
qemu: validate virtiofs filesystems
qemu: forbid migration with vhost-user-fs device
qemu: add code for handling virtiofsd
qemu: use the vhost-user schemas to find binary
qemu: build vhost-user-fs device command line
docs/formatdomain.html.in | 35 +-
docs/kbase.html.in | 3 +
docs/kbase/virtiofs.rst | 152 +++++++++
docs/schemas/domaincommon.rng | 88 ++++-
po/POTFILES.in | 1 +
src/conf/domain_conf.c | 108 ++++++-
src/conf/domain_conf.h | 16 +
src/libvirt_private.syms | 1 +
src/qemu/Makefile.inc.am | 2 +
src/qemu/libvirtd_qemu.aug | 1 +
src/qemu/qemu.conf | 7 +
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 47 ++-
src/qemu/qemu_conf.c | 2 +
src/qemu/qemu_conf.h | 1 +
src/qemu/qemu_domain.c | 33 +-
src/qemu/qemu_domain.h | 2 +-
src/qemu/qemu_domain_address.c | 4 +
src/qemu/qemu_extdevice.c | 28 ++
src/qemu/qemu_extdevice.h | 1 +
src/qemu/qemu_migration.c | 10 +
src/qemu/qemu_process.c | 4 +-
src/qemu/qemu_vhost_user.c | 40 +++
src/qemu/qemu_vhost_user.h | 4 +
src/qemu/qemu_virtiofs.c | 302 ++++++++++++++++++
src/qemu/qemu_virtiofs.h | 42 +++
src/qemu/test_libvirtd_qemu.aug.in | 1 +
.../caps_4.2.0.aarch64.xml | 1 +
.../qemucapabilitiesdata/caps_4.2.0.s390x.xml | 1 +
.../caps_4.2.0.x86_64.xml | 1 +
.../caps_5.0.0.x86_64.xml | 1 +
...vhost-user-fs-fd-memory.x86_64-latest.args | 39 +++
.../vhost-user-fs-fd-memory.xml | 43 +++
...vhost-user-fs-hugepages.x86_64-latest.args | 47 +++
.../vhost-user-fs-hugepages.xml | 75 +++++
tests/qemuxml2argvtest.c | 14 +
.../vhost-user-fs-fd-memory.x86_64-latest.xml | 1 +
.../vhost-user-fs-hugepages.x86_64-latest.xml | 1 +
tests/qemuxml2xmltest.c | 3 +
40 files changed, 1144 insertions(+), 21 deletions(-)
create mode 100644 docs/kbase/virtiofs.rst
create mode 100644 src/qemu/qemu_virtiofs.c
create mode 100644 src/qemu/qemu_virtiofs.h
create mode 100644 tests/qemuxml2argvdata/vhost-user-fs-fd-memory.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/vhost-user-fs-fd-memory.xml
create mode 100644 tests/qemuxml2argvdata/vhost-user-fs-hugepages.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/vhost-user-fs-hugepages.xml
create mode 120000 tests/qemuxml2xmloutdata/vhost-user-fs-fd-memory.x86_64-latest.xml
create mode 120000 tests/qemuxml2xmloutdata/vhost-user-fs-hugepages.x86_64-latest.xml
--
2.21.0
4 years, 8 months
[PULL 3/3] qemu-nbd: Removed deprecated --partition option
by Eric Blake
The option was deprecated in 4.0.0 (commit 0ae2d546); it's now been
long enough with no complaints to follow through with that process.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
Message-Id: <20200123164650.1741798-3-eblake(a)redhat.com>
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
---
docs/interop/qemu-nbd.rst | 15 ++---
qemu-deprecated.texi | 49 ++++++--------
qemu-nbd.c | 133 +-------------------------------------
3 files changed, 24 insertions(+), 173 deletions(-)
diff --git a/docs/interop/qemu-nbd.rst b/docs/interop/qemu-nbd.rst
index df7b6b9d0d60..e54840310056 100644
--- a/docs/interop/qemu-nbd.rst
+++ b/docs/interop/qemu-nbd.rst
@@ -72,13 +72,6 @@ driver options if ``--image-opts`` is specified.
Export the disk as read-only.
-.. option:: -P, --partition=NUM
-
- Deprecated: Only expose MBR partition *NUM*. Understands physical
- partitions 1-4 and logical partition 5. New code should instead use
- :option:`--image-opts` with the raw driver wrapping a subset of the
- original image.
-
.. option:: -B, --bitmap=NAME
If *filename* has a qcow2 persistent bitmap *NAME*, expose
@@ -224,14 +217,14 @@ a 1 megabyte subset of a raw file, using the export name 'subset':
-t -x subset -p 10810 \
--image-opts driver=raw,offset=1M,size=1M,file.driver=file,file.filename=file.raw
-Serve a read-only copy of just the first MBR partition of a guest
-image over a Unix socket with as many as 5 simultaneous readers, with
-a persistent process forked as a daemon:
+Serve a read-only copy of a guest image over a Unix socket with as
+many as 5 simultaneous readers, with a persistent process forked as a
+daemon:
::
qemu-nbd --fork --persistent --shared=5 --socket=/path/to/sock \
- --partition=1 --read-only --format=qcow2 file.qcow2
+ --read-only --format=qcow2 file.qcow2
Expose the guest-visible contents of a qcow2 file via a block device
/dev/nbd0 (and possibly creating /dev/nbd0p1 and friends for
diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi
index c8ee68a4663a..2634e00ec826 100644
--- a/qemu-deprecated.texi
+++ b/qemu-deprecated.texi
@@ -313,37 +313,6 @@ The above, converted to the current supported format:
@section Related binaries
-@subsection qemu-nbd --partition (since 4.0.0)
-
-The ``qemu-nbd --partition $digit'' code (also spelled @option{-P})
-can only handle MBR partitions, and has never correctly handled
-logical partitions beyond partition 5. If you know the offset and
-length of the partition (perhaps by using @code{sfdisk} within the
-guest), you can achieve the effect of exporting just that subset of
-the disk by use of the @option{--image-opts} option with a raw
-blockdev using the @code{offset} and @code{size} parameters layered on
-top of any other existing blockdev. For example, if partition 1 is
-100MiB long starting at 1MiB, the old command:
-
-@code{qemu-nbd -t -P 1 -f qcow2 file.qcow2}
-
-can be rewritten as:
-
-@code{qemu-nbd -t --image-opts driver=raw,offset=1M,size=100M,file.driver=qcow2,file.file.driver=file,file.file.filename=file.qcow2}
-
-Alternatively, the @code{nbdkit} project provides a more powerful
-partition filter on top of its nbd plugin, which can be used to select
-an arbitrary MBR or GPT partition on top of any other full-image NBD
-export. Using this to rewrite the above example results in:
-
-@code{qemu-nbd -t -k /tmp/sock -f qcow2 file.qcow2 &}
-@code{nbdkit -f --filter=partition nbd socket=/tmp/sock partition=1}
-
-Note that if you are exposing the export via /dev/nbd0, it is easier
-to just export the entire image and then mount only /dev/nbd0p1 than
-it is to reinvoke @command{qemu-nbd -c /dev/nbd0} limited to just a
-subset of the image.
-
@subsection qemu-img convert -n -o (since 4.2.0)
All options specified in @option{-o} are image creation options, so
@@ -400,3 +369,21 @@ trouble after a recent upgrade.
The "autoload" parameter has been ignored since 2.12.0. All bitmaps
are automatically loaded from qcow2 images.
+
+@section Related binaries
+
+@subsection qemu-nbd --partition (removed in 5.0.0)
+
+The ``qemu-nbd --partition $digit'' code (also spelled @option{-P})
+could only handle MBR partitions, and never correctly handled logical
+partitions beyond partition 5. Exporting a partition can still be
+done by utilizing the @option{--image-opts} option with a raw blockdev
+using the @code{offset} and @code{size} parameters layered on top of
+any other existing blockdev. For example, if partition 1 is 100MiB
+long starting at 1MiB, the old command:
+
+@code{qemu-nbd -t -P 1 -f qcow2 file.qcow2}
+
+can be rewritten as:
+
+@code{qemu-nbd -t --image-opts driver=raw,offset=1M,size=100M,file.driver=qcow2,file.file.driver=file,file.file.filename=file.qcow2}
diff --git a/qemu-nbd.c b/qemu-nbd.c
index db29a0d0ed25..4aa005004ebd 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -100,7 +100,6 @@ static void usage(const char *name)
"\n"
"Exposing part of the image:\n"
" -o, --offset=OFFSET offset into the image\n"
-" -P, --partition=NUM only expose partition NUM\n"
" -B, --bitmap=NAME expose a persistent dirty bitmap\n"
"\n"
"General purpose options:\n"
@@ -156,96 +155,6 @@ QEMU_COPYRIGHT "\n"
, name);
}
-struct partition_record
-{
- uint8_t bootable;
- uint8_t start_head;
- uint32_t start_cylinder;
- uint8_t start_sector;
- uint8_t system;
- uint8_t end_head;
- uint8_t end_cylinder;
- uint8_t end_sector;
- uint32_t start_sector_abs;
- uint32_t nb_sectors_abs;
-};
-
-static void read_partition(uint8_t *p, struct partition_record *r)
-{
- r->bootable = p[0];
- r->start_head = p[1];
- r->start_cylinder = p[3] | ((p[2] << 2) & 0x0300);
- r->start_sector = p[2] & 0x3f;
- r->system = p[4];
- r->end_head = p[5];
- r->end_cylinder = p[7] | ((p[6] << 2) & 0x300);
- r->end_sector = p[6] & 0x3f;
-
- r->start_sector_abs = ldl_le_p(p + 8);
- r->nb_sectors_abs = ldl_le_p(p + 12);
-}
-
-static int find_partition(BlockBackend *blk, int partition,
- uint64_t *offset, uint64_t *size)
-{
- struct partition_record mbr[4];
- uint8_t data[MBR_SIZE];
- int i;
- int ext_partnum = 4;
- int ret;
-
- ret = blk_pread(blk, 0, data, sizeof(data));
- if (ret < 0) {
- error_report("error while reading: %s", strerror(-ret));
- exit(EXIT_FAILURE);
- }
-
- if (data[510] != 0x55 || data[511] != 0xaa) {
- return -EINVAL;
- }
-
- for (i = 0; i < 4; i++) {
- read_partition(&data[446 + 16 * i], &mbr[i]);
-
- if (!mbr[i].system || !mbr[i].nb_sectors_abs) {
- continue;
- }
-
- if (mbr[i].system == 0xF || mbr[i].system == 0x5) {
- struct partition_record ext[4];
- uint8_t data1[MBR_SIZE];
- int j;
-
- ret = blk_pread(blk, mbr[i].start_sector_abs * MBR_SIZE,
- data1, sizeof(data1));
- if (ret < 0) {
- error_report("error while reading: %s", strerror(-ret));
- exit(EXIT_FAILURE);
- }
-
- for (j = 0; j < 4; j++) {
- read_partition(&data1[446 + 16 * j], &ext[j]);
- if (!ext[j].system || !ext[j].nb_sectors_abs) {
- continue;
- }
-
- if ((ext_partnum + j + 1) == partition) {
- *offset = (uint64_t)ext[j].start_sector_abs << 9;
- *size = (uint64_t)ext[j].nb_sectors_abs << 9;
- return 0;
- }
- }
- ext_partnum += 4;
- } else if ((i + 1) == partition) {
- *offset = (uint64_t)mbr[i].start_sector_abs << 9;
- *size = (uint64_t)mbr[i].nb_sectors_abs << 9;
- return 0;
- }
- }
-
- return -ENOENT;
-}
-
static void termsig_handler(int signum)
{
atomic_cmpxchg(&state, RUNNING, TERMINATE);
@@ -617,7 +526,7 @@ int main(int argc, char **argv)
int64_t fd_size;
QemuOpts *sn_opts = NULL;
const char *sn_id_or_name = NULL;
- const char *sopt = "hVb:o:p:rsnP:c:dvk:e:f:tl:x:T:D:B:L";
+ const char *sopt = "hVb:o:p:rsnc:dvk:e:f:tl:x:T:D:B:L";
struct option lopt[] = {
{ "help", no_argument, NULL, 'h' },
{ "version", no_argument, NULL, 'V' },
@@ -626,7 +535,6 @@ int main(int argc, char **argv)
{ "socket", required_argument, NULL, 'k' },
{ "offset", required_argument, NULL, 'o' },
{ "read-only", no_argument, NULL, 'r' },
- { "partition", required_argument, NULL, 'P' },
{ "bitmap", required_argument, NULL, 'B' },
{ "connect", required_argument, NULL, 'c' },
{ "disconnect", no_argument, NULL, 'd' },
@@ -657,7 +565,6 @@ int main(int argc, char **argv)
int ch;
int opt_ind = 0;
int flags = BDRV_O_RDWR;
- int partition = 0;
int ret = 0;
bool seen_cache = false;
bool seen_discard = false;
@@ -789,15 +696,6 @@ int main(int argc, char **argv)
readonly = true;
flags &= ~BDRV_O_RDWR;
break;
- case 'P':
- warn_report("The '-P' option is deprecated; use --image-opts with "
- "a raw device wrapper for subset exports instead");
- if (qemu_strtoi(optarg, NULL, 0, &partition) < 0 ||
- partition < 1 || partition > 8) {
- error_report("Invalid partition '%s'", optarg);
- exit(EXIT_FAILURE);
- }
- break;
case 'B':
bitmap = optarg;
break;
@@ -894,7 +792,7 @@ int main(int argc, char **argv)
error_report("List mode is incompatible with a file name");
exit(EXIT_FAILURE);
}
- if (export_name || export_description || dev_offset || partition ||
+ if (export_name || export_description || dev_offset ||
device || disconnect || fmt || sn_id_or_name || bitmap ||
seen_aio || seen_discard || seen_cache) {
error_report("List mode is incompatible with per-device settings");
@@ -1158,33 +1056,6 @@ int main(int argc, char **argv)
}
fd_size -= dev_offset;
- if (partition) {
- uint64_t limit;
-
- if (dev_offset) {
- error_report("Cannot request partition and offset together");
- exit(EXIT_FAILURE);
- }
- ret = find_partition(blk, partition, &dev_offset, &limit);
- if (ret < 0) {
- error_report("Could not find partition %d: %s", partition,
- strerror(-ret));
- exit(EXIT_FAILURE);
- }
- /*
- * MBR partition limits are (32-bit << 9); this assert lets
- * the compiler know that we can't overflow 64 bits.
- */
- assert(dev_offset + limit >= dev_offset);
- if (dev_offset + limit > fd_size) {
- error_report("Discovered partition %d at offset %" PRIu64
- " size %" PRIu64 ", but size exceeds file length %"
- PRId64, partition, dev_offset, limit, fd_size);
- exit(EXIT_FAILURE);
- }
- fd_size = limit;
- }
-
export = nbd_export_new(bs, dev_offset, fd_size, export_name,
export_description, bitmap, readonly, shared > 1,
nbd_export_closed, writethrough, NULL,
--
2.24.1
4 years, 8 months
[PULL 2/3] docs: Fix typo in qemu-nbd -P replacement
by Eric Blake
The suggested replacement for the deprecated 'qemu-nbd -P' refers to
'file.backing.opt' instead of 'file.file.opt'; using the example
verbatim results in:
qemu-nbd: Failed to blk_new_open 'driver=raw,offset=1m,size=100m,file.driver=qcow2,file.backing.driver=file,file.backing.filename=file4': A block device must be specified for "file"
Correct this text, prior to actually finishing the deprecation process.
Fixes: 0ae2d54645eb
Reported-by: Max Reitz <mreitz(a)redhat.com>
Signed-off-by: Eric Blake <eblake(a)redhat.com>
Message-Id: <20200123164650.1741798-2-eblake(a)redhat.com>
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
---
qemu-deprecated.texi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi
index ea3e10bde398..c8ee68a4663a 100644
--- a/qemu-deprecated.texi
+++ b/qemu-deprecated.texi
@@ -329,7 +329,7 @@ top of any other existing blockdev. For example, if partition 1 is
can be rewritten as:
-@code{qemu-nbd -t --image-opts driver=raw,offset=1M,size=100M,file.driver=qcow2,file.backing.driver=file,file.backing.filename=file.qcow2}
+@code{qemu-nbd -t --image-opts driver=raw,offset=1M,size=100M,file.driver=qcow2,file.file.driver=file,file.file.filename=file.qcow2}
Alternatively, the @code{nbdkit} project provides a more powerful
partition filter on top of its nbd plugin, which can be used to select
--
2.24.1
4 years, 8 months
[libvirt PATCH] tests: fix deadlock in eventtest
by Pavel Hrdina
There is a race deadlock in eventtest after the recent rewrite to drop
GNULIB from libvirt code base.
The issue happens when the callbacks testPipeReader() or testTimer()
are called before waitEvents() starts waiting on `eventThreadCond`.
It will never happen because the callbacks are already done and there
is nothing that will signal the condition again.
Reported-by: Peter Krempa <pkrempa(a)redhat.com>
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
tests/eventtest.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/tests/eventtest.c b/tests/eventtest.c
index 9855b578fb..fc814922f2 100644
--- a/tests/eventtest.c
+++ b/tests/eventtest.c
@@ -43,6 +43,7 @@ VIR_LOG_INIT("tests.eventtest");
static pthread_mutex_t eventThreadMutex = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t eventThreadCond = PTHREAD_COND_INITIALIZER;
+static bool eventThreadSignaled;
static struct handleInfo {
int pipeFD[2];
@@ -138,8 +139,9 @@ testPipeReader(int watch, int fd, int events, void *data)
virEventRemoveHandle(info->delete);
cleanup:
- pthread_mutex_unlock(&eventThreadMutex);
pthread_cond_signal(&eventThreadCond);
+ eventThreadSignaled = true;
+ pthread_mutex_unlock(&eventThreadMutex);
}
@@ -164,8 +166,9 @@ testTimer(int timer, void *data)
virEventRemoveTimeout(info->delete);
cleanup:
- pthread_mutex_unlock(&eventThreadMutex);
pthread_cond_signal(&eventThreadCond);
+ eventThreadSignaled = true;
+ pthread_mutex_unlock(&eventThreadMutex);
}
G_GNUC_NORETURN static void *eventThreadLoop(void *data G_GNUC_UNUSED) {
@@ -185,7 +188,10 @@ waitEvents(int nhandle, int ntimer)
VIR_DEBUG("Wait events nhandle %d ntimer %d",
nhandle, ntimer);
while (ngothandle != nhandle || ngottimer != ntimer) {
- pthread_cond_wait(&eventThreadCond, &eventThreadMutex);
+ while (!eventThreadSignaled)
+ pthread_cond_wait(&eventThreadCond, &eventThreadMutex);
+
+ eventThreadSignaled = 0;
ngothandle = ngottimer = 0;
for (i = 0; i < NUM_FDS; i++) {
--
2.24.1
4 years, 8 months
[PATCH] lxc: Fix segfault when lxc.network does not start with 'type'
by Julio Faracco
To configure network settings using config file, legacy LXC settings
require starting them with 'lxc.network.type' entry. If someone
accidentally starts with 'lxc.network.name', libvirt will crash with
segfault. This patch checks if this case is happening.
Sample invalid settings:
lxc.network.link = eth0
lxc.network.type = phys
lxc.network.name = eth1
lxc.network.ipv4 = 192.168.122.2/24
lxc.network.ipv4.gateway = 192.168.122.1
Now, libvirt only see error without segmentation fault.
Signed-off-by: Julio Faracco <jcfaracco(a)gmail.com>
---
src/lxc/lxc_native.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/lxc/lxc_native.c b/src/lxc/lxc_native.c
index 59f3dd4fee..5462b74b85 100644
--- a/src/lxc/lxc_native.c
+++ b/src/lxc/lxc_native.c
@@ -717,7 +717,11 @@ lxcNetworkGetParseDataByIndexLegacy(lxcNetworkParseDataArray *networks,
}
/* Return last element added like a stack. */
- return networks->parseData[ndata - 1];
+ if (networks->ndata > 0)
+ return networks->parseData[ndata - 1];
+
+ /* Not able to retrive an element */
+ return NULL;
}
--
2.20.1
4 years, 8 months
[libvirt-TCK] Disabling the vepa VSI test 300-vsitype.t
by Erik Skultety
Hi list,
so since the beginning of this week I've been poking at the last failure [1]
in the nwfilter segment of the TCK suite. So, the errors come from libnl
although I haven't been able to extract what the true underlying issue is since
interface with ID '8' definitely exist on my system.
A bit of background (you can either clone the repo or look at the Perl script
attached), we're configuring the guest network interface as 'direct' with mode
VEPA. IIUC, for proper VEPA support you need a compliant external switch which
1) I don't have
2) upstream CI planned to run in a nested env won't have either.
The main issue lies in the test trying to set <virtualport> parameters on the
interface. I've tried with regular network interfaces, vlan-tagged interfaces
(as one of the other error messages complained about a missing vlan tag - which
is something VEPA switches supposedly do on their own), and SR-IOV VFs with no
luck. I'd be happy for any networking insights here, but given the setup
which had clearly been tested with specialized HW I'd suggest simply disabling
the test from the suite for upstream purposes - well, the correct approach
would be to introduce a new config option indicating that specialized HW is
necessary since currently the test case kind of abuses the config option
assigning a virtual interface directly to the guest which in this case is a
necessary condition, but not a sufficient one. However, with the Avocado<->TCK
joined work happening, I'd rather not spent more time with Perl than necessary.
[1]
virNetDevVPortProfileOpSetLink:823 : error during virtual port configuration of ifindex 8: No such device or address
virNetDevVPortProfileOpCommon:958 : internal error: sending of PortProfileRequest failed.
Thanks,
Erik
4 years, 8 months
[libvirt] [PATCH for-5.0 0/4] Remove the deprecated bluetooth subsystem
by Thomas Huth
This patch series removes the bitrotten bluetooth subsystem. See
the patch description of the third patch for the rationale.
Thomas Huth (4):
hw/arm/nseries: Replace the bluetooth chardev with a "null" chardev
hw/usb: Remove the USB bluetooth dongle device
Remove the core bluetooth code
Remove libbluetooth / bluez from the CI tests
.gitlab-ci.yml | 2 +-
Makefile.objs | 2 -
bt-host.c | 198 --
bt-vhci.c | 167 --
configure | 31 -
hw/Kconfig | 1 -
hw/Makefile.objs | 1 -
hw/arm/nseries.c | 16 +-
hw/bt/Kconfig | 2 -
hw/bt/Makefile.objs | 3 -
hw/bt/core.c | 143 --
hw/bt/hci-csr.c | 512 -----
hw/bt/hci.c | 2263 --------------------
hw/bt/hid.c | 553 -----
hw/bt/l2cap.c | 1367 ------------
hw/bt/sdp.c | 989 ---------
hw/usb/Kconfig | 5 -
hw/usb/Makefile.objs | 1 -
hw/usb/dev-bluetooth.c | 581 -----
include/hw/bt.h | 2177 -------------------
include/sysemu/bt.h | 20 -
qemu-deprecated.texi | 7 -
qemu-doc.texi | 17 -
qemu-options.hx | 79 -
tests/docker/dockerfiles/fedora.docker | 1 -
tests/docker/dockerfiles/ubuntu.docker | 1 -
tests/docker/dockerfiles/ubuntu1804.docker | 1 -
vl.c | 136 --
28 files changed, 8 insertions(+), 9268 deletions(-)
delete mode 100644 bt-host.c
delete mode 100644 bt-vhci.c
delete mode 100644 hw/bt/Kconfig
delete mode 100644 hw/bt/Makefile.objs
delete mode 100644 hw/bt/core.c
delete mode 100644 hw/bt/hci-csr.c
delete mode 100644 hw/bt/hci.c
delete mode 100644 hw/bt/hid.c
delete mode 100644 hw/bt/l2cap.c
delete mode 100644 hw/bt/sdp.c
delete mode 100644 hw/usb/dev-bluetooth.c
delete mode 100644 include/hw/bt.h
delete mode 100644 include/sysemu/bt.h
--
2.23.0
4 years, 8 months
[PATCH v4 0/4] This series implement support for network syntax settings for LXC 3.X.
by Julio Faracco
Old:
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = virbr0
New:
lxc.net.0.type = veth
lxc.net.0.flags = up
lxc.net.0.link = virbr0
v1-v2: Moving sscanf to virStrToLong_ull according Daniel's suggestion.
v2-v3: Adding missing g_autofree from `suffix` variable.
v2-v4: Removing g_autofree inserted above and adding some missing free
functions. See Daniel's test results/comments.
Julio Faracco (4):
lxc: refactor lxcNetworkParseData pointers to use new structures
lxc: add LXC version 3 network parser
lxc: remove domain definition from lxc network struct
tests: update LXC config dataset to support V3 indexes
src/lxc/lxc_native.c | 200 ++++++++++++------
.../lxcconf2xml-ethernet-v3.config | 16 +-
.../lxcconf2xml-fstab-v3.config | 10 +-
.../lxcconf2xml-macvlannetwork-v3.config | 10 +-
.../lxcconf2xml-miscnetwork-v3.config | 34 +--
.../lxcconf2xml-nonenetwork-v3.config | 2 +-
.../lxcconf2xml-physnetwork-v3.config | 14 +-
.../lxcconf2xml-simple-v3.config | 18 +-
.../lxcconf2xml-vlannetwork-v3.config | 10 +-
9 files changed, 190 insertions(+), 124 deletions(-)
--
2.20.1
4 years, 8 months
[PATCH 0/5] ui: rework -show-cursor option
by Gerd Hoffmann
Gerd Hoffmann (5):
ui: add show-cursor option
ui/gtk: implement show-cursor option
ui/sdl: implement show-cursor option
ui: wire up legacy -show-cursor option
ui: deprecate legacy -show-cursor option
include/sysemu/sysemu.h | 1 -
ui/gtk.c | 8 +++++++-
ui/sdl2.c | 28 ++++++++++++++++++++--------
vl.c | 6 ++++--
qapi/ui.json | 2 ++
qemu-deprecated.texi | 5 +++++
6 files changed, 38 insertions(+), 12 deletions(-)
--
2.18.1
4 years, 8 months