[libvirt] [go PATCH 00/37] Fix error reporting thread safety wrt goroutine rescheduling
by Daniel P. Berrangé
The Libvirt C API provides the virGetLastError() function to let callers
aquire the error information after a function fails. This function uses
a thread local, and so must be called in the same OS thread as the
function that failed originally.
eg you could call
char *xml = virDomainGetXMLDesc(dom);
if (!xml) {
virErrorPtr err = virGetLastError();
....do stuff with err...
}
This is all fine, but there is a subtle problem that was overlooked when
the Go bindings were first created. Specifically a native C API call is
a goroutine re-scheduling point. So when the Go code does
var xml = C.virDomainGetXMLDesc(dom);
if (xml == nil) {
C.virErrorPtr err = C.virGetLastError();
....do stuff with err...
}
All that code runs in the same goroutine, but at the call entry to
C.virGetLastError, the goroutine might get switched to a different
OS level thread. As a result virGetLastError() will return either no
error at all, or an error from a completely different libvirt API call.
We need to prevent the OS level thread being changed in between the call
to the real function and the virGetLastError() function.
Naively you might think we could put a LockOSThread() / UnlockOSThread()
call around this block of Go code, but that is a very bad idea in
reality. Until Go 1.10, the LockOSThread() calls did not ref count, so
if some other code has already locked the thread, when libvirt called
UnlockOSThread it could do bad things. In addition, after calling
UnlockOSThread() the Go runtime doesn't trust the OS thread state
anymore, so will terminate the thread and spawn a new one. IOW using
LockOSThread() would mean every single libvirt API call would create and
destroy a new thread which is horrible for performance.
Thus this patch series takes a different approach. We create a wrapper
function for every C API exposed by libvirt, that has a 'virErrorPtr'
parameter. So the Go code can do
var C.virErrorPtr err
var xml = C.virDomainGetXMLDescWrapper(dom, &err)
if (xml == nil) {
...do stuff with err...
}
The wrapper function is responsible for calling virGetLastError() and
since this is C code, we're guaranteed its all in the same OS level
thread.
Daniel P. Berrangé (37):
error: add helper for converting libvirt to go error objects
storage volume: add missin blank line
Rename *cfuncs.{go,h} to *wrapper.{go,h}
Use "Wrapper" or "Helper" as suffix for C functions
Change "Compat" suffix to "Wrapper" to have standard naming scheme
connect: move wrapper functions out of compat header
network: move wrapper functions out of compat header
nwfilter binding: move wrapper functions out of compat header
node device: move wrapper functions out of compat header
secret: move wrapper functions out of compat header
stream: move wrapper functions out of compat header
storage volume: move wrapper functions out of compat header
storage pool: move wrapper functions out of compat header
qemu: move wrapper functions out of compat header
lxc: move wrapper functions out of compat header
domain: move wrapper functions out of compat header
make the XXX_wrapper.h header files self-contained
Add XXX_wrapper.{h,go} for every remaining file
Standardize formatting in all wrapper headers
storage vol: fix error reporting thread safety
storage pool: fix error reporting thread safety
stream: fix error reporting thread safety
secret: fix error reporting thread safety
nwfilter: fix error reporting thread safety
nwfilter binding: fix error reporting thread safety
node device: fix error reporting thread safety
network: fix error reporting thread safety
interface: fix error reporting thread safety
domain snapshot: fix error reporting thread safety
connect: fix error reporting thread safety
domain: fix error reporting thread safety
qemu: fix error reporting thread safety
lxc: fix error reporting thread safety
events: fix error reporting thread safety
error: remove GetLastError() function
error: make GetNotImplementedError private
connect: add missing references on domain object in stats records
api_test.go | 5 +-
callbacks.go | 4 +-
callbacks_cfuncs.go => callbacks_wrapper.go | 6 +-
callbacks_cfuncs.h => callbacks_wrapper.h | 8 +-
connect.go | 741 +++---
connect_cfuncs.h | 34 -
connect_compat.go | 206 --
connect_compat.h | 81 -
connect_wrapper.go | 1766 +++++++++++++
connect_wrapper.h | 730 ++++++
domain.go | 1083 ++++----
domain_compat.go | 384 ---
domain_compat.h | 141 -
domain_events.go | 235 +-
domain_events_cfuncs.h | 124 -
...ents_cfuncs.go => domain_events_wrapper.go | 85 +-
domain_events_wrapper.h | 207 ++
domain_snapshot.go | 65 +-
domain_snapshot_wrapper.go | 215 ++
domain_snapshot_wrapper.h | 102 +
domain_wrapper.go | 2330 +++++++++++++++++
domain_wrapper.h | 986 +++++++
error.go | 17 +-
error_test.go | 44 -
events.go | 45 +-
events_cfuncs.h | 39 -
events_cfuncs.go => events_wrapper.go | 89 +-
events_wrapper.h | 82 +
interface.go | 48 +-
interface_wrapper.go | 158 ++
interface_wrapper.h | 76 +
lxc.go | 27 +-
lxc_compat.go | 51 -
lxc_wrapper.go | 101 +
lxc_compat.h => lxc_wrapper.h | 33 +-
network.go | 88 +-
network_compat.h | 10 -
network_events.go | 23 +-
network_events_cfuncs.h | 38 -
...nts_cfuncs.go => network_events_wrapper.go | 41 +-
network_compat.go => network_events_wrapper.h | 51 +-
network_wrapper.go | 267 ++
network_wrapper.h | 119 +
node_device.go | 66 +-
node_device_compat.go | 46 -
node_device_compat.h | 3 -
node_device_events.go | 32 +-
node_device_events_cfuncs.h | 40 -
...cfuncs.go => node_device_events_wrapper.go | 46 +-
..._cfuncs.go => node_device_events_wrapper.h | 73 +-
node_device_wrapper.go | 184 ++
node_device_wrapper.h | 88 +
nwfilter.go | 38 +-
nwfilter_binding.go | 46 +-
nwfilter_binding_compat.h | 11 -
...g_compat.go => nwfilter_binding_wrapper.go | 66 +-
nwfilter_binding_wrapper.h | 60 +
nwfilter_wrapper.go | 122 +
nwfilter_wrapper.h | 65 +
qemu.go | 43 +-
qemu_cfuncs.go | 64 -
qemu_cfuncs.h | 39 -
qemu_compat.go | 48 -
qemu_compat.h | 3 -
qemu_wrapper.go | 133 +
qemu_wrapper.h | 78 +
secret.go | 54 +-
secret_compat.h | 3 -
secret_events.go | 34 +-
secret_events_cfuncs.h | 40 -
...ents_cfuncs.go => secret_events_wrapper.go | 45 +-
secret_compat.go => secret_events_wrapper.h | 41 +-
secret_wrapper.go | 175 ++
secret_wrapper.h | 86 +
storage_pool.go | 121 +-
storage_pool_compat.h | 4 -
storage_pool_events.go | 34 +-
storage_pool_events_cfuncs.h | 40 -
...funcs.go => storage_pool_events_wrapper.go | 46 +-
...compat.go => storage_pool_events_wrapper.h | 43 +-
storage_pool_wrapper.go | 343 +++
storage_pool_wrapper.h | 150 ++
storage_volume.go | 86 +-
storage_volume_compat.go | 47 -
storage_volume_compat.h | 4 -
storage_volume_wrapper.go | 249 ++
storage_volume_wrapper.h | 116 +
stream.go | 95 +-
stream_cfuncs.go | 132 -
stream_cfuncs.h | 37 -
stream_compat.go | 69 -
stream_compat.h | 13 -
stream_wrapper.go | 331 +++
stream_wrapper.h | 120 +
94 files changed, 11619 insertions(+), 3318 deletions(-)
rename callbacks_cfuncs.go => callbacks_wrapper.go (90%)
rename callbacks_cfuncs.h => callbacks_wrapper.h (87%)
delete mode 100644 connect_cfuncs.h
delete mode 100644 connect_compat.go
create mode 100644 connect_wrapper.go
create mode 100644 connect_wrapper.h
delete mode 100644 domain_compat.go
delete mode 100644 domain_events_cfuncs.h
rename domain_events_cfuncs.go => domain_events_wrapper.go (75%)
create mode 100644 domain_events_wrapper.h
create mode 100644 domain_snapshot_wrapper.go
create mode 100644 domain_snapshot_wrapper.h
create mode 100644 domain_wrapper.go
create mode 100644 domain_wrapper.h
delete mode 100644 error_test.go
delete mode 100644 events_cfuncs.h
rename events_cfuncs.go => events_wrapper.go (72%)
create mode 100644 events_wrapper.h
create mode 100644 interface_wrapper.go
create mode 100644 interface_wrapper.h
delete mode 100644 lxc_compat.go
create mode 100644 lxc_wrapper.go
rename lxc_compat.h => lxc_wrapper.h (53%)
delete mode 100644 network_events_cfuncs.h
rename network_events_cfuncs.go => network_events_wrapper.go (59%)
rename network_compat.go => network_events_wrapper.h (57%)
create mode 100644 network_wrapper.go
create mode 100644 network_wrapper.h
delete mode 100644 node_device_compat.go
delete mode 100644 node_device_events_cfuncs.h
rename node_device_events_cfuncs.go => node_device_events_wrapper.go (59%)
rename connect_cfuncs.go => node_device_events_wrapper.h (52%)
create mode 100644 node_device_wrapper.go
create mode 100644 node_device_wrapper.h
rename nwfilter_binding_compat.go => nwfilter_binding_wrapper.go (54%)
create mode 100644 nwfilter_binding_wrapper.h
create mode 100644 nwfilter_wrapper.go
create mode 100644 nwfilter_wrapper.h
delete mode 100644 qemu_cfuncs.go
delete mode 100644 qemu_cfuncs.h
delete mode 100644 qemu_compat.go
create mode 100644 qemu_wrapper.go
create mode 100644 qemu_wrapper.h
delete mode 100644 secret_events_cfuncs.h
rename secret_events_cfuncs.go => secret_events_wrapper.go (61%)
rename secret_compat.go => secret_events_wrapper.h (54%)
create mode 100644 secret_wrapper.go
create mode 100644 secret_wrapper.h
delete mode 100644 storage_pool_events_cfuncs.h
rename storage_pool_events_cfuncs.go => storage_pool_events_wrapper.go (60%)
rename storage_pool_compat.go => storage_pool_events_wrapper.h (51%)
create mode 100644 storage_pool_wrapper.go
create mode 100644 storage_pool_wrapper.h
delete mode 100644 storage_volume_compat.go
create mode 100644 storage_volume_wrapper.go
create mode 100644 storage_volume_wrapper.h
delete mode 100644 stream_cfuncs.go
delete mode 100644 stream_cfuncs.h
delete mode 100644 stream_compat.go
create mode 100644 stream_wrapper.go
create mode 100644 stream_wrapper.h
--
2.17.1
6 years, 4 months
[libvirt] [PATCH] tests: also skip qemuagenttest with old jansson
by Ján Tomko
qemuagenttest also depends on JSON object key ordering:
Invalid value of argument 'vcpus' of command 'guest-set-vcpus':
expected '[{"logical-id":1,"online":false}]' got '[{"online":false,"logical-id":1}]'
Skip it as well.
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
Pushed as a build breaker fix for Debian 8.
tests/qemuagenttest.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/qemuagenttest.c b/tests/qemuagenttest.c
index 232b34f9cd..b3d737d8a8 100644
--- a/tests/qemuagenttest.c
+++ b/tests/qemuagenttest.c
@@ -907,8 +907,8 @@ mymain(void)
{
int ret = 0;
-#if !WITH_JANSSON
- fputs("libvirt not compiled with JSON support, skipping this test\n", stderr);
+#if !WITH_STABLE_ORDERING_JANSSON
+ fputs("libvirt not compiled with recent enough Jansson, skipping this test\n", stderr);
return EXIT_AM_SKIP;
#endif
--
2.16.1
6 years, 4 months
[libvirt] [PATCH] qemu: hotplug: Don't leak saved error on failure in qemuHotplugRemoveManagedPR
by Peter Krempa
If we'd fail to enter or exit the monitor the saved error would be
leaked. Introduced in 8498a1e2221 .
Pointed out by coverity.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_hotplug.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index fe703ab4bd..1488f0a7c2 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -354,22 +354,26 @@ qemuHotplugRemoveManagedPR(virQEMUDriverPtr driver,
{
qemuDomainObjPrivatePtr priv = vm->privateData;
virErrorPtr orig_err;
- virErrorPreserveLast(&orig_err);
+ int ret = -1;
if (!priv->prDaemonRunning ||
virDomainDefHasManagedPR(vm->def))
return 0;
+ virErrorPreserveLast(&orig_err);
+
if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
- return -1;
+ goto cleanup;
ignore_value(qemuMonitorDelObject(priv->mon, qemuDomainGetManagedPRAlias()));
if (qemuDomainObjExitMonitor(driver, vm) < 0)
- return -1;
+ goto cleanup;
qemuProcessKillManagedPRDaemon(vm);
- virErrorRestore(&orig_err);
- return 0;
+ ret = 0;
+ cleanup:
+ virErrorRestore(&orig_err);
+ return ret;
}
--
2.16.2
6 years, 4 months
[libvirt] [python PATCH 0/3] rpm: misc updates to modernize spec
by Daniel P. Berrangé
Daniel P. Berrangé (3):
rpm: use the versioned python2 macro names
rpm: add BuildRequires on gcc
rpm: update min required rhel/fedora
libvirt-python.spec.in | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
--
2.17.1
6 years, 4 months
[libvirt] [PATCH] vmx: add support for hostonly interfaces
by Javier Uruen Val
Vmware fusion allows you to configure a network interface
as "hostonly". This uses a private network that is not
normally accessible from the physical networks on the
Mac/PC.
We map "hostonly" in the vmx configuration to "network"
in the domain configuration. Some comments in vmx.c
seem to point towards using this mapping and not other
such as "internal" or something else.
Added tests and configuration files from actual vmx
machines configured with "hostonly".
Signed-off-by: Javier Uruen Val <javi.uruen(a)gmail.com>
---
src/vmx/vmx.c | 19 ++-
.../vmx2xml-fusion-in-the-wild-2.vmx | 115 ++++++++++++++++++
.../vmx2xml-fusion-in-the-wild-2.xml | 34 ++++++
tests/vmx2xmltest.c | 1 +
.../xml2vmx-fusion-in-the-wild-2.vmx | 36 ++++++
.../xml2vmx-fusion-in-the-wild-2.xml | 31 +++++
tests/xml2vmxtest.c | 1 +
7 files changed, 231 insertions(+), 6 deletions(-)
create mode 100644 tests/vmx2xmldata/vmx2xml-fusion-in-the-wild-2.vmx
create mode 100644 tests/vmx2xmldata/vmx2xml-fusion-in-the-wild-2.xml
create mode 100755 tests/xml2vmxdata/xml2vmx-fusion-in-the-wild-2.vmx
create mode 100644 tests/xml2vmxdata/xml2vmx-fusion-in-the-wild-2.xml
diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c
index fe24b060d7..c812a8fb33 100644
--- a/src/vmx/vmx.c
+++ b/src/vmx/vmx.c
@@ -2650,6 +2650,7 @@ virVMXParseEthernet(virConfPtr conf, int controller, virDomainNetDefPtr *def)
/* vmx:networkName -> def:data.bridge.brname */
if (connectionType == NULL ||
STRCASEEQ(connectionType, "bridged") ||
+ STRCASEEQ(connectionType, "hostonly") ||
STRCASEEQ(connectionType, "custom")) {
if (virVMXGetConfigString(conf, networkName_name, &networkName,
true) < 0)
@@ -2674,11 +2675,12 @@ virVMXParseEthernet(virConfPtr conf, int controller, virDomainNetDefPtr *def)
virtualDev = NULL;
networkName = NULL;
} else if (STRCASEEQ(connectionType, "hostonly")) {
- /* FIXME */
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("No yet handled value '%s' for VMX entry '%s'"),
- connectionType, connectionType_name);
- goto cleanup;
+ (*def)->type = VIR_DOMAIN_NET_TYPE_NETWORK;
+ (*def)->model = virtualDev;
+ (*def)->data.network.name = networkName;
+
+ virtualDev = NULL;
+ networkName = NULL;
} else if (STRCASEEQ(connectionType, "nat")) {
(*def)->type = VIR_DOMAIN_NET_TYPE_USER;
(*def)->model = virtualDev;
@@ -3783,6 +3785,12 @@ virVMXFormatEthernet(virDomainNetDefPtr def, int controller,
case VIR_DOMAIN_NET_TYPE_USER:
virBufferAsprintf(buffer, "ethernet%d.connectionType = \"nat\"\n",
controller);
+
+ break;
+
+ case VIR_DOMAIN_NET_TYPE_NETWORK:
+ virBufferAsprintf(buffer, "ethernet%d.connectionType = \"hostonly\"\n",
+ controller);
break;
case VIR_DOMAIN_NET_TYPE_ETHERNET:
@@ -3790,7 +3798,6 @@ virVMXFormatEthernet(virDomainNetDefPtr def, int controller,
case VIR_DOMAIN_NET_TYPE_SERVER:
case VIR_DOMAIN_NET_TYPE_CLIENT:
case VIR_DOMAIN_NET_TYPE_MCAST:
- case VIR_DOMAIN_NET_TYPE_NETWORK:
case VIR_DOMAIN_NET_TYPE_INTERNAL:
case VIR_DOMAIN_NET_TYPE_DIRECT:
case VIR_DOMAIN_NET_TYPE_HOSTDEV:
diff --git a/tests/vmx2xmldata/vmx2xml-fusion-in-the-wild-2.vmx b/tests/vmx2xmldata/vmx2xml-fusion-in-the-wild-2.vmx
new file mode 100644
index 0000000000..c871cca540
--- /dev/null
+++ b/tests/vmx2xmldata/vmx2xml-fusion-in-the-wild-2.vmx
@@ -0,0 +1,115 @@
+.encoding = "UTF-8"
+config.version = "8"
+virtualHW.version = "12"
+vcpu.hotadd = "TRUE"
+scsi0.present = "TRUE"
+scsi0.virtualDev = "lsilogic"
+sata0.present = "TRUE"
+memsize = "4996"
+mem.hotadd = "TRUE"
+scsi0:0.present = "TRUE"
+scsi0:0.fileName = "Virtual Disk.vmdk"
+sata0:1.present = "TRUE"
+sata0:1.autodetect = "TRUE"
+sata0:1.deviceType = "cdrom-image"
+sata0:1.startConnected = "FALSE"
+ethernet0.present = "TRUE"
+ethernet0.connectionType = "hostonly"
+ethernet0.virtualDev = "e1000"
+ethernet0.wakeOnPcktRcv = "FALSE"
+ethernet0.addressType = "generated"
+ethernet0.linkStatePropagation.enable = "FALSE"
+usb.present = "TRUE"
+ehci.present = "TRUE"
+ehci.pciSlotNumber = "35"
+sound.present = "TRUE"
+sound.fileName = "-1"
+sound.autodetect = "TRUE"
+mks.enable3d = "TRUE"
+svga.graphicsMemoryKB = "786432"
+pciBridge0.present = "TRUE"
+pciBridge4.present = "TRUE"
+pciBridge4.virtualDev = "pcieRootPort"
+pciBridge4.functions = "8"
+pciBridge5.present = "TRUE"
+pciBridge5.virtualDev = "pcieRootPort"
+pciBridge5.functions = "8"
+pciBridge6.present = "TRUE"
+pciBridge6.virtualDev = "pcieRootPort"
+pciBridge6.functions = "8"
+pciBridge7.present = "TRUE"
+pciBridge7.virtualDev = "pcieRootPort"
+pciBridge7.functions = "8"
+vmci0.present = "TRUE"
+hpet0.present = "TRUE"
+usb.vbluetooth.startConnected = "TRUE"
+tools.syncTime = "TRUE"
+displayName = "Ubuntu16.04"
+guestOS = "ubuntu-64"
+nvram = "Ubuntu16.04.nvram"
+virtualHW.productCompatibility = "hosted"
+tools.upgrade.policy = "upgradeAtPowerCycle"
+powerType.powerOff = "soft"
+powerType.powerOn = "soft"
+powerType.suspend = "soft"
+powerType.reset = "soft"
+extendedConfigFile = "Ubuntu16.04.vmxf"
+uuid.bios = "56 4d 97 36 09 cb ba 6f-20 57 e7 01 50 72 7f 3f"
+uuid.location = "56 4d 97 36 09 cb ba 6f-20 57 e7 01 50 72 7f 3f"
+migrate.hostlog = "./Ubuntu16.04-7a77148b.hlog"
+scsi0:0.redo = ""
+pciBridge0.pciSlotNumber = "17"
+pciBridge4.pciSlotNumber = "21"
+pciBridge5.pciSlotNumber = "22"
+pciBridge6.pciSlotNumber = "23"
+pciBridge7.pciSlotNumber = "24"
+scsi0.pciSlotNumber = "16"
+usb.pciSlotNumber = "32"
+ethernet0.pciSlotNumber = "33"
+sound.pciSlotNumber = "34"
+vmci0.pciSlotNumber = "36"
+sata0.pciSlotNumber = "37"
+ethernet0.generatedAddress = "00:0C:29:72:7F:3F"
+ethernet0.generatedAddressOffset = "0"
+vmci0.id = "1349680959"
+monitor.phys_bits_used = "42"
+vmotion.checkpointFBSize = "4194304"
+vmotion.checkpointSVGAPrimarySize = "67108864"
+cleanShutdown = "FALSE"
+softPowerOff = "FALSE"
+usb:1.speed = "2"
+usb:1.present = "TRUE"
+usb:1.deviceType = "hub"
+usb:1.port = "1"
+usb:1.parent = "-1"
+checkpoint.vmState = ""
+sata0:1.fileName = "/Users/johndoe/Downloads/ubuntu-16.04.3-desktop-amd64.iso"
+gui.lastPoweredViewMode = "windowed"
+svga.guestBackedPrimaryAware = "TRUE"
+gui.viewModeAtPowerOn = "windowed"
+tools.remindInstall = "FALSE"
+toolsInstallManager.updateCounter = "2"
+toolsInstallManager.lastInstallError = "0"
+keyboardAndMouseProfile = "52506018-92dd-7b40-6bc7-085ea95583f4"
+isolation.tools.hgfs.disable = "false"
+hgfs.mapRootShare = "true"
+hgfs.linkRootShare = "true"
+sharedFolder0.present = "true"
+sharedFolder0.enabled = "TRUE"
+sharedFolder0.readAccess = "true"
+sharedFolder0.writeAccess = "true"
+sharedFolder0.hostPath = "/Users/johndoe/dev/vmware-shared"
+sharedFolder0.guestName = "vmware-shared"
+sharedFolder0.expiration = "never"
+sharedFolder.maxNum = "1"
+gui.exitOnCLIHLT = "TRUE"
+serial0.present = "FALSE"
+floppy0.present = "FALSE"
+usb:0.present = "TRUE"
+usb:0.deviceType = "hid"
+usb:0.port = "0"
+usb:0.parent = "-1"
+ehci:0.present = "TRUE"
+ehci:0.deviceType = "video"
+ehci:0.port = "0"
+ehci:0.parent = "-1"
diff --git a/tests/vmx2xmldata/vmx2xml-fusion-in-the-wild-2.xml b/tests/vmx2xmldata/vmx2xml-fusion-in-the-wild-2.xml
new file mode 100644
index 0000000000..2e0bf504f0
--- /dev/null
+++ b/tests/vmx2xmldata/vmx2xml-fusion-in-the-wild-2.xml
@@ -0,0 +1,34 @@
+<domain type='vmware'>
+ <name>Ubuntu16.04</name>
+ <uuid>564d9736-09cb-ba6f-2057-e70150727f3f</uuid>
+ <memory unit='KiB'>5115904</memory>
+ <currentMemory unit='KiB'>5115904</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='x86_64'>hvm</type>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <disk type='file' device='disk'>
+ <source file='[datastore] directory/Virtual Disk.vmdk'/>
+ <target dev='sda' bus='scsi'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+ </disk>
+ <controller type='scsi' index='0' model='lsilogic'/>
+ <filesystem type='mount' accessmode='passthrough'>
+ <source dir='/Users/johndoe/dev/vmware-shared'/>
+ <target dir='vmware-shared'/>
+ </filesystem>
+ <interface type='network'>
+ <mac address='00:0c:29:72:7f:3f'/>
+ <source network=''/>
+ <model type='e1000'/>
+ </interface>
+ <video>
+ <model type='vmvga' vram='4096' primary='yes'/>
+ </video>
+ </devices>
+</domain>
diff --git a/tests/vmx2xmltest.c b/tests/vmx2xmltest.c
index 7289dc91e3..0db4702519 100644
--- a/tests/vmx2xmltest.c
+++ b/tests/vmx2xmltest.c
@@ -280,6 +280,7 @@ mymain(void)
DO_TEST("ws-in-the-wild-2", "ws-in-the-wild-2");
DO_TEST("fusion-in-the-wild-1", "fusion-in-the-wild-1");
+ DO_TEST("fusion-in-the-wild-2", "fusion-in-the-wild-2");
DO_TEST("annotation", "annotation");
diff --git a/tests/xml2vmxdata/xml2vmx-fusion-in-the-wild-2.vmx b/tests/xml2vmxdata/xml2vmx-fusion-in-the-wild-2.vmx
new file mode 100755
index 0000000000..a5dbf5244c
--- /dev/null
+++ b/tests/xml2vmxdata/xml2vmx-fusion-in-the-wild-2.vmx
@@ -0,0 +1,36 @@
+.encoding = "UTF-8"
+config.version = "8"
+virtualHW.version = "9"
+guestOS = "other-64"
+uuid.bios = "56 4d 08 c1 40 dd 13 95-85 01 b3 af 47 74 24 7d"
+displayName = "Windows 10 x64"
+memsize = "6728"
+numvcpus = "1"
+scsi0.present = "true"
+scsi0.virtualDev = "lsisas1068"
+scsi0:0.present = "true"
+scsi0:0.deviceType = "scsi-hardDisk"
+scsi0:0.fileName = "/data/vmware/disk.vmdk"
+floppy0.present = "false"
+floppy1.present = "false"
+ethernet0.present = "true"
+ethernet0.virtualDev = "e1000"
+ethernet0.connectionType = "hostonly"
+ethernet0.addressType = "static"
+ethernet0.address = "00:90:b9:dc:ea:81"
+ethernet0.checkMACAddress = "false"
+svga.vramSize = "4194304"
+pciBridge0.present = "true"
+pciBridge4.present = "true"
+pciBridge4.virtualDev = "pcieRootPort"
+pciBridge4.functions = "8"
+pciBridge5.present = "true"
+pciBridge5.virtualDev = "pcieRootPort"
+pciBridge5.functions = "8"
+pciBridge6.present = "true"
+pciBridge6.virtualDev = "pcieRootPort"
+pciBridge6.functions = "8"
+pciBridge7.present = "true"
+pciBridge7.virtualDev = "pcieRootPort"
+pciBridge7.functions = "8"
+vmci0.present = "true"
diff --git a/tests/xml2vmxdata/xml2vmx-fusion-in-the-wild-2.xml b/tests/xml2vmxdata/xml2vmx-fusion-in-the-wild-2.xml
new file mode 100644
index 0000000000..be988e1bd9
--- /dev/null
+++ b/tests/xml2vmxdata/xml2vmx-fusion-in-the-wild-2.xml
@@ -0,0 +1,31 @@
+<domain type='vmware'>
+ <name>Windows 10 x64</name>
+ <uuid>564d08c1-40dd-1395-8501-b3af4774247d</uuid>
+ <memory unit='KiB'>6889472</memory>
+ <currentMemory unit='KiB'>6889472</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='x86_64'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <disk type='file' device='disk'>
+ <source file='/data/vmware/disk.vmdk'/>
+ <target dev='sda' bus='scsi'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+ </disk>
+ <controller type='scsi' index='0' model='lsisas1068'/>
+ <interface type='network'>
+ <mac address='00:90:b9:dc:ea:81'/>
+ <source network=''/>
+ <model type='e1000'/>
+ </interface>
+ <video>
+ <model type='vmvga' vram='4096' primary='yes'/>
+ </video>
+ </devices>
+</domain>
diff --git a/tests/xml2vmxtest.c b/tests/xml2vmxtest.c
index f6bcd7b012..e9bde580eb 100644
--- a/tests/xml2vmxtest.c
+++ b/tests/xml2vmxtest.c
@@ -290,6 +290,7 @@ mymain(void)
DO_TEST("ws-in-the-wild-2", "ws-in-the-wild-2", 8);
DO_TEST("fusion-in-the-wild-1", "fusion-in-the-wild-1", 9);
+ DO_TEST("fusion-in-the-wild-2", "fusion-in-the-wild-2", 9);
DO_TEST("annotation", "annotation", 4);
--
2.17.1
6 years, 4 months
[libvirt] [PATCH 00/24] tests: qemu: Clean up disk testing (blockdev-add saga)
by Peter Krempa
Clean up many test files and add CAPS_LATEST versions of tests which
will change when we switch from -drive to -blockdev
This series removes many duplicated and obsolete tests and adds much
more useful CAPS_LATEST testing
Peter Krempa (24):
tests: qemu: Drop 'drive' from disk tests
tests: qemuxml2xml: Remove duplicate test disk-copy-on-read.xml
tests: qemuxml2argv: Add 'CAPS_LATEST' version of "disk-copy_on_read"
tests: qemuxml2argv: Remove tests obsoleted by assuming support for
'-device'
tests: qemuxml2argv: Unify network cdrom source testing
tests: qemuxml2argv: Unify testing of local cdroms
tests: qemuxml2argv: Add 'CAPS_LATEST' data for disk-cdrom* tests
tests: qemuxml2argv: Add 'CAPS_LATEST' version for
'disk-detect-zeroes'
tests: qemuxml2argv: Add 'CAPS_LATEST' version of 'disk-aio' test
tests: qemuxml2argv: Rename disk-write-cache test do disk-cache
tests: qemu: Add xml2xml and minimal version of 'disk-cache' test
tests: qemu: Unify disk cache testing
tests: qemu: Unify iscsi disk source testing
tests: qemuxml2argv: Add 'CAPS_LATEST' version of 'disk-network-iscsi'
tests: qemu: Unify nbd disk source testing
tests: qemuxml2argv: Add 'CAPS_LATEST' version of 'disk-network-nbd'
tests: qemu: Remove pointless 'disk-networ-ceph-env' test
tests: qemuxml2argv: Unify testing of 'disk-network-rbd'
tests: qemu: Remove pointless 'disks-many' test
tests: qemuxml2argv: Add CAPS_LATEST version of 'disk-floppy' and
'floppy-drive-fat'
tests: qemuxml2argv: Add CAPS_LATEST version of 'disk-readonly' and
'disk-shared'
tests: qemuxml2argv: Add CAPS_LATEST version of 'disk-network-gluster'
tests: qemuxml2argv: Add CAPS_LATEST version of
'disk-network-sheepdog'
tests: qemuxml2argv: Add CAPS_LATEST version of security-related tests
...ress-conflict.xml => disk-address-conflict.xml} | 0
tests/qemuxml2argvdata/disk-aio.x86_64-latest.args | 37 +++++++
...-drive-boot-cdrom.args => disk-boot-cdrom.args} | 0
...sk-drive-boot-cdrom.xml => disk-boot-cdrom.xml} | 0
...sk-drive-boot-disk.args => disk-boot-disk.args} | 0
...disk-drive-boot-disk.xml => disk-boot-disk.xml} | 0
tests/qemuxml2argvdata/disk-cache.args | 41 ++++++++
..._64-2.6.0.args => disk-cache.x86_64-2.6.0.args} | 3 +
..._64-2.7.0.args => disk-cache.x86_64-2.7.0.args} | 4 +
...4-latest.args => disk-cache.x86_64-latest.args} | 4 +
.../{disk-drive-write-cache.xml => disk-cache.xml} | 6 ++
tests/qemuxml2argvdata/disk-cdrom-empty.args | 28 ------
tests/qemuxml2argvdata/disk-cdrom-empty.xml | 36 -------
tests/qemuxml2argvdata/disk-cdrom-network-ftp.args | 27 -----
tests/qemuxml2argvdata/disk-cdrom-network-ftp.xml | 36 -------
.../qemuxml2argvdata/disk-cdrom-network-ftps.args | 27 -----
tests/qemuxml2argvdata/disk-cdrom-network-ftps.xml | 36 -------
.../qemuxml2argvdata/disk-cdrom-network-http.args | 27 -----
tests/qemuxml2argvdata/disk-cdrom-network-http.xml | 36 -------
.../qemuxml2argvdata/disk-cdrom-network-tftp.args | 27 -----
tests/qemuxml2argvdata/disk-cdrom-network-tftp.xml | 36 -------
...-network-https.args => disk-cdrom-network.args} | 9 ++
.../disk-cdrom-network.x86_64-latest.args | 41 ++++++++
...om-network-https.xml => disk-cdrom-network.xml} | 27 +++++
.../disk-cdrom-tray-no-device-cap.args | 29 ------
.../disk-cdrom-tray-no-device-cap.xml | 32 ------
.../disk-cdrom-tray.x86_64-latest.args | 39 +++++++
tests/qemuxml2argvdata/disk-cdrom.args | 4 +-
.../qemuxml2argvdata/disk-cdrom.x86_64-latest.args | 35 +++++++
tests/qemuxml2argvdata/disk-cdrom.xml | 6 ++
.../disk-copy_on_read.x86_64-latest.args | 41 ++++++++
...-detect-zeroes.args => disk-detect-zeroes.args} | 0
.../disk-detect-zeroes.x86_64-latest.args | 37 +++++++
...ve-detect-zeroes.xml => disk-detect-zeroes.xml} | 0
.../{disk-drive-discard.args => disk-discard.args} | 0
.../{disk-drive-discard.xml => disk-discard.xml} | 0
.../disk-drive-cache-directsync.args | 30 ------
.../disk-drive-cache-directsync.xml | 37 -------
.../qemuxml2argvdata/disk-drive-cache-unsafe.args | 30 ------
tests/qemuxml2argvdata/disk-drive-cache-unsafe.xml | 37 -------
.../qemuxml2argvdata/disk-drive-cache-v2-none.args | 30 ------
.../qemuxml2argvdata/disk-drive-cache-v2-none.xml | 37 -------
tests/qemuxml2argvdata/disk-drive-cache-v2-wb.args | 30 ------
tests/qemuxml2argvdata/disk-drive-cache-v2-wb.xml | 37 -------
tests/qemuxml2argvdata/disk-drive-cache-v2-wt.args | 30 ------
tests/qemuxml2argvdata/disk-drive-cache-v2-wt.xml | 37 -------
tests/qemuxml2argvdata/disk-drive-copy-on-read.xml | 30 ------
.../disk-drive-network-iscsi-lun.args | 29 ------
.../disk-drive-network-iscsi-lun.xml | 28 ------
.../qemuxml2argvdata/disk-drive-network-iscsi.args | 32 ------
.../qemuxml2argvdata/disk-drive-network-iscsi.xml | 37 -------
.../disk-drive-network-nbd-export.args | 30 ------
.../disk-drive-network-nbd-export.xml | 37 -------
.../disk-drive-network-nbd-ipv6-export.args | 29 ------
.../disk-drive-network-nbd-ipv6-export.xml | 37 -------
.../disk-drive-network-nbd-ipv6.args | 29 ------
.../disk-drive-network-nbd-ipv6.xml | 37 -------
.../disk-drive-network-nbd-unix.args | 30 ------
.../disk-drive-network-nbd-unix.xml | 37 -------
tests/qemuxml2argvdata/disk-drive-network-nbd.args | 29 ------
tests/qemuxml2argvdata/disk-drive-network-nbd.xml | 37 -------
.../disk-drive-network-rbd-auth-AES.xml | 55 ----------
.../disk-drive-network-rbd-auth.args | 32 ------
.../disk-drive-network-rbd-auth.xml | 42 --------
.../disk-drive-network-rbd-ceph-env.args | 25 -----
.../disk-drive-network-rbd-ceph-env.xml | 39 -------
.../disk-drive-network-rbd-ipv6.args | 31 ------
.../disk-drive-network-rbd-ipv6.xml | 40 --------
.../disk-drive-readonly-no-device.args | 30 ------
.../disk-drive-readonly-no-device.xml | 32 ------
...ve-error-policy.args => disk-error-policy.args} | 0
...t.args => disk-error-policy.x86_64-latest.args} | 0
...rive-error-policy.xml => disk-error-policy.xml} | 0
.../disk-floppy-tray-no-device-cap.xml | 37 -------
...ice-cap.args => disk-floppy.x86_64-latest.args} | 20 ++--
.../{disk-drive-fmt-cow.xml => disk-fmt-cow.xml} | 0
.../{disk-drive-fmt-dir.xml => disk-fmt-dir.xml} | 0
.../{disk-drive-fmt-iso.xml => disk-fmt-iso.xml} | 0
...disk-drive-fmt-qcow.args => disk-fmt-qcow.args} | 0
.../{disk-drive-fmt-qcow.xml => disk-fmt-qcow.xml} | 0
...sk-ide-drive-split.args => disk-ide-split.args} | 0
...disk-ide-drive-split.xml => disk-ide-split.xml} | 0
tests/qemuxml2argvdata/disk-many.args | 32 ------
tests/qemuxml2argvdata/disk-many.xml | 48 ---------
...work-gluster.args => disk-network-gluster.args} | 0
.../disk-network-gluster.x86_64-latest.args | 44 ++++++++
...etwork-gluster.xml => disk-network-gluster.xml} | 0
...disk-network-iscsi-auth-secrettype-invalid.xml} | 0
...> disk-network-iscsi-auth-wrong-secrettype.xml} | 0
...ork-iscsi-auth.args => disk-network-iscsi.args} | 25 +++--
.../disk-network-iscsi.x86_64-latest.args | 63 ++++++++++++
...twork-iscsi-auth.xml => disk-network-iscsi.xml} | 26 ++++-
...rive-network-rbd.args => disk-network-nbd.args} | 21 ++--
.../disk-network-nbd.x86_64-latest.args | 46 +++++++++
tests/qemuxml2argvdata/disk-network-nbd.xml | 59 +++++++++++
...-no-colon.xml => disk-network-rbd-no-colon.xml} | 0
.../disk-network-rbd.x86_64-2.5.0.args | 55 ++++++++++
.../disk-network-rbd.x86_64-latest.args | 61 +++++++++++
...-drive-network-rbd.xml => disk-network-rbd.xml} | 28 ++++--
...rk-sheepdog.args => disk-network-sheepdog.args} | 0
.../disk-network-sheepdog.x86_64-latest.args | 35 +++++++
...work-sheepdog.xml => disk-network-sheepdog.xml} | 0
...-both.xml => disk-network-source-auth-both.xml} | 0
...rce-auth.args => disk-network-source-auth.args} | 0
...=> disk-network-source-auth.x86_64-latest.args} | 38 +++----
...ource-auth.xml => disk-network-source-auth.xml} | 0
...work-tlsx509.args => disk-network-tlsx509.args} | 0
.../disk-network-tlsx509.x86_64-latest.args | 59 +++++++++++
...etwork-tlsx509.xml => disk-network-tlsx509.xml} | 0
...ve-network-vxhs.args => disk-network-vxhs.args} | 0
...rive-network-vxhs.xml => disk-network-vxhs.xml} | 0
.../{disk-drive-no-boot.args => disk-no-boot.args} | 0
.../{disk-drive-no-boot.xml => disk-no-boot.xml} | 0
...-readonly-disk.args => disk-readonly-disk.args} | 0
.../disk-readonly-disk.x86_64-latest.args | 34 +++++++
...ve-readonly-disk.xml => disk-readonly-disk.xml} | 0
...hared-locking.args => disk-shared-locking.args} | 0
...-shared-locking.xml => disk-shared-locking.xml} | 0
...-drive-shared-qcow.xml => disk-shared-qcow.xml} | 0
.../{disk-drive-shared.args => disk-shared.args} | 0
.../disk-shared.x86_64-latest.args | 37 +++++++
.../{disk-drive-shared.xml => disk-shared.xml} | 0
...o-drive-queues.args => disk-virtio-queues.args} | 0
...tio-drive-queues.xml => disk-virtio-queues.xml} | 0
.../floppy-drive-fat.x86_64-latest.args | 33 ++++++
tests/qemuxml2argvtest.c | 112 ++++++++++-----------
...sk-drive-boot-cdrom.xml => disk-boot-cdrom.xml} | 0
...disk-drive-boot-disk.xml => disk-boot-disk.xml} | 0
.../{disk-many.xml => disk-cache.xml} | 36 ++++---
tests/qemuxml2xmloutdata/disk-cdrom-empty.xml | 40 --------
tests/qemuxml2xmloutdata/disk-cdrom.xml | 6 ++
tests/qemuxml2xmloutdata/disk-detect-zeroes.xml | 1 +
.../{disk-drive-discard.xml => disk-discard.xml} | 0
.../disk-drive-cache-directsync.xml | 41 --------
.../qemuxml2xmloutdata/disk-drive-cache-unsafe.xml | 41 --------
.../disk-drive-cache-v2-none.xml | 41 --------
.../qemuxml2xmloutdata/disk-drive-cache-v2-wb.xml | 41 --------
.../qemuxml2xmloutdata/disk-drive-cache-v2-wt.xml | 41 --------
.../qemuxml2xmloutdata/disk-drive-copy-on-read.xml | 36 -------
.../disk-drive-detect-zeroes.xml | 1 -
.../disk-drive-network-iscsi.xml | 41 --------
.../disk-drive-network-nbd-export.xml | 42 --------
.../disk-drive-network-nbd-ipv6-export.xml | 42 --------
.../disk-drive-network-nbd-ipv6.xml | 42 --------
.../disk-drive-network-nbd-unix.xml | 42 --------
.../qemuxml2xmloutdata/disk-drive-network-nbd.xml | 42 --------
.../disk-drive-network-rbd-auth.xml | 47 ---------
.../disk-drive-network-rbd-ceph-env.xml | 44 --------
.../disk-drive-network-rbd-ipv6.xml | 45 ---------
...rive-error-policy.xml => disk-error-policy.xml} | 0
.../{disk-drive-fat.xml => disk-fat.xml} | 0
.../{disk-drive-fmt-qcow.xml => disk-fmt-qcow.xml} | 0
...etwork-gluster.xml => disk-network-gluster.xml} | 0
...twork-iscsi-auth.xml => disk-network-iscsi.xml} | 35 ++++++-
tests/qemuxml2xmloutdata/disk-network-nbd.xml | 68 +++++++++++++
...-drive-network-rbd.xml => disk-network-rbd.xml} | 30 ++++--
...work-sheepdog.xml => disk-network-sheepdog.xml} | 0
...ource-auth.xml => disk-network-source-auth.xml} | 0
...etwork-tlsx509.xml => disk-network-tlsx509.xml} | 0
...rive-network-vxhs.xml => disk-network-vxhs.xml} | 0
...tio-drive-queues.xml => disk-virtio-queues.xml} | 0
tests/qemuxml2xmltest.c | 47 +++------
162 files changed, 1184 insertions(+), 2481 deletions(-)
rename tests/qemuxml2argvdata/{disk-drive-address-conflict.xml => disk-address-conflict.xml} (100%)
create mode 100644 tests/qemuxml2argvdata/disk-aio.x86_64-latest.args
rename tests/qemuxml2argvdata/{disk-drive-boot-cdrom.args => disk-boot-cdrom.args} (100%)
rename tests/qemuxml2argvdata/{disk-drive-boot-cdrom.xml => disk-boot-cdrom.xml} (100%)
rename tests/qemuxml2argvdata/{disk-drive-boot-disk.args => disk-boot-disk.args} (100%)
rename tests/qemuxml2argvdata/{disk-drive-boot-disk.xml => disk-boot-disk.xml} (100%)
create mode 100644 tests/qemuxml2argvdata/disk-cache.args
rename tests/qemuxml2argvdata/{disk-drive-write-cache.x86_64-2.6.0.args => disk-cache.x86_64-2.6.0.args} (90%)
rename tests/qemuxml2argvdata/{disk-drive-write-cache.x86_64-2.7.0.args => disk-cache.x86_64-2.7.0.args} (90%)
rename tests/qemuxml2argvdata/{disk-drive-write-cache.x86_64-latest.args => disk-cache.x86_64-latest.args} (90%)
rename tests/qemuxml2argvdata/{disk-drive-write-cache.xml => disk-cache.xml} (86%)
delete mode 100644 tests/qemuxml2argvdata/disk-cdrom-empty.args
delete mode 100644 tests/qemuxml2argvdata/disk-cdrom-empty.xml
delete mode 100644 tests/qemuxml2argvdata/disk-cdrom-network-ftp.args
delete mode 100644 tests/qemuxml2argvdata/disk-cdrom-network-ftp.xml
delete mode 100644 tests/qemuxml2argvdata/disk-cdrom-network-ftps.args
delete mode 100644 tests/qemuxml2argvdata/disk-cdrom-network-ftps.xml
delete mode 100644 tests/qemuxml2argvdata/disk-cdrom-network-http.args
delete mode 100644 tests/qemuxml2argvdata/disk-cdrom-network-http.xml
delete mode 100644 tests/qemuxml2argvdata/disk-cdrom-network-tftp.args
delete mode 100644 tests/qemuxml2argvdata/disk-cdrom-network-tftp.xml
rename tests/qemuxml2argvdata/{disk-cdrom-network-https.args => disk-cdrom-network.args} (58%)
create mode 100644 tests/qemuxml2argvdata/disk-cdrom-network.x86_64-latest.args
rename tests/qemuxml2argvdata/{disk-cdrom-network-https.xml => disk-cdrom-network.xml} (52%)
delete mode 100644 tests/qemuxml2argvdata/disk-cdrom-tray-no-device-cap.args
delete mode 100644 tests/qemuxml2argvdata/disk-cdrom-tray-no-device-cap.xml
create mode 100644 tests/qemuxml2argvdata/disk-cdrom-tray.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/disk-cdrom.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/disk-copy_on_read.x86_64-latest.args
rename tests/qemuxml2argvdata/{disk-drive-detect-zeroes.args => disk-detect-zeroes.args} (100%)
create mode 100644 tests/qemuxml2argvdata/disk-detect-zeroes.x86_64-latest.args
rename tests/qemuxml2argvdata/{disk-drive-detect-zeroes.xml => disk-detect-zeroes.xml} (100%)
rename tests/qemuxml2argvdata/{disk-drive-discard.args => disk-discard.args} (100%)
rename tests/qemuxml2argvdata/{disk-drive-discard.xml => disk-discard.xml} (100%)
delete mode 100644 tests/qemuxml2argvdata/disk-drive-cache-directsync.args
delete mode 100644 tests/qemuxml2argvdata/disk-drive-cache-directsync.xml
delete mode 100644 tests/qemuxml2argvdata/disk-drive-cache-unsafe.args
delete mode 100644 tests/qemuxml2argvdata/disk-drive-cache-unsafe.xml
delete mode 100644 tests/qemuxml2argvdata/disk-drive-cache-v2-none.args
delete mode 100644 tests/qemuxml2argvdata/disk-drive-cache-v2-none.xml
delete mode 100644 tests/qemuxml2argvdata/disk-drive-cache-v2-wb.args
delete mode 100644 tests/qemuxml2argvdata/disk-drive-cache-v2-wb.xml
delete mode 100644 tests/qemuxml2argvdata/disk-drive-cache-v2-wt.args
delete mode 100644 tests/qemuxml2argvdata/disk-drive-cache-v2-wt.xml
delete mode 100644 tests/qemuxml2argvdata/disk-drive-copy-on-read.xml
delete mode 100644 tests/qemuxml2argvdata/disk-drive-network-iscsi-lun.args
delete mode 100644 tests/qemuxml2argvdata/disk-drive-network-iscsi-lun.xml
delete mode 100644 tests/qemuxml2argvdata/disk-drive-network-iscsi.args
delete mode 100644 tests/qemuxml2argvdata/disk-drive-network-iscsi.xml
delete mode 100644 tests/qemuxml2argvdata/disk-drive-network-nbd-export.args
delete mode 100644 tests/qemuxml2argvdata/disk-drive-network-nbd-export.xml
delete mode 100644 tests/qemuxml2argvdata/disk-drive-network-nbd-ipv6-export.args
delete mode 100644 tests/qemuxml2argvdata/disk-drive-network-nbd-ipv6-export.xml
delete mode 100644 tests/qemuxml2argvdata/disk-drive-network-nbd-ipv6.args
delete mode 100644 tests/qemuxml2argvdata/disk-drive-network-nbd-ipv6.xml
delete mode 100644 tests/qemuxml2argvdata/disk-drive-network-nbd-unix.args
delete mode 100644 tests/qemuxml2argvdata/disk-drive-network-nbd-unix.xml
delete mode 100644 tests/qemuxml2argvdata/disk-drive-network-nbd.args
delete mode 100644 tests/qemuxml2argvdata/disk-drive-network-nbd.xml
delete mode 100644 tests/qemuxml2argvdata/disk-drive-network-rbd-auth-AES.xml
delete mode 100644 tests/qemuxml2argvdata/disk-drive-network-rbd-auth.args
delete mode 100644 tests/qemuxml2argvdata/disk-drive-network-rbd-auth.xml
delete mode 100644 tests/qemuxml2argvdata/disk-drive-network-rbd-ceph-env.args
delete mode 100644 tests/qemuxml2argvdata/disk-drive-network-rbd-ceph-env.xml
delete mode 100644 tests/qemuxml2argvdata/disk-drive-network-rbd-ipv6.args
delete mode 100644 tests/qemuxml2argvdata/disk-drive-network-rbd-ipv6.xml
delete mode 100644 tests/qemuxml2argvdata/disk-drive-readonly-no-device.args
delete mode 100644 tests/qemuxml2argvdata/disk-drive-readonly-no-device.xml
rename tests/qemuxml2argvdata/{disk-drive-error-policy.args => disk-error-policy.args} (100%)
rename tests/qemuxml2argvdata/{disk-drive-error-policy.x86_64-latest.args => disk-error-policy.x86_64-latest.args} (100%)
rename tests/qemuxml2argvdata/{disk-drive-error-policy.xml => disk-error-policy.xml} (100%)
delete mode 100644 tests/qemuxml2argvdata/disk-floppy-tray-no-device-cap.xml
rename tests/qemuxml2argvdata/{disk-floppy-tray-no-device-cap.args => disk-floppy.x86_64-latest.args} (53%)
rename tests/qemuxml2argvdata/{disk-drive-fmt-cow.xml => disk-fmt-cow.xml} (100%)
rename tests/qemuxml2argvdata/{disk-drive-fmt-dir.xml => disk-fmt-dir.xml} (100%)
rename tests/qemuxml2argvdata/{disk-drive-fmt-iso.xml => disk-fmt-iso.xml} (100%)
rename tests/qemuxml2argvdata/{disk-drive-fmt-qcow.args => disk-fmt-qcow.args} (100%)
rename tests/qemuxml2argvdata/{disk-drive-fmt-qcow.xml => disk-fmt-qcow.xml} (100%)
rename tests/qemuxml2argvdata/{disk-ide-drive-split.args => disk-ide-split.args} (100%)
rename tests/qemuxml2argvdata/{disk-ide-drive-split.xml => disk-ide-split.xml} (100%)
delete mode 100644 tests/qemuxml2argvdata/disk-many.args
delete mode 100644 tests/qemuxml2argvdata/disk-many.xml
rename tests/qemuxml2argvdata/{disk-drive-network-gluster.args => disk-network-gluster.args} (100%)
create mode 100644 tests/qemuxml2argvdata/disk-network-gluster.x86_64-latest.args
rename tests/qemuxml2argvdata/{disk-drive-network-gluster.xml => disk-network-gluster.xml} (100%)
rename tests/qemuxml2argvdata/{disk-drive-network-iscsi-auth-secrettype-invalid.xml => disk-network-iscsi-auth-secrettype-invalid.xml} (100%)
rename tests/qemuxml2argvdata/{disk-drive-network-iscsi-auth-wrong-secrettype.xml => disk-network-iscsi-auth-wrong-secrettype.xml} (100%)
rename tests/qemuxml2argvdata/{disk-drive-network-iscsi-auth.args => disk-network-iscsi.args} (54%)
create mode 100644 tests/qemuxml2argvdata/disk-network-iscsi.x86_64-latest.args
rename tests/qemuxml2argvdata/{disk-drive-network-iscsi-auth.xml => disk-network-iscsi.xml} (63%)
rename tests/qemuxml2argvdata/{disk-drive-network-rbd.args => disk-network-nbd.args} (56%)
create mode 100644 tests/qemuxml2argvdata/disk-network-nbd.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/disk-network-nbd.xml
rename tests/qemuxml2argvdata/{disk-drive-network-rbd-no-colon.xml => disk-network-rbd-no-colon.xml} (100%)
create mode 100644 tests/qemuxml2argvdata/disk-network-rbd.x86_64-2.5.0.args
create mode 100644 tests/qemuxml2argvdata/disk-network-rbd.x86_64-latest.args
rename tests/qemuxml2argvdata/{disk-drive-network-rbd.xml => disk-network-rbd.xml} (71%)
rename tests/qemuxml2argvdata/{disk-drive-network-sheepdog.args => disk-network-sheepdog.args} (100%)
create mode 100644 tests/qemuxml2argvdata/disk-network-sheepdog.x86_64-latest.args
rename tests/qemuxml2argvdata/{disk-drive-network-sheepdog.xml => disk-network-sheepdog.xml} (100%)
rename tests/qemuxml2argvdata/{disk-drive-network-source-auth-both.xml => disk-network-source-auth-both.xml} (100%)
rename tests/qemuxml2argvdata/{disk-drive-network-source-auth.args => disk-network-source-auth.args} (100%)
rename tests/qemuxml2argvdata/{disk-drive-network-rbd-auth-AES.args => disk-network-source-auth.x86_64-latest.args} (51%)
rename tests/qemuxml2argvdata/{disk-drive-network-source-auth.xml => disk-network-source-auth.xml} (100%)
rename tests/qemuxml2argvdata/{disk-drive-network-tlsx509.args => disk-network-tlsx509.args} (100%)
create mode 100644 tests/qemuxml2argvdata/disk-network-tlsx509.x86_64-latest.args
rename tests/qemuxml2argvdata/{disk-drive-network-tlsx509.xml => disk-network-tlsx509.xml} (100%)
rename tests/qemuxml2argvdata/{disk-drive-network-vxhs.args => disk-network-vxhs.args} (100%)
rename tests/qemuxml2argvdata/{disk-drive-network-vxhs.xml => disk-network-vxhs.xml} (100%)
rename tests/qemuxml2argvdata/{disk-drive-no-boot.args => disk-no-boot.args} (100%)
rename tests/qemuxml2argvdata/{disk-drive-no-boot.xml => disk-no-boot.xml} (100%)
rename tests/qemuxml2argvdata/{disk-drive-readonly-disk.args => disk-readonly-disk.args} (100%)
create mode 100644 tests/qemuxml2argvdata/disk-readonly-disk.x86_64-latest.args
rename tests/qemuxml2argvdata/{disk-drive-readonly-disk.xml => disk-readonly-disk.xml} (100%)
rename tests/qemuxml2argvdata/{disk-drive-shared-locking.args => disk-shared-locking.args} (100%)
rename tests/qemuxml2argvdata/{disk-drive-shared-locking.xml => disk-shared-locking.xml} (100%)
rename tests/qemuxml2argvdata/{disk-drive-shared-qcow.xml => disk-shared-qcow.xml} (100%)
rename tests/qemuxml2argvdata/{disk-drive-shared.args => disk-shared.args} (100%)
create mode 100644 tests/qemuxml2argvdata/disk-shared.x86_64-latest.args
rename tests/qemuxml2argvdata/{disk-drive-shared.xml => disk-shared.xml} (100%)
rename tests/qemuxml2argvdata/{disk-virtio-drive-queues.args => disk-virtio-queues.args} (100%)
rename tests/qemuxml2argvdata/{disk-virtio-drive-queues.xml => disk-virtio-queues.xml} (100%)
create mode 100644 tests/qemuxml2argvdata/floppy-drive-fat.x86_64-latest.args
rename tests/qemuxml2xmloutdata/{disk-drive-boot-cdrom.xml => disk-boot-cdrom.xml} (100%)
rename tests/qemuxml2xmloutdata/{disk-drive-boot-disk.xml => disk-boot-disk.xml} (100%)
rename tests/qemuxml2xmloutdata/{disk-many.xml => disk-cache.xml} (54%)
delete mode 100644 tests/qemuxml2xmloutdata/disk-cdrom-empty.xml
create mode 120000 tests/qemuxml2xmloutdata/disk-detect-zeroes.xml
rename tests/qemuxml2xmloutdata/{disk-drive-discard.xml => disk-discard.xml} (100%)
delete mode 100644 tests/qemuxml2xmloutdata/disk-drive-cache-directsync.xml
delete mode 100644 tests/qemuxml2xmloutdata/disk-drive-cache-unsafe.xml
delete mode 100644 tests/qemuxml2xmloutdata/disk-drive-cache-v2-none.xml
delete mode 100644 tests/qemuxml2xmloutdata/disk-drive-cache-v2-wb.xml
delete mode 100644 tests/qemuxml2xmloutdata/disk-drive-cache-v2-wt.xml
delete mode 100644 tests/qemuxml2xmloutdata/disk-drive-copy-on-read.xml
delete mode 120000 tests/qemuxml2xmloutdata/disk-drive-detect-zeroes.xml
delete mode 100644 tests/qemuxml2xmloutdata/disk-drive-network-iscsi.xml
delete mode 100644 tests/qemuxml2xmloutdata/disk-drive-network-nbd-export.xml
delete mode 100644 tests/qemuxml2xmloutdata/disk-drive-network-nbd-ipv6-export.xml
delete mode 100644 tests/qemuxml2xmloutdata/disk-drive-network-nbd-ipv6.xml
delete mode 100644 tests/qemuxml2xmloutdata/disk-drive-network-nbd-unix.xml
delete mode 100644 tests/qemuxml2xmloutdata/disk-drive-network-nbd.xml
delete mode 100644 tests/qemuxml2xmloutdata/disk-drive-network-rbd-auth.xml
delete mode 100644 tests/qemuxml2xmloutdata/disk-drive-network-rbd-ceph-env.xml
delete mode 100644 tests/qemuxml2xmloutdata/disk-drive-network-rbd-ipv6.xml
rename tests/qemuxml2xmloutdata/{disk-drive-error-policy.xml => disk-error-policy.xml} (100%)
rename tests/qemuxml2xmloutdata/{disk-drive-fat.xml => disk-fat.xml} (100%)
rename tests/qemuxml2xmloutdata/{disk-drive-fmt-qcow.xml => disk-fmt-qcow.xml} (100%)
rename tests/qemuxml2xmloutdata/{disk-drive-network-gluster.xml => disk-network-gluster.xml} (100%)
rename tests/qemuxml2xmloutdata/{disk-drive-network-iscsi-auth.xml => disk-network-iscsi.xml} (59%)
create mode 100644 tests/qemuxml2xmloutdata/disk-network-nbd.xml
rename tests/qemuxml2xmloutdata/{disk-drive-network-rbd.xml => disk-network-rbd.xml} (72%)
rename tests/qemuxml2xmloutdata/{disk-drive-network-sheepdog.xml => disk-network-sheepdog.xml} (100%)
rename tests/qemuxml2xmloutdata/{disk-drive-network-source-auth.xml => disk-network-source-auth.xml} (100%)
rename tests/qemuxml2xmloutdata/{disk-drive-network-tlsx509.xml => disk-network-tlsx509.xml} (100%)
rename tests/qemuxml2xmloutdata/{disk-drive-network-vxhs.xml => disk-network-vxhs.xml} (100%)
rename tests/qemuxml2xmloutdata/{disk-virtio-drive-queues.xml => disk-virtio-queues.xml} (100%)
--
2.16.2
6 years, 4 months
[libvirt] [PATCH] libvirt_iohelper: record the libvirt_iohelper's error message at virFileWrapperFdFree
by xinhua.Cao
Currently iohelper's error log is recorded in virFileWrapperFdClose.
In qemuDomainSaveMemory, it usually fails at qemuMigrationSrcToFile,
and then goto cleanup, so the iohelper error log is not recorded,
and so is the another placement. We now record the error log of
iohelper by move it to the virFileWrapperFdFree record.
There is another problem here, that is, virCommandWait is also not
called, but I can't evaluate this impact. So no changes have been
made here.
---
src/util/virfile.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/util/virfile.c b/src/util/virfile.c
index 1faeebb..30456ab 100644
--- a/src/util/virfile.c
+++ b/src/util/virfile.c
@@ -330,9 +330,6 @@ virFileWrapperFdClose(virFileWrapperFdPtr wfd)
return 0;
ret = virCommandWait(wfd->cmd, NULL);
- if (wfd->err_msg && *wfd->err_msg)
- VIR_WARN("iohelper reports: %s", wfd->err_msg);
-
return ret;
}
@@ -351,6 +348,9 @@ virFileWrapperFdFree(virFileWrapperFdPtr wfd)
if (!wfd)
return;
+ if (wfd->err_msg && *wfd->err_msg)
+ VIR_WARN("iohelper reports: %s", wfd->err_msg);
+
VIR_FREE(wfd->err_msg);
virCommandFree(wfd->cmd);
--
2.8.3
6 years, 4 months
[libvirt] [PATCH v2 0/8] virStr*cpy*() related fixes and cleanups
by Andrea Bolognani
Changes from [v1]:
* catch a bunch more suboptimal uses of the original API;
* improve the API so that it's both more sensible and fits
better with the rest of libvirt.
[v1] https://www.redhat.com/archives/libvir-list/2018-July/msg01044.html
Andrea Bolognani (8):
src: Use virStrcpyStatic() to avoid truncation
src: Use virStrcpyStatic() wherever possible
src: Use VIR_STRDUP() wherever possible
src: Use virStrcpy() wherever possible
src: Don't rely on strncpy()-like behavior
src: Make virStr*cpy*() functions return an int
esx: Use memcpy() in esxVI_CURL_Debug()
util: Improve virStrncpy() implementation
docs/hacking.html.in | 29 +++++-----
src/conf/capabilities.c | 2 +-
src/conf/netdev_vport_profile_conf.c | 2 +-
src/conf/nwfilter_conf.c | 3 +-
src/esx/esx_driver.c | 8 +--
src/esx/esx_vi.c | 6 +-
src/esx/esx_vi_types.c | 2 +-
src/hyperv/hyperv_driver.c | 3 +-
src/libxl/libxl_conf.c | 2 +-
src/locking/lock_driver_sanlock.c | 25 ++++----
src/lxc/lxc_driver.c | 8 +--
src/nwfilter/nwfilter_dhcpsnoop.c | 2 +-
src/nwfilter/nwfilter_ebiptables_driver.c | 6 +-
src/nwfilter/nwfilter_learnipaddr.c | 2 +-
src/openvz/openvz_conf.c | 8 +--
src/qemu/qemu_agent.c | 2 +-
src/qemu/qemu_command.c | 2 +-
src/qemu/qemu_monitor.c | 2 +-
src/remote/remote_daemon_dispatch.c | 4 +-
src/remote/remote_driver.c | 4 +-
src/rpc/virnetlibsshsession.c | 4 +-
src/rpc/virnetsocket.c | 4 +-
src/security/security_apparmor.c | 2 +-
src/security/virt-aa-helper.c | 2 +-
src/test/test_driver.c | 4 +-
src/uml/uml_driver.c | 4 +-
src/util/virfdstream.c | 4 +-
src/util/virhostcpu.c | 4 +-
src/util/virhostmem.c | 6 +-
src/util/virlog.c | 5 +-
src/util/virnetdev.c | 12 ++--
src/util/virnetdevbridge.c | 6 +-
src/util/virnetdevtap.c | 4 +-
src/util/virnetdevvportprofile.c | 6 +-
src/util/virstring.c | 70 +++++++++++++++--------
src/util/virstring.h | 4 +-
src/util/virtypedparam.c | 8 +--
src/xenapi/xenapi_driver.c | 4 +-
src/xenconfig/xen_common.c | 38 ++++++------
src/xenconfig/xen_sxpr.c | 2 +-
src/xenconfig/xen_xl.c | 41 ++++++-------
src/xenconfig/xen_xm.c | 2 +-
42 files changed, 179 insertions(+), 179 deletions(-)
--
2.17.1
6 years, 4 months
[libvirt] [PATCH] tests: fix TLS handshake failure with TLS 1.3
by Daniel P. Berrangé
When gnutls negotiates TLS 1.3 instead of 1.2, the order of messages
sent by the handshake changes. This exposed a logic bug in the test
suite which caused us to wait for the server to see handshake
completion, but not wait for the client to see completion. The result
was the client didn't receive the certificate for verification and the
test failed.
This is exposed in Fedora 29 rawhide which has just enabled TLS 1.3 in
its GNUTLS builds.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
tests/virnettlssessiontest.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/virnettlssessiontest.c b/tests/virnettlssessiontest.c
index 7e85607181..375cc1bb02 100644
--- a/tests/virnettlssessiontest.c
+++ b/tests/virnettlssessiontest.c
@@ -180,7 +180,7 @@ static int testTLSSessionInit(const void *opaque)
if (rv == VIR_NET_TLS_HANDSHAKE_COMPLETE)
clientShake = true;
}
- } while (!clientShake && !serverShake);
+ } while (!clientShake || !serverShake);
/* Finally make sure the server validation does what
--
2.17.1
6 years, 4 months
[libvirt] [PATCHv4 00/15] Switch from yajl to Jansson
by Ján Tomko
Per the discussion here:
https://www.redhat.com/archives/libvir-list/2017-November/msg00225.html
Switch from using yajl to Jansson.
v1:
https://www.redhat.com/archives/libvir-list/2018-March/msg01781.html
v2:
https://www.redhat.com/archives/libvir-list/2018-May/msg00695.html
v3:
https://www.redhat.com/archives/libvir-list/2018-May/msg00850.html
v4:
Introduce a separate check for Jansson >= 2.8, which preserves
ordering of object keys. For older platforms (e.g. Debian 8),
skip tests that depend on stable ordering.
All patches except for 12/15 (trivial) and 15/15 (new) were ACK'd
already by either Peter or Andrea.
Tested on Debian 8 with libjansson-dev 2.7.
Also available on my repo:
http://repo.or.cz/libvirt/jtomko.git/ jansson-skip
Ján Tomko (15):
build: add --with-jansson
build: undef WITH_JANSSON for SETUID_RPC_CLIENT
Switch from yajl to Jansson
FIXUP: fix tests
FIXUP: Deprecate building --with-yajl
FIXUP: make nss depend on Jansson instead of yajl
FIXUP: compile and link with Jansson instead of yajl
FIXUP: s/WITH_YAJL/WITH_JANSSON/
FIXUP: libvirt.spec: use jansson instead of yajl
Remove functions using yajl
build: remove references to WITH_YAJL for SETUID_RPC_CLIENT
Remove virJSONValueNewStringLen
build: switch --with-qemu default from yes to check
build: require Jansson if QEMU driver is enabled
m4: Introduce STABLE_ORDERING_JANSSON
config-post.h | 3 +-
configure.ac | 3 +
libvirt.spec.in | 4 +-
m4/virt-driver-qemu.m4 | 9 +-
m4/virt-jansson.m4 | 32 ++
m4/virt-nss.m4 | 4 +-
m4/virt-yajl.m4 | 27 +-
src/Makefile.am | 8 +-
src/libvirt_private.syms | 1 -
src/qemu/qemu_driver.c | 2 +-
src/util/Makefile.inc.am | 4 +-
src/util/virjson.c | 616 +++++++------------------------
src/util/virjson.h | 1 -
tests/Makefile.am | 12 +-
tests/cputest.c | 16 +-
tests/libxlxml2domconfigtest.c | 4 +-
tests/qemuagenttest.c | 2 +-
tests/qemublocktest.c | 6 +
tests/qemucapabilitiestest.c | 7 +-
tests/qemucaps2xmltest.c | 2 +-
tests/qemucommandutiltest.c | 7 +-
tests/qemuhotplugtest.c | 7 +-
tests/qemumigparamsdata/empty.json | 4 +-
tests/qemumigparamsdata/unsupported.json | 4 +-
tests/qemumigparamstest.c | 7 +-
tests/qemumonitorjsontest.c | 7 +-
tests/virjsontest.c | 5 +
tests/virmacmaptest.c | 5 +
tests/virmacmaptestdata/empty.json | 4 +-
tests/virmocklibxl.c | 4 +-
tests/virnetdaemontest.c | 7 +-
tests/virstoragetest.c | 4 +-
32 files changed, 274 insertions(+), 554 deletions(-)
create mode 100644 m4/virt-jansson.m4
--
2.16.1
6 years, 4 months